add_sensor (Full Version)

All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion



Message


wqc12345 -> add_sensor (6/23/2020 5:01:48 PM)

Hi All,

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:

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:

 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.




KnightHawk75 -> RE: add_sensor (6/24/2020 3:13:22 AM)

It's possible and allowed.
local arcT={'PB1','PB2','SB1','SB2','SMF1','SMF2','SMA1','SMA2','SS1','SS2','PS1','PS2','PMA1','PMA2','PMF1','PMF2'};
local arcD={'PB1','PB2','SB1','SB2','SMF1','SMF2','SMA1','SMA2','SS1','SS2','PS1','PS2','PMA1','PMA2','PMF1','PMF2'};
local arc360 = {'360'}
ScenEdit_UpdateUnit({guid=u.guid, mode='add_sensor', dbid=2648, arc_detect=arcD, arc_track=arcT}) --specific entries
ScenEdit_UpdateUnit({guid=u.guid, mode='add_sensor', dbid=2648, arc_detect=arc360, arc_track=arc360}) --360 version


Though the {'360'} should work too, just submit it in table form. may want to include arc_track as well.
A mount is different and will require arc_mount= as well, though like you said it's not what you're trying to do.

Also sensor 1815 is not an OECM Advanced sensor, I think it's a sonar.
cwdb
----
2648 Generic OECM [Advanced] 1980s

db3k
----
1046 Generic OECM [Simple] 1970s, CW Jamming
1048 Generic OECM [Average] 1970s
1050 Generic OECM [Advanced] 1980s
5921 Generic OECM [Advanced] 1990s
5922 Generic OECM [Advanced] 2000s
5923 Generic OECM [Advanced] 2010s
5924 Generic OECM [Advanced] 2020s





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1