Loading...
  OR  Zero-K Name:    Password:   

Post edit history

Need some LUA Widget scripting help

To display differences between versions, select one or more edits in the list using checkboxes and click "diff selected"
Post edit history
Date Editor Before After
1/22/2019 3:20:26 AMUSrankRandomX before revert after revert
1/22/2019 2:54:59 AMUSrankRandomX before revert after revert
Before After
1 Tried it out of curiosity. This is my first experience with Lua ( the makers specifically ask not to write "LUA", BTW!) . This doesn't answer the question, but maybe it will serve to help someone avoid my mistakes when someone who knows how to do this provides a solution. 1 Tried it out of curiosity. This is my first experience with Lua ( the makers specifically ask not to write "LUA", BTW!) . This post doesn't answer the question, but maybe it will serve to help someone avoid my mistakes when someone who knows how to do this provides a solution.
2 \n 2 \n
3 I managed to find CMD_PUSH_PULL in LuaRules/Configs/customcmds.h.lua, but it's not there in the working game. Using the integer directly doesn't seem to do anything, but the reason is probably that I can't figure out what to give as parameters (I wanted to make the turret switch to "Pull" the moment it was built). The command at the time I gave up on it looked like this: 3 I managed to find CMD_PUSH_PULL in LuaRules/Configs/customcmds.h.lua, but it's not there in the working game. Using the integer directly doesn't seem to do anything, but the reason is probably that I can't figure out what to give as parameters (I wanted to make the turret switch to "Pull" the moment it was built). The command at the time I gave up on it looked like this:
4 {{{Spring.GiveOrderToUnit(unitID, 35666, {3}, 0)}}} 4 {{{Spring.GiveOrderToUnit(unitID, 35666, {3}, 0)}}}
5 \n 5 \n
6 35666 is CMD_PUSH_PULL, 3 is just a guess: I thought that 1 is probably "default", 2 is "Push", 3 is "Pull". This is most likely nowhere close to what it really is though. I don't know where to look up the parameter(s) for this command, if the command is even at all exposed to widgets. 6 35666 is CMD_PUSH_PULL, 3 is just a guess: I thought that 1 is probably "default", 2 is "Push", 3 is "Pull". This is most likely nowhere close to what it really is though. I don't know where to look up the parameter(s) for this command, if the command is even at all exposed to widgets.