Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

add_sensor

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> add_sensor Page: [1]
Login
Message << Older Topic   Newer Topic >>
add_sensor - 6/23/2020 5:01:48 PM   
wqc12345


Posts: 250
Joined: 12/7/2015
From: San Francisco, CA
Status: offline
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.
Post #: 1
RE: add_sensor - 6/24/2020 3:13:22 AM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
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



< Message edited by KnightHawk75 -- 6/24/2020 3:14:04 AM >

(in reply to wqc12345)
Post #: 2
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> add_sensor Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

1.766