Page 1 of 1

Show commandqueue lines for custom commands

Posted: 20 Jul 2013, 16:46
by knorke
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:
Image
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)
I tried different commandIDs and
changing gadgetHandler:RegisterCMDID(gadget, CMD_PICKUPFEATURE)
to :arrow:
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)

Re: Show commandqueue lines for custom commands

Posted: 20 Jul 2013, 17:47
by FLOZi
Not sure if important but;

Code: Select all

	Spring.AssignMouseCursor("Clear Mines", "cursordemine", true, false)
	Spring.SetCustomCommandDrawData(CMD_CLEARMINES, "Clear Mines", {1,0.5,0,.8}, false)
Note Arg 1 for AMC = Arg 2 for SCCDD

Re: Show commandqueue lines for custom commands

Posted: 20 Jul 2013, 21:26
by knorke
http://pastebin.com/0xq4ryS6

1) pickUpFeatureCMD is type = CMDTYPE.ICON_UNIT_FEATURE_OR_AREA ,
2) putDownFeatureCMD is type = CMDTYPE.ICON_MAP,

1) draws, 2) does not draw
Is it possible not all command types worth with SetCustomCommandDrawData?