i want to be able to morph labs.to morph_defs.lua i'v added the following:
-- Labs
armlab = {
into = 'armalab'
},
I get a morph button on my lab but the lab won't morph.Not getting any errors in infolog.
What else do i need to edit?
Making labs morph
Moderator: Moderators
sorry that I didn't trust you
But I found the problem/bug.
It is that the lua CommandFallback() is only called in CommandAI.cpp, and iirc factories don't use it. So the CMD_MORPH is erased before the morph gadget could handle it.
But you could directly handle the CMD_MORPH in AllowCommand(), so the command can't queued up anymore (why should it?).
PS @somebody who can write clean c-code: that factories can't receive the CommandFallback() is a bug and can be really annoying if you want to program mobile factories for example, so it should be fixed

But I found the problem/bug.
It is that the lua CommandFallback() is only called in CommandAI.cpp, and iirc factories don't use it. So the CMD_MORPH is erased before the morph gadget could handle it.
But you could directly handle the CMD_MORPH in AllowCommand(), so the command can't queued up anymore (why should it?).
PS @somebody who can write clean c-code: that factories can't receive the CommandFallback() is a bug and can be really annoying if you want to program mobile factories for example, so it should be fixed
