$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

src/stratagus/script.cpp File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <signal.h>
#include <ctype.h>
#include "stratagus.h"
#include "iocompat.h"
#include "unit.h"
#include "unittype.h"
#include "iolib.h"
#include "script.h"
#include "missile.h"
#include "depend.h"
#include "upgrade.h"
#include "construct.h"
#include "map.h"
#include "tileset.h"
#include "script_sound.h"
#include "ui.h"
#include "interface.h"
#include "font.h"
#include "pathfinder.h"
#include "ai.h"
#include "results.h"
#include "trigger.h"
#include "settings.h"
#include "editor.h"
#include "sound.h"
#include "sound_server.h"
#include "master.h"
#include "netconnect.h"
#include "network.h"
#include "spells.h"
#include "actions.h"
#include "replay.h"

Classes

struct  UStrInt

script.cpp - The configuration language.

enum  UStrIntType { USTRINT_STR, USTRINT_INT, USTRINT_STR, USTRINT_INT }
 Usefull for getComponent. More...
lua_State * Lua
std::string GameName
 Structure to work with lua files.
std::string FullGameName
 Name of the game.
int CclInConfigFile
bool SaveGameLoading
 True while config file parsing.
std::string CurrentLuaFile
 If a Saved Game is Loading.
int NoRandomPlacementMultiplayer = 0
 Lua file currently being interpreted.
bool UseHPForXp = false
 Disable the random placement of players in muliplayer mode.
NumberDescDamage
 true if gain XP by dealing damage, false if by killing.
static int NumberCounter = 0
 Damage calculation for missile.
static int StringCounter = 0
 Counter for lua function.
bool CanAccessFile (const char *filename)
 Counter for lua function.
CUnitGetUnitUnderCursor ()
UStrInt GetComponent (const CUnit &unit, int index, EnumVariable e, int t)
 Get component for unit variable.
static void lstop (lua_State *l, lua_Debug *ar)
static void laction (int i)
static void l_message (const char *pname, const char *msg, bool exit)
static int report (int status, bool exitOnError)
static int luatraceback (lua_State *L)
int LuaCall (int narg, int clear, bool exitOnError)
static void LuaLoadBuffer (const std::string &file, std::string &buffer)
int LuaLoadFile (const std::string &file)
static int CclGetStratagusVersion (lua_State *l)
static int CclGetStratagusHomepage (lua_State *l)
static int CclSetMenuRace (lua_State *l)
static int CclGetCurrentLuaPath (lua_State *l)
static int CclSavePreferences (lua_State *l)
static int CclLoad (lua_State *l)
static int CclLoadBuffer (lua_State *l)
static int CclSavedGameInfo (lua_State *l)
const char * LuaToString (lua_State *l, int narg)
 True while config file parsing.
int LuaToNumber (lua_State *l, int narg)
bool LuaToBoolean (lua_State *l, int narg)
void CclGarbageCollect (int)
static void ParseBinOp (lua_State *l, BinOp *binop)
static CUnit ** Str2UnitRef (lua_State *l, const char *s)
UnitDescCclParseUnitDesc (lua_State *l)
 Parse a number description.
static int ParseLuaFunction (lua_State *l, const char *tablename, int *counter)
static int CallLuaNumberFunction (unsigned int handler)
static char * CallLuaStringFunction (unsigned int handler)
NumberDescCclParseNumberDesc (lua_State *l)
StringDescNewStringDesc (const char *s)
 Parse a string description.
StringDescCclParseStringDesc (lua_State *l)
 Parse a unit description.
CUnitEvalUnit (const UnitDesc *unitdesc)
 Evaluate the number.
int EvalNumber (const NumberDesc *number)
 Create a StringDesc with const string.
std::string EvalString (const StringDesc *s)
 Evaluate the unit.
void FreeUnitDesc (UnitDesc *)
 Free number description content. (no pointer itself).
void FreeNumberDesc (NumberDesc *number)
 Evaluate the string.
void FreeStringDesc (StringDesc *s)
 Free unit description content. (no pointer itself).
static int AliasUnitVar (lua_State *l, const char *s)
static int CclUnitAttackerVar (lua_State *l)
static int CclUnitDefenderVar (lua_State *l)
static int CclActiveUnitVar (lua_State *l)
static int Alias (lua_State *l, const char *s)
static int CclAdd (lua_State *l)
static int CclSub (lua_State *l)
static int CclMul (lua_State *l)
static int CclDiv (lua_State *l)
static int CclMin (lua_State *l)
static int CclMax (lua_State *l)
static int CclRand (lua_State *l)
static int CclGreaterThan (lua_State *l)
static int CclGreaterThanOrEq (lua_State *l)
static int CclLessThan (lua_State *l)
static int CclLessThanOrEq (lua_State *l)
static int CclEqual (lua_State *l)
static int CclNotEqual (lua_State *l)
static int CclConcat (lua_State *l)
static int CclString (lua_State *l)
static int CclInverseVideo (lua_State *l)
static int CclUnitName (lua_State *l)
static int CclIf (lua_State *l)
static int CclSubString (lua_State *l)
static int CclLine (lua_State *l)
static int CclGameInfo (lua_State *l)
static int CclVideoTextLength (lua_State *l)
static int CclStringFind (lua_State *l)
static void AliasRegister ()
static int CclStratagusLibraryPath (lua_State *l)
static int CclFilteredListDirectory (lua_State *l, int type, int mask)
static int CclListDirectory (lua_State *l)
static int CclListFilesInDirectory (lua_State *l)
static int CclListDirsInDirectory (lua_State *l)
static int CclSetGameName (lua_State *l)
static int CclSetFullGameName (lua_State *l)
static int CclSetVideoSyncSpeed (lua_State *l)
static int CclSetLocalPlayerName (lua_State *l)
static int CclGetLocalPlayerName (lua_State *l)
static int ScriptSetUseHPForXp (lua_State *l)
static int CclNoRandomPlacementMultiplayer (lua_State *l)
static int CclSetDamageFormula (lua_State *l)
static int CclSetGodMode (lua_State *l)
static int CclGetGodMode (lua_State *l)
static int CclSetSpeedResourcesHarvest (lua_State *l)
static int CclSetSpeedResourcesReturn (lua_State *l)
static int CclSetSpeedBuild (lua_State *l)
static int CclGetSpeedBuild (lua_State *l)
static int CclSetSpeedTrain (lua_State *l)
static int CclGetSpeedTrain (lua_State *l)
static int CclSetSpeedUpgrade (lua_State *l)
static int CclSetSpeedResearch (lua_State *l)
static int CclSetSpeeds (lua_State *l)
static int CclDefineDefaultIncomes (lua_State *l)
static int CclDefineDefaultActions (lua_State *l)
static int CclDefineDefaultResourceNames (lua_State *l)
static int CclDefineDefaultResourceAmounts (lua_State *l)
static int CclDefineExtraDeathTypes (lua_State *l)
static int CclDebugPrint (lua_State *l)
static int CclLoadMap (lua_State *l)
int CclCommand (const std::string &command, bool exitOnError)
 Save user preferences.
int tolua_stratagus_open (lua_State *tolua_S)
static void InitLua ()
void InitCcl ()
 Perform garbage collection.
std::string SaveGlobal (lua_State *l, bool is_root)
void SavePreferences ()
 Save CCL module.
void LoadCcl (const std::string &filename)
 Initialise ccl.
void SaveCcl (CFile *file)
 Load ccl config file.

Enumeration Type Documentation

Usefull for getComponent.

Enumerator:
USTRINT_STR 
USTRINT_INT 
USTRINT_STR 
USTRINT_INT 


Function Documentation

static int Alias ( lua_State *  l,
const char *  s 
) [static]

Make alias for some function.

Parameters:
l lua State.
s FIXME: docu
Returns:
the lua table {s, {arg1, arg2, ..., argn}} or {s, arg1}

static void AliasRegister (  )  [static]

static int AliasUnitVar ( lua_State *  l,
const char *  s 
) [static]

Make alias for some unit Variable function.

Parameters:
l lua State.
s FIXME: docu
Returns:
the lua table {"UnitVar", {Unit = s, Variable = arg1, Component = "Value" or arg2, Loc = [012]}

static int CallLuaNumberFunction ( unsigned int  handler  )  [static]

Call a Lua handler

Parameters:
handler handler of the lua function to call.
Returns:
lua function result.

static char* CallLuaStringFunction ( unsigned int  handler  )  [static]

Call a Lua handler

Parameters:
handler handler of the lua function to call.
Returns:
lua function result.

bool CanAccessFile ( const char *  filename  ) 

Counter for lua function.

static int CclActiveUnitVar ( lua_State *  l  )  [static]

Return equivalent lua table for . {"Unit", {Unit = "Active", Variable = arg1, Component = "Value" or arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclAdd ( lua_State *  l  )  [static]

Return equivalent lua table for add. {"Add", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

int CclCommand ( const std::string &  command,
bool  exitOnError 
)

Save user preferences.

Send command to ccl.

Parameters:
command Zero terminated command string.

static int CclConcat ( lua_State *  l  )  [static]

Return equivalent lua table for Concat. {"Concat", {arg1}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclDebugPrint ( lua_State *  l  )  [static]

Print debug message with info about current script name, line number and function.

See also:
DebugPrint
Parameters:
l Lua state.

static int CclDefineDefaultActions ( lua_State *  l  )  [static]

Define default action for the resources.

Parameters:
l Lua state.

static int CclDefineDefaultIncomes ( lua_State *  l  )  [static]

Define default incomes for a new player.

Parameters:
l Lua state.

static int CclDefineDefaultResourceAmounts ( lua_State *  l  )  [static]

Define default names for the resources.

Parameters:
l Lua state.

static int CclDefineDefaultResourceNames ( lua_State *  l  )  [static]

Define default names for the resources.

Parameters:
l Lua state.

static int CclDefineExtraDeathTypes ( lua_State *  l  )  [static]

Define default extra death types.

Parameters:
l Lua state.

static int CclDiv ( lua_State *  l  )  [static]

Return equivalent lua table for add. {"Div", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclEqual ( lua_State *  l  )  [static]

Return equivalent lua table for Equal. {"Equal", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclFilteredListDirectory ( lua_State *  l,
int  type,
int  mask 
) [static]

Return a table with the filtered items found in the subdirectory.

static int CclGameInfo ( lua_State *  l  )  [static]

Return equivalent lua table for Line. {"Line", "arg1"}

Parameters:
l Lua state.
Returns:
equivalent lua table.

void CclGarbageCollect ( int   ) 

Perform CCL garbage collection

Parameters:
fast set this flag to disable slow GC (during game)

static int CclGetCurrentLuaPath ( lua_State *  l  )  [static]

Get the directory of the current lua file

static int CclGetGodMode ( lua_State *  l  )  [static]

Get God mode.

Parameters:
l Lua state.
Returns:
God mode.

static int CclGetLocalPlayerName ( lua_State *  l  )  [static]

Get the local player name

Parameters:
l Lua state.

static int CclGetSpeedBuild ( lua_State *  l  )  [static]

Get building speed.

Parameters:
l Lua state.
Returns:
Building speed.

static int CclGetSpeedTrain ( lua_State *  l  )  [static]

Get training speed.

Parameters:
l Lua state.
Returns:
Training speed.

static int CclGetStratagusHomepage ( lua_State *  l  )  [static]

Get Stratagus Homepage

static int CclGetStratagusVersion ( lua_State *  l  )  [static]

Get Stratagus Version

static int CclGreaterThan ( lua_State *  l  )  [static]

Return equivalent lua table for GreaterThan. {"GreaterThan", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclGreaterThanOrEq ( lua_State *  l  )  [static]

Return equivalent lua table for GreaterThanOrEq. {"GreaterThanOrEq", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclIf ( lua_State *  l  )  [static]

Return equivalent lua table for If. {"If", {arg1}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclInverseVideo ( lua_State *  l  )  [static]

Return equivalent lua table for InverseVideo. {"InverseVideo", {arg1}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclLessThan ( lua_State *  l  )  [static]

Return equivalent lua table for LessThan. {"LessThan", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclLessThanOrEq ( lua_State *  l  )  [static]

Return equivalent lua table for LessThanOrEq. {"LessThanOrEq", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclLine ( lua_State *  l  )  [static]

Return equivalent lua table for Line. {"Line", {arg1, arg2[, arg3]}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclListDirectory ( lua_State *  l  )  [static]

Return a table with the files or directories found in the subdirectory.

static int CclListDirsInDirectory ( lua_State *  l  )  [static]

Return a table with the files found in the subdirectory.

static int CclListFilesInDirectory ( lua_State *  l  )  [static]

Return a table with the files found in the subdirectory.

static int CclLoad ( lua_State *  l  )  [static]

Load a file and execute it.

Parameters:
l Lua state.
Returns:
0 in success, else exit.

static int CclLoadBuffer ( lua_State *  l  )  [static]

Load a file into a buffer and return it.

Parameters:
l Lua state.
Returns:
buffer or nil on failure

static int CclLoadMap ( lua_State *  l  )  [static]

Load a map. (Try in library path first)

Parameters:
l Lua state.

static int CclMax ( lua_State *  l  )  [static]

Return equivalent lua table for add. {"Max", {arg1, arg2, argn}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclMin ( lua_State *  l  )  [static]

Return equivalent lua table for add. {"Min", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclMul ( lua_State *  l  )  [static]

Return equivalent lua table for add. {"Mul", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclNoRandomPlacementMultiplayer ( lua_State *  l  )  [static]

Removes Randomization of Player position in Multiplayer mode

Parameters:
l Lua state.

static int CclNotEqual ( lua_State *  l  )  [static]

Return equivalent lua table for NotEqual. {"NotEqual", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

NumberDesc* CclParseNumberDesc ( lua_State *  l  ) 

Return number.

Parameters:
l lua state.
Returns:
number.

StringDesc* CclParseStringDesc ( lua_State *  l  ) 

Parse a unit description.

Return String description.

Parameters:
l lua state.
Returns:
String description.

UnitDesc* CclParseUnitDesc ( lua_State *  l  ) 

Parse a number description.

Return unit referernce definition.

Parameters:
l lua state.
Returns:
unit referernce definition.

static int CclRand ( lua_State *  l  )  [static]

Return equivalent lua table for add. {"Rand", {arg1}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclSavedGameInfo ( lua_State *  l  )  [static]

Load the SavedGameInfo Header

Parameters:
l Lua state.

static int CclSavePreferences ( lua_State *  l  )  [static]

Save preferences

Parameters:
l Lua state.

static int CclSetDamageFormula ( lua_State *  l  )  [static]

Set damage computation method.

Parameters:
l Lua state.

static int CclSetFullGameName ( lua_State *  l  )  [static]

static int CclSetGameName ( lua_State *  l  )  [static]

Return of game name.

Parameters:
l Lua state.

static int CclSetGodMode ( lua_State *  l  )  [static]

Set God mode.

Parameters:
l Lua state.
Returns:
The old mode.

static int CclSetLocalPlayerName ( lua_State *  l  )  [static]

Set the local player name

Parameters:
l Lua state.

static int CclSetMenuRace ( lua_State *  l  )  [static]

static int CclSetSpeedBuild ( lua_State *  l  )  [static]

Set building speed.

Parameters:
l Lua state.

static int CclSetSpeedResearch ( lua_State *  l  )  [static]

For debug increase researching speed.

Parameters:
l Lua state.

static int CclSetSpeedResourcesHarvest ( lua_State *  l  )  [static]

Set resource harvesting speed.

Parameters:
l Lua state.

static int CclSetSpeedResourcesReturn ( lua_State *  l  )  [static]

Set resource returning speed.

Parameters:
l Lua state.

static int CclSetSpeeds ( lua_State *  l  )  [static]

For debug increase all speeds.

Parameters:
l Lua state.

static int CclSetSpeedTrain ( lua_State *  l  )  [static]

Set training speed.

Parameters:
l Lua state.

static int CclSetSpeedUpgrade ( lua_State *  l  )  [static]

For debug increase upgrading speed.

Parameters:
l Lua state.

static int CclSetVideoSyncSpeed ( lua_State *  l  )  [static]

Set the video sync speed

Parameters:
l Lua state.

static int CclStratagusLibraryPath ( lua_State *  l  )  [static]

Return the stratagus library path.

Parameters:
l Lua state.
Returns:
Current libray path.

static int CclString ( lua_State *  l  )  [static]

Return equivalent lua table for String. {"String", {arg1}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclStringFind ( lua_State *  l  )  [static]

Return equivalent lua table for StringFind. {"StringFind", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclSub ( lua_State *  l  )  [static]

Return equivalent lua table for add. {"Div", {arg1, arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclSubString ( lua_State *  l  )  [static]

Return equivalent lua table for SubString. {"SubString", {arg1, arg2, arg3}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclUnitAttackerVar ( lua_State *  l  )  [static]

Return equivalent lua table for . {"Unit", {Unit = "Attacker", Variable = arg1, Component = "Value" or arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclUnitDefenderVar ( lua_State *  l  )  [static]

Return equivalent lua table for . {"Unit", {Unit = "Defender", Variable = arg1, Component = "Value" or arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclUnitName ( lua_State *  l  )  [static]

Return equivalent lua table for UnitName. {"UnitName", {arg1}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

static int CclVideoTextLength ( lua_State *  l  )  [static]

Return equivalent lua table for VideoTextLength. {"VideoTextLength", {Text = arg1, Font = arg2}}

Parameters:
l Lua state.
Returns:
equivalent lua table.

int EvalNumber ( const NumberDesc number  ) 

Create a StringDesc with const string.

compute the number expression

Parameters:
number struct with definition of the calculation.
Returns:
the result number.
Todo:
Manage better the error (div/0, unit==NULL, ...).

std::string EvalString ( const StringDesc s  ) 

Evaluate the unit.

compute the string expression

Parameters:
s struct with definition of the calculation.
Returns:
the result string.
Todo:
Manage better the error.

CUnit* EvalUnit ( const UnitDesc unitdesc  ) 

Evaluate the number.

compute the Unit expression

Parameters:
unitdesc struct with definition of the calculation.
Returns:
the result unit.

void FreeNumberDesc ( NumberDesc number  ) 

Evaluate the string.

Free the number expression content. (not the pointer itself).

Parameters:
number struct to free

void FreeStringDesc ( StringDesc s  ) 

Free unit description content. (no pointer itself).

Free the String expression content. (not the pointer itself).

Parameters:
s struct to free

void FreeUnitDesc ( UnitDesc  ) 

Free number description content. (no pointer itself).

Free the unit expression content. (not the pointer itself).

Parameters:
unitdesc struct to free

UStrInt GetComponent ( const CUnit unit,
int  index,
EnumVariable  e,
int  t 
)

Get component for unit variable.

Return the value corresponding.

Parameters:
unit Unit.
index Index of the variable.
e Component of the variable.
t Which var use (0:unit, 1:Type, 2:Stats)
Returns:
Value corresponding

CUnit* GetUnitUnderCursor (  ) 

void InitCcl (  ) 

Perform garbage collection.

Register some lua function.

static void InitLua (  )  [static]

Initialize Lua

static void l_message ( const char *  pname,
const char *  msg,
bool  exit 
) [static]

Print error message and possibly exit.

Parameters:
pname Source of the error.
msg error message to print.
exit exit the program

static void laction ( int  i  )  [static]

FIXME: docu

void LoadCcl ( const std::string &  filename  ) 

Initialise ccl.

Load stratagus config file.

static void lstop ( lua_State *  l,
lua_Debug *  ar 
) [static]

FIXME: docu

int LuaCall ( int  narg,
int  clear,
bool  exitOnError 
)

Call a lua function

Parameters:
narg Number of arguments
clear Clear the return value(s)
exitOnError Exit the program when an error occurs
Returns:
0 in success, else exit.

static void LuaLoadBuffer ( const std::string &  file,
std::string &  buffer 
) [static]

Load a file into a buffer

int LuaLoadFile ( const std::string &  file  ) 

Load a file and execute it

Parameters:
file File to load and execute
Returns:
0 for success, else exit.

bool LuaToBoolean ( lua_State *  l,
int  narg 
)

Convert lua boolean to bool. It also checks type and exits in case of error.

Parameters:
l Lua state.
narg Argument number.
Returns:
1 for true, 0 for false from lua.

int LuaToNumber ( lua_State *  l,
int  narg 
)

Convert lua number in C number. It checks also type and exit in case of error.

Parameters:
l Lua state.
narg Argument number.
Returns:
C number from lua.

const char* LuaToString ( lua_State *  l,
int  narg 
)

True while config file parsing.

Convert lua string in char*. It checks also type and exit in case of error.

Note:
char* could be invalidated with lua garbage collector.
Parameters:
l Lua state.
narg Argument number.
Returns:
char* from lua.

static int luatraceback ( lua_State *  L  )  [static]

StringDesc* NewStringDesc ( const char *  s  ) 

Parse a string description.

Create a StringDesc with const string.

Parameters:
s direct value for the StringDesc
Returns:
the new StringDesc.

static void ParseBinOp ( lua_State *  l,
BinOp binop 
) [static]

Parse binary operation with number.

Parameters:
l lua state.
binop Where to stock info (must be malloced)

static int ParseLuaFunction ( lua_State *  l,
const char *  tablename,
int *  counter 
) [static]

Add a Lua handler

Parameters:
l lua state.
tablename name of the lua table.
counter Counter for the handler
Returns:
handle of the function.

static int report ( int  status,
bool  exitOnError 
) [static]

Check error status, and print error message and exit if status is different of 0.

Parameters:
status status of the last lua call. (0: success)
exitOnError exit the program on error
Returns:
0 in success, else exit.

void SaveCcl ( CFile file  ) 

Load ccl config file.

Save CCL Module.

Parameters:
file Save file.

std::string SaveGlobal ( lua_State *  l,
bool  is_root 
)

For saving lua state (table, number, string, bool, not function).

Parameters:
l lua_State to save.
is_root true for the main call, 0 for recursif call.
Returns:
"" if nothing could be saved. else a string that could be executed in lua to restore lua state
Todo:
do the output prettier (adjust indentation, newline)

void SavePreferences (  ) 

Save CCL module.

Save user preferences

static int ScriptSetUseHPForXp ( lua_State *  l  )  [static]

Affect UseHPForXp.

Parameters:
l Lua state.
Returns:
0.

static CUnit** Str2UnitRef ( lua_State *  l,
const char *  s 
) [static]

Convert the string to the corresponding data (which is a unit).

Parameters:
l lua state.
s Ident.
Returns:
The reference of the unit.
Todo:
better check for error (restrict param).

TOLUA_API int tolua_stratagus_open ( lua_State *  tolua_S  ) 


Variable Documentation

std::string CurrentLuaFile

If a Saved Game is Loading.

true if gain XP by dealing damage, false if by killing.

Burning building frames.

std::string FullGameName

Name of the game.

std::string GameName

Structure to work with lua files.

Location of stratagus data.

lua_State* Lua

Lua file currently being interpreted.

Network status.

int NumberCounter = 0 [static]

Damage calculation for missile.

True while config file parsing.

Delete save game.

int StringCounter = 0 [static]

Counter for lua function.

bool UseHPForXp = false

Disable the random placement of players in muliplayer mode.

Speed factor for researching.

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.