Force Landing for lus or gadget - Page 2

Force Landing for lus or gadget

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

Moderator: Moderators

User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Force Landing for lus or gadget

Post by SpliFF »

Perhaps the solutions are more complicated than required. Can't you just intercept the move/load orders for a "downed" plane?

Code: Select all

-- put landed units in this table
local LandedUnits = {}

function gadget:AllowCommand(unitID, ...) do
   if LandedUnits[unitID] then
      return false -- ignore the command
   else
      return true -- do the command
   end
end
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Force Landing for lus or gadget

Post by bobthedinosaur »

1) how do you propose to get landed units?

2) what are you going to do with the order intercepting to make this work more effectively?
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Force Landing for lus or gadget

Post by SirMaverick »

bobthedinosaur wrote:1) how do you propose to get landed units?
GetUnitMoveTypeData returns a table. One entry is "aircraftState" with values like e.g. "landed", "flying".

https://github.com/spring/spring/blob/H ... edRead.cpp line 3310+
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Force Landing for lus or gadget

Post by bobthedinosaur »

the point of forcing it to land is that even if you intercept move orders it wont go down to pick it up, it will hover over the top. if it has to move to pick up a unit and you are refusing it to it just going to sit there.

maybe i am missing the point in intercepting airstates of transports?
Post Reply

Return to “Lua Scripts”