iborg -> RE: FualState in Lua : how do you use it ? (3/23/2016 8:41:50 PM)
|
quote:
ORIGINAL: tjhkkr Do when you do this, the local variable u has all the parameters of that unit, and that unit's parameters/properties could then be modified? Do I understand this accurately? quote:
local u = ScenEdit_AddUnit(...) local fuel = u.fuel fuel[3001].current = 400 u.fuel = fuel I just tried it in the Lua console, using it like this : local u = ScenEdit_SetUnit({side="India", guid="0747cd9c-eca2-4a65-b04e-c0d226b0a91d"})
local fuel = u.fuel
fuel[2001].current = 1500
u.fuel = fuel Of course, you have to change side and guid accordingly, but in this example I changed the fuel state of an airborne plane (therefore the 2001 code for avgas). [:)]
|
|
|
|