Page 1 of 1

Upgrades/Morphing already possible?

Posted: 22 Mar 2007, 18:16
by SinbadEV
See http://spring.clan-sy.com/phpbb/viewtopic.php?t=9477
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:

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);
And LuaSyncedRead.h:

Code: Select all

static int GetUnitCmdDescs(lua_State* L);
Those functions allow you to query, add, and modify buttons.

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?

Posted: 22 Mar 2007, 18:21
by KDR_11k
Technically you can already make a siegetank with the on/off button but I get what you mean. There's a way to make a script hook through LUA but I'm not sure how.

Posted: 22 Mar 2007, 21:43
by smoth
First, can you replace a Cob with a lua script yet?
No because it will be slower etc.

Luamod,gai,cob are not in this version. Luacob does not replace cob, it compliments it. It is used for other things, there is no replacement just enhancement.
could you make a starcraft-esque siege tank
You already can
OFF
weapon 2
script tells the unit no move
the unit does a deployment anim


on
weapon 1
script tells the unit move when it is undeployed
the unit does a un-deployment anim