Difference between revisions of "Global Functions"
From theFarWilds
Line 3: | Line 3: | ||
Entity '''createEntity'''(string CardName, int x_coord , int y_coord,Player controller ); | Entity '''createEntity'''(string CardName, int x_coord , int y_coord,Player controller ); | ||
− | Entity createEntity(string CardName ,Location loc,Player controller); | + | Entity '''createEntity'''(string CardName ,Location loc,Player controller); |
− | Entity createEntity(string CardName ,Location loc); | + | Entity '''createEntity'''(string CardName ,Location loc); |
− | Location createLocation(int x,int y); | + | |
− | Player getAIPlayer(int index) | + | Location '''createLocation'''(int x,int y); |
− | Player getHumanPlayer(int index) | + | |
− | void setTerrain(Location loc,int topo,int veg) | + | Player '''getAIPlayer'''(int index) |
− | int getTopo(Location loc); | + | Player '''getHumanPlayer'''(int index) |
− | int getVeg(Location loc); | + | |
+ | void '''setTerrain'''(Location loc,int topo,int veg) | ||
+ | int '''getTopo'''(Location loc); | ||
+ | int '''getVeg'''(Location loc); | ||
// topo: ocean=1, soggy=2, flat=3, hills=4, mountain=5 | // topo: ocean=1, soggy=2, flat=3, hills=4, mountain=5 | ||
// veg: desert=1 ,grass=2 ,forest=3 | // veg: desert=1 ,grass=2 ,forest=3 | ||
− | Entity getFigure(Location where); | + | Entity '''getFigure'''(Location where); |
− | void forEachEntity(); | + | void '''forEachEntity'''(); |
// this will cause the game to call the entityCallback() function you write once for each Entity in the game. | // this will cause the game to call the entityCallback() function you write once for each Entity in the game. | ||
− | void enchantEntity(Entity toEnchant,string enchantName,Player enchantController); // not yet | + | void '''enchantEntity'''(Entity toEnchant,string enchantName,Player enchantController); // not yet |
− | void infoBox(string title,string text); | + | void '''infoBox'''(string title,string text); |
// displays text in a pop up box to all the players | // displays text in a pop up box to all the players | ||
− | void endGame(Player winner); | + | void '''endGame'''(Player winner); |
+ | void '''flipTheScript'''(int scriptID,false); | ||
+ | // changes what script is being used for the game | ||
+ | // doesn't preserve global variables yet |
Revision as of 12:38, 23 March 2010
Scripting Global Functions that you can call from your scripts:
Entity createEntity(string CardName, int x_coord , int y_coord,Player controller ); Entity createEntity(string CardName ,Location loc,Player controller); Entity createEntity(string CardName ,Location loc); Location createLocation(int x,int y); Player getAIPlayer(int index) Player getHumanPlayer(int index) void setTerrain(Location loc,int topo,int veg) int getTopo(Location loc); int getVeg(Location loc); // topo: ocean=1, soggy=2, flat=3, hills=4, mountain=5 // veg: desert=1 ,grass=2 ,forest=3 Entity getFigure(Location where); void forEachEntity(); // this will cause the game to call the entityCallback() function you write once for each Entity in the game. void enchantEntity(Entity toEnchant,string enchantName,Player enchantController); // not yet void infoBox(string title,string text); // displays text in a pop up box to all the players void endGame(Player winner); void flipTheScript(int scriptID,false); // changes what script is being used for the game // doesn't preserve global variables yet