Difference between revisions of "Hook Functions"

From theFarWilds
Jump to: navigation, search
Line 2: Line 2:
 
These are functions you can implement in your scripts. They are call at the appropriate times by the game.
 
These are functions you can implement in your scripts. They are call at the appropriate times by the game.
  
  void configGame();  
+
  void '''configGame'''();  
 
  // Sets up the game state such as # of players, Map Size, if they need to set a deck or not, etc
 
  // Sets up the game state such as # of players, Map Size, if they need to set a deck or not, etc
 
  [[Config Functions]]
 
  [[Config Functions]]
 
   
 
   
  void beforeStart();  
+
  void '''beforeStart'''();  
 
  // Do things here before any action. Place creatures and buildings, change their decks etc.
 
  // Do things here before any action. Place creatures and buildings, change their decks etc.
 
   
 
   
  void onNewRound();
+
  void '''onNewRound'''();
 
  // called after all the new round events
 
  // called after all the new round events
 +
 +
bool '''entityCallback'''(Entity entity)
 +
// called for each entity in the game if you call forEachEntity();
 +
 +
void '''onDialogResponse'''(Player player,int resp);
  
  void afterAction(); // not yet
+
  void '''afterAction'''(); // not yet
 
   
 
   
  void playersTurn(Player player);  // not yet
+
  void '''onPlayersTurn'''(Player player);  // not yet
 
   
 
   
  bool canPass(Player player); // not yet
+
  bool '''canPass'''(Player player); // not yet
 
  // called when the real players try to pass.  
 
  // called when the real players try to pass.  
 
  // This is so you can ensure they do a particular action before passing.
 
  // This is so you can ensure they do a particular action before passing.

Revision as of 13:15, 25 March 2010

Scripting These are functions you can implement in your scripts. They are call at the appropriate times by the game.

void configGame(); 
// Sets up the game state such as # of players, Map Size, if they need to set a deck or not, etc
Config Functions

void beforeStart(); 
// Do things here before any action. Place creatures and buildings, change their decks etc.

void onNewRound();
// called after all the new round events

bool entityCallback(Entity entity)
// called for each entity in the game if you call forEachEntity();

void onDialogResponse(Player player,int resp);
void afterAction(); // not yet

void onPlayersTurn(Player player);  // not yet

bool canPass(Player player); // not yet
// called when the real players try to pass. 
// This is so you can ensure they do a particular action before passing.