Entity Functions

From theFarWilds
Revision as of 20:50, 23 March 2010 by Jed (Talk | contribs)

Jump to: navigation, search

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();