%object%.WornByWho function
If the selected dynamic object is being worn by a character, this function will give the key of that character.
Contents
Requirements
This function can only be used where the object is known to be being worn by a character, or by using the following restriction in a task or alternate description to ensure that it is.
- You don't need to check the "Object is wearable" property, as this only prevents the player from using the "wear %object%" command.
Properties
When the "Location of the object" property is set to "Worn by Character", the "Worn by who" property of the character becomes available. Setting "Worn by who" determines which character will be returned by the WornByWho function.
How to use
To print the name of the character that is currently wearing this object, as shown in the "Worn by who" property, use the name function following this one. ie. "%object%.WornByWho.Name"
This function returns a character key, so it can be followed by any character function.
Examples
- %object%.WornByWho.Name
- If the referenced object is being worn by a character, this gives the characters name.
- Object7.WornByWho.CharOnWho.Name
- If Object7 is the shirt of a man who is sitting on a horse, this will give the name of the horse.
- %object%.WornByWho.CharInsideWhat.Name
- If the referenced object is being worn by a character who is inside of an object, this gives the name of that object.
<<< PartOfWho | Object Functions | ReadText >>> |