Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Condition Radar(s) on/off

 
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 >> Condition Radar(s) on/off Page: [1]
Login
Message << Older Topic   Newer Topic >>
Condition Radar(s) on/off - 10/18/2021 9:32:05 AM   
Parel803

 

Posts: 517
Joined: 10/10/2019
From: Netherlands
Status: offline
Good morning,

I'm trying to give a message in an event when a radar is still strangled. Tried to have a condition if that message is to be send to the operator. Not getting it to work, stays at false.
The Event:NATO Message, EmconU/Radar cehck
The Condition:
local u = ScenEdit_GetUnit({name='F 827 Karel Doorman', guid='50PVO4-0HMC8KQOB26K8'})
if (u.sensor_dbid==2179 and u.sensor_isactive==true) then
print ('KH1007 is Shining')
return true
else
print ('KH1007 is Strangled')
return false
end

Hope someone can and will help me
regards GJ

Attachment (1)
Post #: 1
RE: Condition Radar(s) on/off - 10/18/2021 12:35:36 PM   
TitaniumTrout


Posts: 354
Joined: 10/20/2014
From: Michigan
Status: offline
You need to dig into the table of sensor data. As below you can print the contents of u.sensors which gives you a ton of data.

print(u.sensors)
{ [1] = { sensor_isactive = 'No', sensor_name = 'KH 1007 [Type 1007]', sensor_maxrange = 96, sensor_status = 'Operational', sensor_role = 2028, sensor_guid = 'T5Z37W-0HMCI67HH16DU', sensor_dbid = 2179, sensor_type = 2001 }, [2] = { sensor_isactive = 'No', sensor_name = 'LW.08', sensor_maxrange = 180, sensor_status = 'Operational', sensor_role = 2001, sensor_guid = 'T5Z37W-0HMCI67HH16DV', sensor_dbid = 1191, sensor_type = 2001 }, [3] = { sensor_isactive = 'No', sensor_name = 'SMART-S', sensor_maxrange = 80, sensor_status = 'Operational', sensor_role = 2014, sensor_guid = 'T5Z37W-0HMCI67HH16E0', sensor_dbid = 655, sensor_type = 2001 }, [4] = { sensor_isactive = 'No', sensor_name = 'Scout Mk.2', sensor_maxrange = 24, sensor_status = 'Operational', sensor_role = 2028, sensor_guid = 'T5Z37W-0HMCI67HH16E1', sensor_dbid = 2637, sensor_type = 2001 }, [5] = { sensor_isactive = 'No', sensor_name = 'Sea Watcher 100 [Seastar]', sensor_maxrange = 40, sensor_status = 'Operational', sensor_role = 2028, sensor_guid = 'T5Z37W-0HMCI67HH16E2', sensor_dbid = 5140, sensor_type = 2001 }, [6] = { sensor_isactive = 'No', sensor_name = 'IRSCAN', sensor_maxrange = 0, sensor_status = 'Operational', sensor_role = 2879, sensor_guid = 'T5Z37W-0HMCI67HH16E3', sensor_dbid = 331, sensor_type = 2004 }, [7] = { sensor_isactive = 'No', sensor_name = 'AR-700A(V)1', sensor_maxrange = 500, sensor_status = 'Operational', sensor_role = 3011, sensor_guid = 'T5Z37W-0HMCI67HH16E4', sensor_dbid = 1792, sensor_type = 3001 }, [8] = { sensor_isactive = 'No', sensor_name = 'Telegon 4', sensor_maxrange = 500, sensor_status = 'Operational', sensor_role = 3101, sensor_guid = 'T5Z37W-0HMCI67HH16E5', sensor_dbid = 165, sensor_type = 3001 }, [9] = { sensor_isactive = 'No', sensor_name = 'AR-700A(V)1 APECS II', sensor_maxrange = 0, sensor_status = 'Operational', sensor_role = 4021, sensor_guid = 'T5Z37W-0HMCI67HH16E6', sensor_dbid = 676, sensor_type = 3002 }, [10] = { sensor_isactive = 'No', sensor_name = 'AR-700A(V)1 APECS II', sensor_maxrange = 0, sensor_status = 'Operational', sensor_role = 4021, sensor_guid = 'T5Z37W-0HMCI67HH16E7', sensor_dbid = 676, sensor_type = 3002 }, [11] = { sensor_isactive = 'No', sensor_name = 'PHS-36', sensor_maxrange = 4, sensor_status = 'Operational', sensor_role = 5032, sensor_guid = 'T5Z37W-0HMCI67HH16E8', sensor_dbid = 1271, sensor_type = 5002 }, [12] = { sensor_isactive = 'No', sensor_name = 'DSBV 62C', sensor_maxrange = 40, sensor_status = 'Operational', sensor_role = 5101, sensor_guid = 'T5Z37W-0HMCI67HH16E9', sensor_dbid = 1900, sensor_type = 5011 }, [13] = { sensor_isactive = 'No', sensor_name = 'Gatekeeper [CCD]', sensor_maxrange = 25, sensor_status = 'Operational', sensor_role = 2701, sensor_guid = 'T5Z37W-0HMCI67HH16EB', sensor_dbid = 5144, sensor_type = 2003 }, [14] = { sensor_isactive = 'No', sensor_name = 'Gatekeeper [FLIR]', sensor_maxrange = 25, sensor_status = 'Operational', sensor_role = 2801, sensor_guid = 'T5Z37W-0HMCI67HH16EC', sensor_dbid = 5143, sensor_type = 2004 }, [15] = { sensor_isactive = 'No', sensor_name = 'STIR 180 [Radar]', sensor_maxrange = 32, sensor_status = 'Operational', sensor_role = 2143, sensor_guid = 'T5Z37W-0HMCI67HH16EE', sensor_dbid = 3146, sensor_type = 2001 }, [16] = { sensor_isactive = 'No', sensor_name = 'STIR 180 [IR Camera]', sensor_maxrange = 100, sensor_status = 'Operational', sensor_role = 2871, sensor_guid = 'T5Z37W-0HMCI67HH16EF', sensor_dbid = 3695, sensor_type = 2004 }, [17] = { sensor_isactive = 'No', sensor_name = 'STIR 180 [TV Camera]', sensor_maxrange = 100, sensor_status = 'Operational', sensor_role = 2671, sensor_guid = 'T5Z37W-0HMCI67HH16EG', sensor_dbid = 3696, sensor_type = 2003 }, [18] = { sensor_isactive = 'No', sensor_name = 'STIR 180 [Radar]', sensor_maxrange = 32, sensor_status = 'Operational', sensor_role = 2143, sensor_guid = 'T5Z37W-0HMCI67HH16EI', sensor_dbid = 3146, sensor_type = 2001 }, [19] = { sensor_isactive = 'No', sensor_name = 'STIR 180 [IR Camera]', sensor_maxrange = 100, sensor_status = 'Operational', sensor_role = 2871, sensor_guid = 'T5Z37W-0HMCI67HH16EJ', sensor_dbid = 3695, sensor_type = 2004 }, [20] = { sensor_isactive = 'No', sensor_name = 'STIR 180 [TV Camera]', sensor_maxrange = 100, sensor_status = 'Operational', sensor_role = 2671, sensor_guid = 'T5Z37W-0HMCI67HH16EK', sensor_dbid = 3696, sensor_type = 2003 }, [21] = { sensor_isactive = 'No', sensor_name = 'Mk1 Eyeball', sensor_maxrange = 50, sensor_status = 'Operational', sensor_role = 2016, sensor_guid = 'T5Z37W-0HMCI67HH16EL', sensor_dbid = 0, sensor_type = 2003 }, [22] = { sensor_isactive = 'No', sensor_name = 'Goalkeeper Tracker [Radar]', sensor_maxrange = 6, sensor_status = 'Operational', sensor_role = 2191, sensor_guid = 'T5Z37W-0HMCI67HH16F7', sensor_dbid = 1153, sensor_type = 2001 }, [23] = { sensor_isactive = 'No', sensor_name = 'Goalkeeper Acquisition [Radar]', sensor_maxrange = 12, sensor_status = 'Operational', sensor_role = 2103, sensor_guid = 'T5Z37W-0HMCI67HH16F8', sensor_dbid = 4252, sensor_type = 2001 }, [24] = { sensor_isactive = 'No', sensor_name = 'Generic Gun Director [TV Camera]', sensor_maxrange = 80, sensor_status = 'Operational', sensor_role = 2681, sensor_guid = 'T5Z37W-0HMCI67HH16F9', sensor_dbid = 4230, sensor_type = 2003 } }
>> local u = ScenEdit_GetUnit({name='boat',side='player'})

Then you can query from there.

local u = ScenEdit_GetUnit({name='boat',side='player'})
print(u.sensors[1].sensor_isactive)
'No'


_____________________________


(in reply to Parel803)
Post #: 2
RE: Condition Radar(s) on/off - 10/19/2021 2:04:58 PM   
Parel803

 

Posts: 517
Joined: 10/10/2019
From: Netherlands
Status: offline
TitaniumTrout, thank you for your help, appriciated
regards GJ

(in reply to TitaniumTrout)
Post #: 3
RE: Condition Radar(s) on/off - 10/19/2021 11:53:48 PM   
michaelm75au


Posts: 13419
Joined: 5/5/2001
From: Melbourne, Australia
Status: offline
There is another way to see sensors.
quote:

local u = ScenEdit_GetUnit({name='DD 101 Murasame', guid='a1a52edf-3541-4b55-bea4-58d4e1ab11dc'})
print(u.components)
print(u:filterOnComponent('sensor')


I am going to add a second optional parameter to the filter - the DBID to look for
quote:

print(u:filterOnComponent('sensor',1650))

This will return a table of just the sensors for DBID (1650).



_____________________________

Michael

(in reply to Parel803)
Post #: 4
RE: Condition Radar(s) on/off - 10/20/2021 6:58:33 AM   
Parel803

 

Posts: 517
Joined: 10/10/2019
From: Netherlands
Status: offline
michaelm75au,

thank you, appriciated

regards GJ

(in reply to michaelm75au)
Post #: 5
RE: Condition Radar(s) on/off - 11/2/2021 11:14:29 PM   
KnightHawk75

 

Posts: 1346
Joined: 11/15/2018
Status: offline

quote:

ORIGINAL: michaelm75au

There is another way to see sensors.
quote:

local u = ScenEdit_GetUnit({name='DD 101 Murasame', guid='a1a52edf-3541-4b55-bea4-58d4e1ab11dc'})
print(u.components)
print(u:filterOnComponent('sensor')


I am going to add a second optional parameter to the filter - the DBID to look for
quote:

print(u:filterOnComponent('sensor',1650))

This will return a table of just the sensors for DBID (1650).




Dope.

(in reply to michaelm75au)
Post #: 6
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Condition Radar(s) on/off 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

0.348