Page 1 of 1

LuA scripting question regarding fuel state

Posted: Wed Jan 10, 2018 3:45 pm
by TheOttoman
I'm working on a scenario that has a cyber warfare event that needs to outright cripple an air platform whether or not it is ready, in flight, or in reserve. The best way I think that I can simulate it specifically for platform in flight is to drain all of the fuel to zero, and then change all of the non flying platforms to a Maintenance status with a ready time that extends out past the scenario (or until I decide the hack is over).

My question is, does anyone have a LuA script that can adjust fuel level to zero?

RE: LuA scripting question regarding fuel state

Posted: Wed Jan 10, 2018 6:42 pm
by TheOttoman
HA! I figured it out:

This is specifically for aircraft fuel (fuel type: 2001)
u = ScenEdit_GetUnit({side='sidename',name='unitname' })
local newfuel = u.fuel
newfuel[2001].current = 0
u.fuel = newfuel