Offline wardrobe/desc system via MUSHclient?

Posted by Linda on Wed 01 Feb 2006 06:03 PM — 15 posts, 54,131 views.

Sweden #0
Putting this in the general section since I am not quite sure how it would best be accomplished. :)

Basically, I am wondering if anyone has any thoughts on how one could create a wardrobe/desc system that allows the text of the descs to be stored in a file rather than on the MUSH? I was thinking of offering something like this on my game to reduce the amount of database space taken up my descs.
Greece #1
If I understood correctly what you said, this can easily be accomplished by adding your items in a database (I recommend SQLite, it only creates one file and you don't have to install anything apart from the library) and then access it.

It would be pretty easy with Python and PySQLite3, anyway.
Sweden #2
Adding a database (even one that's easy to setup) sounds like it would mean far fewer players would be likely to attempt it than if the descs could be kept in a text file.

I'd also want the ease of editing that you get with a textfile, though I don't know if using one for this is at all possible. :) Though, plugins are just textfiles, aren't they?
USA #3
Lua might be a good solution for a tabular database of sorts. It's plain-text, and conveniently ships with MUSHclient already.
Australia Forum Administrator #4
Linda, are you planning to share this or simply have each player have their own description for their own use?

If you wanted to share descriptions, setting up a Wiki might be the way to go.

If for your personal use, one approach is to use a database, see this page:

http://www.gammon.com.au/mushclient/plugins/

The Calendar plugin illustrates saving/retrieving data from a database, that could be one way of doing it.

Another is simply to save in the plugin's "state file", which is saved every time the plugin is closed. That would however be different for every world (which you may want).

I think you will find that the amount saved however, would be very marginal (like 0.5% of memory for a modern PC), unless you had huge descriptions, hundreds of players, and convince them all to use your system.
Sweden #5
No, not planning to share the descs. Just give players access to a script/plugin so they could all do the same (if they use MUSHclient).

It started as something I just needed myself (because I do have lots of descs, and huge ones), since the admin on one game thought I was taking up too much memory (they're a rather big game, and limit what is allowed per player), but I figured that if I could get it to work in a not too-complex fashion, I would encourage players on own game to use it too.

Saving it in the plugin's 'state' file sounds like it might be the simplest approach, especially since it does need to be different for each world.
Australia Forum Administrator #6
OK, what would be helpful here would be to describe what you would like to see. Perhaps a couple of examples of what you would type, and what you would see. I presume you would need ways to:

* enter a new description
* modify an existing one
* delete one
Sweden #7
This is what I imagined:

+desc/store <name>=<text>

Stores <text> as <playername>_<name>.

+desc/wipe <name>

Wipes <playername>_<name>.

+desc/view <name>

Views <playername>_<name>

+desc/list

Shows a list of stored descs whose prefix matches <playername>. Ideally the list also displays the first 60 words from the desc.

+desc/set <name> <name> <name> (etc, ideally it should be able to take any number of variables, or at least anything from 1 to 6).

Copies the contents of each <playername>_<name> into attributes on the player that are named &DESC_ONE, &DESC_TWO, etc. This is so people can construct a desc from any number of pieces that they'd like.

Amended on Sat 04 Feb 2006 11:11 AM by Linda
Australia Forum Administrator #8
Well it could be done, but I can't help thinking you could store this just as easily in a word processor document, or little database or spreadsheet.
Sweden #9
Sure, but the point was that I wanted to be able to switch descs as quickly and easily as I can now, when I have them all stored on my player. :)

Most games offer a wardrobe/desc system, and players would not appreciate being told to just keep their descs in a file and copy and paste when they need to change. :)

Given the stuff I am looking for it to do, do you think simply saving the text of the descs in the plugin's state file is the best approach? If so, are there any current plugins that do something similar that I could take a look at?
Amended on Tue 07 Feb 2006 07:12 PM by Linda
Sweden #10
A little bumo for this one, in case someone can suggest a plugin that does something similar and could be changed without too much scripting knowledge. :)
#11
Hrm, would not using variables in the plugin serve the same function? You wouldn't need to worry about getting the plugin users to have the right addons, nor if they're using Lua, would require them to mess with the sandbox to gain IO functions for handling it in a file. Could use an index and just iterate from 1 to N when listing or selecting. You can pattern the variable names to be "desc_#_PART" where part is the component of the desc you're dealing with. Deleting a desc would involve deleting the given variable set. It may not be as cool as a database or file manipulation, but it's not that difficult AND every plugin language should be able to do it, so use what you're used to.

Australia Forum Administrator #12
I am looking at doing that using more of the GUI stuff I have been adding recently. Give this another bump in a week or so, when the new version is released.
Sweden #13
Was the new version already released and I missed it, or has it been delayed? :)
Australia Forum Administrator #14
No it hasn't. See the release notes:

http://www.gammon.com.au/scripts/showrelnote.php?version=3.74&productid=0

In it is mentioned utils.editbox - a script function which I thought might be useful for editing multi-line descriptions, like you propose.