Difference between revisions of "Entity Functions"

From theFarWilds
Jump to: navigation, search
Line 8: Line 8:
 
  bool isValid();
 
  bool isValid();
 
  string getName();
 
  string getName();
 
+
 
  Player getController();
 
  Player getController();
 
  void setController(Player);
 
  void setController(Player);

Revision as of 18:41, 19 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();
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();