CommandFallback & factories
Moderator: Moderators
CommandFallback & factories
Is it just me, or is CommandFallback never reached for custom orders given to factories?
Re: CommandFallback & factories
It's not just you. I documented that in P.U.R.E.'s source, but it's in a section dealing with the Advance Base, so it's probably obscure.
An example of a custom Command for a Factory:
An example of a custom Command for a Factory:
Code: Select all
function gadget:AllowCommand(u, ud, team, cmd, param, opts)
if (cmd ~= CMD_TRANSFORM_ADVANCEBASE) then
return true -- command was not used
else
if CanTransformIntoBase[ud] then
--Spring.RemoveUnitCmdDesc(u, TransformAdvanceBase)
local cmdID = Spring.FindUnitCmdDesc(u, CMD_TRANSFORM_ADVANCEBASE)
Spring.EditUnitCmdDesc(u,cmdID,{disabled = true, tooltip = "Transformation started.",})
Spring.CallCOBScript(u, "TransformAdvanceBase", 0)
return false
end
end
return true -- if all else fails
end
Re: CommandFallback & factories
Ok, thanks.
Indeed I noticed AllowCommand is still called, but executing the order as soon as it's queued seemed a dirty workaround for me.
Is it a bug, or is there some logical explanation why factories can't have CommandFallback?
And if a bug, is it going to be fixed?
I mean, I can understand factories work a bit differently, with move & fight orders that don't make them move but remain in queue and are passed to child, and aren't lost when build orders are given, etc...
Indeed I noticed AllowCommand is still called, but executing the order as soon as it's queued seemed a dirty workaround for me.
Is it a bug, or is there some logical explanation why factories can't have CommandFallback?
And if a bug, is it going to be fixed?

I mean, I can understand factories work a bit differently, with move & fight orders that don't make them move but remain in queue and are passed to child, and aren't lost when build orders are given, etc...
Re: CommandFallback & factories
You can get around the timing via various means. I used a COB script, since what I wanted to happen when users hit that command was fairly complex- weapons shut down, things move, etc. and I wanted the operation to take a precise amount of time.
Not saying that's perfect, mind you, just that I really didn't find it hard to build a workaround, once I knew what the problem was.
Not saying that's perfect, mind you, just that I really didn't find it hard to build a workaround, once I knew what the problem was.
Re: CommandFallback & factories
Doesn't a custom order to a factory get added to the waypoint queue instead of the build queue?