Making labs morph

Making labs morph

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
DZHIBRISH
Posts: 357
Joined: 16 Mar 2007, 22:28

Making labs morph

Post by DZHIBRISH »

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?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

sorry that I didn't trust you :oops:

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 :wink:
DZHIBRISH
Posts: 357
Joined: 16 Mar 2007, 22:28

Post by DZHIBRISH »

You didnt trust me?
So you thought i was making stuff up?
Me not undertand logic...

About your explanation..:
what??
DZHIBRISH
Posts: 357
Joined: 16 Mar 2007, 22:28

Post by DZHIBRISH »

please can somebody fix this.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Post by jK »

i will try to fix/patch it soon

but this can take 1-3 days (very busy atm)
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

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
Post it on the bug tracker.
Post Reply

Return to “Lua Scripts”