Full Version : How Do I - Use the GET series of keywords
xmlspawner >>XMLSpawner - How do I? >>How Do I - Use the GET series of keywords
<< Prev | Next >>
ArteGordon- 12-27-2005
The GET series of keywords allows you to 'get' property values off of objects by looking them up by name, type, or how they were spawned. This series of keywords include
GET, GETONTHIS, GETONPARENT, GETFROMFILE, GETONSPAWN, GETONCARRIED, GETONMOB, GETONTRIGMOB
Typically you would use this when you wanted to check the value of some property on a specific object, or use that value when assigning another property.
For example, suppose you wanted to spawn a simplelever object (available in the support package) and assign its target at spawn time.
The Target0Item property on the simplelever object takes an object reference as a value. This is normally assigned either by using [props and targeting an object, or by giving it the Serial number of the item or mob.
To assign this at spawn time you would use the GET keyword to find the target object you were interested in and then get the Serial property from it.
The general syntax for the GET keyword is
GET,objectname[,objecttype],propertyname
So the spawn entry to do this would look like
simplelever/target0item/GET,spawnername,xmlspawner,Serial
this would lookup the Serial property (which is available on all items and mobs) from the xmlspawner named 'spawnername', and assign it to the target0item property of the simplelever.
You could have left out the xmlspawner argument to the GET keyword, but the initial search is a little more efficient if you leave it in.
Note, that the first time you lookup the target object using any of the GET keywords it will do a full search through all items/mobs, but after that all such references are added to a hash table and so there is basically no searching load after that first time.
/------------------------------------------------------------\
Edit by: GodFood - Attached a demo .xml file
\------------------------------------------------------------/