Difference between revisions of "%object%.WornByWho function"
(Created page with " <TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER><<< PartOfWho</TD><TD WIDTH="34%" ALIGN=CENTER>[[Object Functions]...") |
|||
Line 1: | Line 1: | ||
+ | If the selected dynamic object is being worn by a character, this function will give the key of that character. | ||
+ | == 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. | ||
+ | [[File:RestrictionObjectWornByCharacter.jpg]] | ||
+ | * 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. | ||
+ | [[File:PropertyWornByWho.jpg]] | ||
+ | == 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_Functions|character function]]. | ||
+ | == Examples == | ||
+ | *<span style="color:green">%object%</span>.WornByWho.Name | ||
+ | :If the referenced object is being worn by a character, this gives the characters name. | ||
+ | |||
+ | *<span style="color:red">Object7</span>.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. | ||
+ | |||
+ | *<span style="color:green">%object%</span>.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. | ||
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[%object%.PartOfWho function|<<< PartOfWho]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Object Functions]]</TD><TD ALIGN=CENTER>[[%object%.ReadText function|ReadText >>>]]</TD></TABLE> | <TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[%object%.PartOfWho function|<<< PartOfWho]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Object Functions]]</TD><TD ALIGN=CENTER>[[%object%.ReadText function|ReadText >>>]]</TD></TABLE> | ||
[[Category:Functions]] | [[Category:Functions]] |
Revision as of 07:33, 13 December 2012
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.
File:RestrictionObjectWornByCharacter.jpg
- 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 >>> |