trepan wrote:SinbadEV:
Yup, you are right. LuaUI, LuaCob, LuaGaia, and LuaRules are all run
n different LUA environments (the latter three having both synced and
unsynced sub-environments. They all share some base libraries, but they
can interact directly.
From LuaSyncedCtrl.h:And LuaSyncedRead.h:Code: Select all
// LuaCob and LuaRules (fullCtrl) static int EditUnitCmdDesc(lua_State* L); static int InsertUnitCmdDesc(lua_State* L); static int RemoveUnitCmdDesc(lua_State* L);
Those functions allow you to query, add, and modify buttons.Code: Select all
static int GetUnitCmdDescs(lua_State* L);
I don't want to have to ask too many questions because it's curiosity for me here... is this documented somewhere that I could look over?\
First, can you replace a Cob with a lua script yet?
Second how does the script know when a specific button is pressed? just checking the value of GetUnitCmdDescs(lua_State* L) and then we get funky...
could you make a starcraft-esque siege tank with this, aka, script adds a "siege mode" button when the tank is completed, pressing this button would set a variable in the script so that all the animations/movement/aiming is as a turret and put a "normal mode" button on it... which would take it back?