Jump to content

Recommended Posts

Posted (edited)

Hi All,

Is there a way that I could be notified by way of a 'Message to All'' when a specific named unit launches his AGM-88C. I know I can do Missile in Zone, but I am looking for a specific named unit fires his/hers AGM-88C, not just when an AGM-88C in the designated trigger area

Thanks 

Toni

Edited by Toni Carrera

Toni Carrera (Ice Rhino)

 

ThrustMaster HOTAS Warthog Throttle & A10C Stick, ThrustMaster F/A-18C Stick, ThrustMaster TFRP Pedals, ThrustMaster Cougars x 2, fitted to CubeSim USB Screens, TrackIR 4 Active LED & Cap Reflector, Stream Deck XL

Intel® Core™ i7-5820K 12 Core Processor, 32GB RAM, 1 x 500GB SSD, 2 x 256GB SSD, 1 x 1TB SSD 4 x 4TB Western Digital Mechanical. 2 x ASUS GTX 1080's SLI, ASUS 29" Ultrawide flanked by 2 x 22" IPS Monitors

  • Toni Carrera changed the title to Notification on Specific Named Unit Launching Missile
Posted

@Toni Carrera, you seem like a keen mission maker, and you are about to fall down the addictive rabbithole known as scripting! 🙂  This will get you started down the path, and I apologize in advance if it starts to consume a lot of time (it did that for me).

OK, you are going to need some scripting to achieve what you are seeking. 

  • For the AGM-88 being launched by a specific unit, copy and paste the script below as a "Do Script" command sometime before you need it (make sure to make a condition that the firing unit is still alive).  
  • This script will detect when a unit named CHEVY 11 fires an AGM-88.  It will also set flag 8000 to become active and increment it's value by 1 each time CHEVY 11 fires a HARM.   The flag thing isn't mandatory, it's just a way to keep score, in case you want to use it later. 
  • The script also puts a text message up (in this case for 3 seconds.  You can change that if you'd like).
  • Make sure you use the UNIT NAME in the script, it won't work with the group name. 

*******************************************

Handler = {}
function Handler:onEvent(event)
if event.id == world.event.S_EVENT_SHOT and event.initiator == Unit.getByName('CHEVY 11') then
              local Weapon_Type = event.weapon:getTypeName()
              if Weapon_Type == "AGM_88" then
                 flag_value = trigger.misc.getUserFlag('8000')
                 trigger.action.setUserFlag('8000', flag_value + 1)
                 trigger.action.outText('CHEVY 11, MAGNUM!!', 3)    
               end
           end
       end
 
world.addEventHandler(Handler)

 

********************************************

This will get you started.  GRIMES and others keep the SSE documentation updated here: https://wiki.hoggitworld.com/view/Simulator_Scripting_Engine_Documentation

Try the script above, and then check out the SSE docs, it really opens up the possibilities of DCS.

 

 

 

  • Like 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...