I'm getting a lua casting error on an add_sensor parameter? I'm sure I'm not doing this add right, but here is my code:
Code: Select all
local u = ScenEdit_GetUnit({ side = 'RAF' , name = 'Rainbow #1' })
print(u)
local a = ScenEdit_GetLoadout({ side = 'RAF' , name = 'Rainbow #1' })
ScenEdit_UpdateUnit({guid=u.guid,mode='add_sensor',dbid=1815, arc_detect=360})
ScenEdit_SetEMCON("unit", "Rainbow #1",'Radar=Passive;OECM=Active')I'm getting the following back:
Code: Select all
guid = 'BLESCZ-0HM0NI69IEBQJ',
class = 'Valiant B.(ECM).1',
proficiency = 'Ace',
latitude = '-17.923802463545',
longitude = '31.0944265038748',
altitude = '1873.731',
heading = '21.29999',
speed = '251.3471',
throttle = 'Full',
autodetectable = 'False',
base = 'Salisbury Air Force Base (RAF)',
mission = 'RAF Nairobi Strike Ammo Pads',
mounts = '2',
magazines = '2',
unitstate = 'RTB_MissionOver',
fuelstate = 'None',
weaponstate = 'None',
}
ERROR: Unable to cast object of type 'System.Int64' to type 'NLua.LuaTable'.Ultimately, what I'm trying to do is add another OECM Advanced to the available sensors on the Valiant ECM variant. Now, this might not be possible and allowed, but it's what I was trying to do. I also tried adding it as a weapon mount, and I couldn't get that to work either..
Any help here would be appreciated.
