Page 2 of 2

Re: Force Landing for lus or gadget

Posted: 07 Apr 2011, 07:01
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

Re: Force Landing for lus or gadget

Posted: 08 Apr 2011, 04:56
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?

Re: Force Landing for lus or gadget

Posted: 08 Apr 2011, 19:10
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+

Re: Force Landing for lus or gadget

Posted: 09 Apr 2011, 00:42
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?