%object%.HeldByWho function

From ADRIFT 5 Manual Wiki
(Redirected from HeldByWho)
Jump to: navigation, search

If the selected dynamic object is currently being held by a character, this function will give the key of that character.


This function can only be used where the object is known to be held by a character, or by using the following restriction in a task or alternate description to ensure that it is.



The initial location of the object is set using two drop-down lists on the description page. The first list sets the "Location of the object" property, and setting this determines which property will be set by the second list. When the "Location of the object" property is set to "Held by Character", the "Held by Who?" property of the character becomes available. Setting "Held by Who?" determines which character will be returned by the HeldByWho function.


How to use

To print the name of the character holding this object, as shown in the "Held by character?" property, use the name function following this one. ie. "%object%.HeldByWho.Name"

This function returns a character key, so it can be followed by any character function.


  • %object%.HeldByWho.Name
If the referenced object is being held by a character, this gives the characters name.
  • Object7.HeldByWho.CharOnWho.Name
If Character7 is a gun being held by a man who is sitting on a horse, this will give the name of the horse.
  • %object%.HeldByWho.CharInsideWhat.Name
If the referenced object is being held by a character who is inside of an object, this gives the name of that object.

<<< InLocationObject FunctionsPart of who? >>>