Show commandqueue lines for custom commands
Posted: 20 Jul 2013, 16:46
My custom command is queable with shift-key but there are no lines drawn for it. For example here the unit has some move commands qued and in middle of queue is my custom command:

The red line between most left waypoint and the wreck is what I want it to draw.
http://pastebin.com/bD1FGVeu
(change "panther" to some mobile unit of your mod. note it is in two places)
I tried different commandIDs and
changing gadgetHandler:RegisterCMDID(gadget, CMD_PICKUPFEATURE)
to
gadgetHandler:RegisterCMDID(CMD_PICKUPFEATURE)
(like all other examples do) but that leads to Error: Lua LoadCode pcall error = 0, LuaRules/main.lua, error = 2, LuaRules/gadgets.lua, [string "LuaRules/gadgets.lua"]:901: attempt to compare nil with number
Tried in XTA and zeroK, no difference.
To test spawn the defined unit, select "pickUp!" command and click on a feature. The unit should drive over to it and pick it up.
Now try shift-queing the command and notice how now command-line is drawn for it. (it works but is invisible)
video (1min) that shows the problem: http://www.youtube.com/watch?v=tOl4f0OkRhE
hope the lines are visible enough even with video compression..
(dont mind the panther driving silly circles and almost getting stuck, it wasnt made for that unit)

The red line between most left waypoint and the wreck is what I want it to draw.
http://pastebin.com/bD1FGVeu
(change "panther" to some mobile unit of your mod. note it is in two places)
Code: Select all
function gadget:Initialize()
gadgetHandler:RegisterCMDID(gadget, CMD_PICKUPFEATURE)
Spring.AssignMouseCursor ("pickUp!", "cursorrepair")
Spring.SetCustomCommandDrawData(CMD_PICKUPFEATURE, "cursorrepair", {1,0.5,0,.8}, true)
changing gadgetHandler:RegisterCMDID(gadget, CMD_PICKUPFEATURE)
to

gadgetHandler:RegisterCMDID(CMD_PICKUPFEATURE)
(like all other examples do) but that leads to Error: Lua LoadCode pcall error = 0, LuaRules/main.lua, error = 2, LuaRules/gadgets.lua, [string "LuaRules/gadgets.lua"]:901: attempt to compare nil with number
Tried in XTA and zeroK, no difference.
To test spawn the defined unit, select "pickUp!" command and click on a feature. The unit should drive over to it and pick it up.
Now try shift-queing the command and notice how now command-line is drawn for it. (it works but is invisible)
video (1min) that shows the problem: http://www.youtube.com/watch?v=tOl4f0OkRhE
hope the lines are visible enough even with video compression..
(dont mind the panther driving silly circles and almost getting stuck, it wasnt made for that unit)