REVENGE wrote:Ok, another question:
Can I use lua to get the current value of a variable or constant from a cob script? If so, how would I go about monitoring said value for change?
If you want to share a variable between Lua and COB, you will need to use the following COB SET/GETs:
1024-2047 for unit variables
2048-3071 for team variables
3072-4095 for ally variables
4096-5119 for global variables
To get at these from the Lua side use Spring.GetUnitCOBValue and Spring.SetUnitCOBValue. To get notified of a change, you'll need to poll the variable (check it at regular intervals). Alternately, you can pass the data directly using Spring.CallCOBScript or Spring.CallCOBScriptCB going Lua->COB, or call-script lua_FunctionName going COB->Lua. Note that the latter is pretty expensive, so polling may not be as bad as it might seem.
See the wiki for details. Also,
Example of (primarily) first method
Example of second method