Upgrades/Morphing already possible?

Upgrades/Morphing already possible?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Upgrades/Morphing already possible?

Post 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?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post 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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post 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
Post Reply

Return to “Game Development”