1nutworld -> RE: Looking for scripting/mission help (7/27/2021 11:20:42 PM)
|
quote:
ORIGINAL: tmoilanen Hi Scott - you should create an event with a "Unit is Detected" trigger on your F-35/F-22. below is a LUA script that should work as the action for that event...replace myside and myunitname with your OPFOR side and the unitname of the emitter that you want to activate. Hope this helps...TM myside = 'PLAN' myunitname = {'KZLDY'} for i = 1, #myunitname do unitname = myunitname myunit = ScenEdit_GetUnit({side=myside,name=unitname}) print(myunit) print(myunit.obeyEMCON) myunit.obeyEMCON = true print(myunit.obeyEMCON) myemcon = 1 -- if you want to add some randomness to it substitute math.random(1,2) for 1 if myemcon == 1 then -- check the random emcon variable ScenEdit_SetEMCON('Unit',unitname,'Inherit=false;OECM=Active') --if myemcon = 1 activate the radar else ScenEdit_SetEMCON('Unit',unitname,'Inherit=false;OECM=Passive') --if myemcon does not equal 1 do nothing print(myunit.sensors) end end I'm, not getting the script to run properly....I guarantee you it is something to do with my typing. mind if I send you PM to help figure out the issue? I'm sure it's something simple
|
|
|
|