LuA scripting question regarding fuel state

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
TheOttoman
Posts: 139
Joined: Thu Dec 14, 2017 3:29 pm

LuA scripting question regarding fuel state

Post 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?
TheOttoman
Posts: 139
Joined: Thu Dec 14, 2017 3:29 pm

RE: LuA scripting question regarding fuel state

Post 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
Post Reply

Return to “Lua Legion”