Difference between revisions of "Entity Functions"
From theFarWilds
| Line 6: | Line 6: | ||
List of functions: | List of functions: | ||
| − | bool isValid(); | + | bool '''isValid'''(); |
| − | string getName(); | + | bool '''doesExist'''(); |
| + | // isValid will tell you if the Entity returned by some other function is valid | ||
| + | // doesExist can be used where you are holding on to an Entity for awhile | ||
| + | // it checks to see if it has been removed from the game | ||
| + | // getName() and other functions will work on an Entity that is valid but doesn't exist | ||
| + | |||
| + | string '''getName'''(); | ||
| − | Player getController(); | + | Player '''getController'''(); |
| − | void setController(Player); | + | void '''setController'''(Player); |
| − | bool isType(int type); | + | bool '''isType'''(int type); |
// Types: Creature=1, Building=2,Enchantment=3,Item=4,(Corpse,Flux Well,Ruin)=5,World Enchantment=6 | // Types: Creature=1, Building=2,Enchantment=3,Item=4,(Corpse,Flux Well,Ruin)=5,World Enchantment=6 | ||
| − | Location getLoc(); | + | Location '''getLoc'''(); |
| − | bool moveEntity(Location); | + | bool '''moveEntity'''(Location); |
// returns false if it can't move there | // returns false if it can't move there | ||
| − | void remove(); | + | void '''remove'''(); |
| − | void destroy(); | + | void '''destroy'''(); |
| − | void sacrifice(); | + | void '''sacrifice'''(); |
| + | |||
| + | void '''setDim'''(bool dimOrNot); | ||
| + | bool '''isDim'''(); | ||
Revision as of 20:50, 23 March 2010
Scripting Entity Functions are called on the Entity object. For example
Entity ent=getFigure(createLocation(3,3)); ent.remove();
List of functions:
bool isValid(); bool doesExist(); // isValid will tell you if the Entity returned by some other function is valid // doesExist can be used where you are holding on to an Entity for awhile // it checks to see if it has been removed from the game // getName() and other functions will work on an Entity that is valid but doesn't exist
string getName(); Player getController(); void setController(Player); bool isType(int type); // Types: Creature=1, Building=2,Enchantment=3,Item=4,(Corpse,Flux Well,Ruin)=5,World Enchantment=6 Location getLoc(); bool moveEntity(Location); // returns false if it can't move there void remove(); void destroy(); void sacrifice(); void setDim(bool dimOrNot); bool isDim();