Difference between revisions of "Scripting"

From theFarWilds
Jump to: navigation, search
Line 4: Line 4:
  
 
Functions you can implement: [[Script_Functions]]
 
Functions you can implement: [[Script_Functions]]
 
 
 
  
 
Functions you can call:
 
Functions you can call:
Entity createEntity(string CardName, int x_coord , int y_coord,Player controller );
+
[[Global Functions]]
Entity createEntity(string CardName ,Location loc,Player controller);
+
[[Config Functions]]
Entity createEntity(string CardName ,Location loc);
+
[[Player Functions]]
Location createLocation(int x,int y);
+
[[Entity Functions]]
Player getAIPlayer(int index)
+
[[Location Functions]]
Player getHumanPlayer(int index)
+
[[Card Functions]]
void setTerrain(Location loc,int topo,int veg)
+
[[Action Functions]]
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
+
 
+
Config Game Functions (you can only call these from inside configGame():
+
void addAIPlayer(string PlayerName,string Avatar,int teamID);
+
// all parameters are ignored for now
+
void setMapSize(int x,int y)
+
// 3 to 17
+
void setNumPlayers(int)
+
// from 1 to 4
+
void setGloryGoal(int)
+
void setMapSeed(int seed)
+
// you can set this if you always want the script to be on the same map
+
void setNumFluxWells(int)
+
 
+
 
+
Player Functions:
+
void addToHand(Player,string cardName)
+
void addToDeck(Player,string cardName,int index)
+
Card getDeckCard(Player,int index)
+
Card getHandCard(Player,int index)
+
void removeHandCard(Player,int index)
+
void removeDeckCard(Player,int index)
+
void drawCard(Player)
+
int deckSize(Player)
+
int handSize(Player)
+
void addFlux(Player,int delta)
+
void addGlory(Player,int delta)
+
int getFlux(Player)
+
int getGlory(Player)
+
 
+
 
+
Entity Functions:
+
  
 
----
 
----

Revision as of 18:28, 19 March 2010

This is the start of the scripting API. It will be expanded over time. If you want something ask for it in the forum. Create your scripts here: [1]. Scripts are written in AngelScript, it has syntax similar to C.


Functions you can implement: Script_Functions

Functions you can call: Global Functions Config Functions Player Functions Entity Functions Location Functions Card Functions Action Functions


Scripting Examples


Coordinate System : Coordinates in TFW are a bit weird. This page explains.