Getting default fire & move state

Getting default fire & move state

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

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Getting default fire & move state

Post by zwzsg »

I would like, in Lua, and in few lines, to get the default value of standingfireorder and standingmoveorder of a unitDefID.

I thought about using UnitDefs[unitDefID].moveState and UnitDefs[unitDefID].fireState however, they are both always -1 (save for buildings where moveState is 1).
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Getting default fire & move state

Post by jK »

-1 := copy state from builder/parent
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Getting default fire & move state

Post by zwzsg »

And what happens when it has no parent?

I would have assumed it would then follow the FBI, but my tests seem to indicate that instead it default to Fire At Will and Maneuver.
Post Reply

Return to “Lua Scripts”