multiple look descriptions
Tomsa
07 May 2009, 10:20I want to change an NPC's look description depending on what he or she is currently wearing. The NPC has got a wardrobe with different clothes, each piece having its own value. How do I do this? With select case and if statements?
Overcat
09 May 2009, 18:48How do I do this? With select case and if statements?
Sure. Are you assigning these items to "slot" properties on the NPC? IE., a Clothing_Torso property could be set to some shirt item:
property <NPC; Clothing_Torso = White_Shirt>
If you do this then you don't need the unique values on each clothing item, I don't think. You could just test all the clothing properties of the NPC to determine if they are wearing anything. If the slot property equals some standard null value when it is not referencing a clothing item (such as NULL), or the NPC just doesn't have that property, then you know the NPC is not wearing anything in that slot.
It also depends on how descriptive you want to be.
[list]>look Joe
Joe is wearing a white shirt, a pair of jeans, and a set of black boots.[/list:u]
As opposed to...
[list]>look Joe
Joe is wearing a flowing white shirt, untucked over a pair of faded jeans. Polished black boots glisten in the sunlight.[/list:u]
The first one is easy to implement, the second a little harder.
Of course, if the clothing items are not referenced in slot properties (they just have a 'worn' property flag) then you'll have to implement the description in a slightly different way.
paul_one
10 May 2009, 14:35The second one isn't THAT hard to implement.
You have an action on the object which assigns the right property to the NPC.
... So, the NPC has a few properties:
hair_desc, face_desc, top_desc, bottoms_desc, feet_desc, acc_desc
When you apply a shirt (for example) it will assign "#NPC# is wearing the tight white shirt again showing off his abs!" to the variable (or a different description based on gender of the NPC).
You just need to set out a format of how it's printed and how it's stored..
You have an action on the object which assigns the right property to the NPC.
... So, the NPC has a few properties:
hair_desc, face_desc, top_desc, bottoms_desc, feet_desc, acc_desc
When you apply a shirt (for example) it will assign "#NPC# is wearing the tight white shirt again showing off his abs!" to the variable (or a different description based on gender of the NPC).
You just need to set out a format of how it's printed and how it's stored..
Overcat
10 May 2009, 14:56The second one isn't THAT hard to implement.
No, but there's a little more work - so it's a little harder.

Also, in this case I would like to be able to have sentences that ended in either commas or periods. Would then need to check for that, un-capitalize (or capitalize) some sentences, and add double spaces after periods (as opposed to single spaces after commas).