[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Offline wardrobe/desc system via MUSHclient?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Offline wardrobe/desc system via MUSHclient?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Linda   Sweden  (164 posts)  [Biography] bio
Date Wed 01 Feb 2006 06:03 PM (UTC)
Message
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.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #1 on Thu 02 Feb 2006 06:50 AM (UTC)
Message
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.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Linda   Sweden  (164 posts)  [Biography] bio
Date Reply #2 on Thu 02 Feb 2006 09:42 AM (UTC)
Message
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?
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #3 on Thu 02 Feb 2006 10:17 AM (UTC)
Message
Lua might be a good solution for a tabular database of sorts. It's plain-text, and conveniently ships with MUSHclient already.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Nick Gammon   Australia  (21,384 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Thu 02 Feb 2006 09:55 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Linda   Sweden  (164 posts)  [Biography] bio
Date Reply #5 on Fri 03 Feb 2006 10:17 AM (UTC)
Message
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.
[Go to top] top

Posted by Nick Gammon   Australia  (21,384 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Sat 04 Feb 2006 05:34 AM (UTC)
Message
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

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Linda   Sweden  (164 posts)  [Biography] bio
Date Reply #7 on Sat 04 Feb 2006 11:07 AM (UTC)

Amended on Sat 04 Feb 2006 11:11 AM (UTC) by Linda

Message
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.

[Go to top] top

Posted by Nick Gammon   Australia  (21,384 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Tue 07 Feb 2006 12:37 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Linda   Sweden  (164 posts)  [Biography] bio
Date Reply #9 on Tue 07 Feb 2006 09:56 AM (UTC)

Amended on Tue 07 Feb 2006 07:12 PM (UTC) by Linda

Message
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?
[Go to top] top

Posted by Linda   Sweden  (164 posts)  [Biography] bio
Date Reply #10 on Tue 28 Feb 2006 12:52 PM (UTC)
Message
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. :)
[Go to top] top

Posted by Xevira   (11 posts)  [Biography] bio
Date Reply #11 on Tue 28 Feb 2006 02:34 PM (UTC)
Message
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.

[Go to top] top

Posted by Nick Gammon   Australia  (21,384 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Fri 03 Mar 2006 05:49 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Linda   Sweden  (164 posts)  [Biography] bio
Date Reply #13 on Sun 23 Apr 2006 02:16 PM (UTC)
Message
Was the new version already released and I missed it, or has it been delayed? :)
[Go to top] top

Posted by Nick Gammon   Australia  (21,384 posts)  [Biography] bio   Forum Administrator
Date Reply #14 on Sun 23 Apr 2006 09:59 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


7,290 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]