[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]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Dynamic Character Descriptions
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Dynamic Character Descriptions

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


Posted by Cbond   USA  (19 posts)  [Biography] bio
Date Wed 15 Apr 2009 12:41 PM (UTC)
Message
First off, if this is in the wrong section, as in it should be in the General Mud Design section, I apologize in advance.

Okay, I'm trying to implement dynamic character descriptions into my SWR. Here's a brief explanation of how I'm seeing stuff working.

Using config +ddescs sets whether a player is using dynamic descriptions or not.
When you look at someone using them, the look command will shunt you off to something like show_ddesc_to_char instead of show_char_to_char like it normally would.
show_ddesc_to_char would take a bunch of set parameters and string them together, with worn eq changing the desc as necessary, to create a description. For instance, if I set my character as having brown hair, brown eyes, and scars criss-crossing my face, but I was wearing something on my head that has certain words in the description, like mask for instance, someone looking at me would just see something like "A mask covers their face." whereas not wearing something could show "He has brown hair, brown eyes and scars cover his face."

Having ddescs set on yourself, using the describe command would drop you into either something, like how in SMAUG you can lock yourself onto a mob/obj/room for editing and you can set various stuff about your character in there, or just give you a list of options you can configure to your liking, i.e. describe [hcolor|hstyle|build|skintone|etc.]. Then you could have a bunch of options under each type, like hcolor, that's set depending on your race i.e. describe hcolor brown, describe hstyle stringy.. and so on.

Right this moment however the issue I'm having trouble with is, how to store the various choices a player might make using this system. Do I do something like, say, add a bunch of new members to the char_data, or pc_data, structure to hold the stuff in? An int? A float? A string? An array? If so, single or multidimensional?

Anyone have any thoughts on how I can go about doing this as cleanly as possible?

Thanks in advance!
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #1 on Wed 15 Apr 2009 04:30 PM (UTC)
Message
Quote:
For instance, if I set my character as having brown hair, brown eyes, and scars criss-crossing my face, but I was wearing something on my head that has certain words in the description, like mask for instance, someone looking at me would just see something like "A mask covers their face." whereas not wearing something could show "He has brown hair, brown eyes and scars cover his face."

That sounds like asking for trouble IMO. I wouldn't get into the business of trying to figure out if the thing worn is a mask, closed-face helmet, etc. based on the words in the description. I would go for either:
(a) the simple case and say if anything is worn on the head, the head description is not seen; or
(b) the more complex case where equipment is flagged as hiding what it covers.
This way you could have open-face helmets and closed-face helmets; you could have armor decorations that don't hide the armor underneath; and so forth.

Quote:
Right this moment however the issue I'm having trouble with is, how to store the various choices a player might make using this system. Do I do something like, say, add a bunch of new members to the char_data, or pc_data, structure to hold the stuff in? An int? A float? A string? An array? If so, single or multidimensional?

The simplest thing to do I think is have a mapping from describable location to string description of that location. The mapping could be implemented as an array keyed by integral location constants. I'd put it into char_data, not pc_data, so that NPCs could also have dynamic descriptions.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

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

Posted by Cbond   USA  (19 posts)  [Biography] bio
Date Reply #2 on Wed 15 Apr 2009 06:38 PM (UTC)
Message
After reading your response I got to thinking. Maybe I'm overdoing this a little. I mean lets face facts. It's a mud where combat plays a, not insignificant, part and players are going to equip their characters with the best equipment they can get, so nobody is going to be running around naked. Plus we're also already having them choose hair and eye color and build during character creation. I think what I'll do is just add one or two more options to character creation, height and maybe skin tone, then basing the descriptions around those choices and worn equipment.

Now, as for the reason why I was thinking about searching the equipment name for certain keywords is because, it being an SWR, characters can get the makearmor skill which lets them create armor for various wear locations, the head being one of them. I was concerned that maybe someone would create something like a hat, something that generally speaking doesn't cover the entire face. I think I'll just do as you suggested in your (a) option, which is what I was going to do for everything else anyways.

Well, thank you for trying to help and sorry for wasting your time.
[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.


4,153 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]