Jump to content

A trigger for when 'a specific unit' destroys another 'specific unit'?


Recommended Posts

Is there a way in which to highlight one specific unit destroying another specific unit without a script?

My work around is equiping a unit with a different missile and having a 'missile in zone and unit destroyed',
But that trigger is sometimes is missed in game. And doesnt seem a reliable one.

 

Cheers.

Link to post
Share on other sites
32 minutes ago, StevanJ said:

My work around is equiping a unit with a different missile and having a 'missile in zone and unit destroyed',
But that trigger is sometimes is missed in game.

 

When using the "missile in zone" you have to take into account that the triggers list is executed only about once per second, so if the zone is too small it is entirely possible that the missile would pass trough it in less than one second and thus be missed by the trigger. Increasing the zone size a bit will make such triggers more reliable.

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to post
Share on other sites
1 minute ago, Rudel_chw said:

 

When using the "missile in zone" you have to take into account that the triggers list is executed only about once per second, so if the zone is too small it is entirely possible that the missile would pass trough it in less than one second and thus be missed by the trigger. Increasing the zone size a bit will make such triggers more reliable.


That explains alot.. A really good insight. Thank you.

How would you find a resolve to a 'specific unit kills specific unit?'

Link to post
Share on other sites
3 minutes ago, StevanJ said:

How would you find a resolve to a 'specific unit kills specific unit?'


I think that cant be done with just trigger logic alone, you would need a scripting function, but I’m really lousy at scripting 😞

  • Thanks 1

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to post
Share on other sites

There is also another problem with missile in zone, the number. If you and your wingman would fire a AGM-65 for example at the same time that enters the trigger zone and detonates with less than 1 second spacing you wont trigger a Missile in zone, AGM-65, 1 trigger because there will always be either 0 or 2 missiles in the zone. To rule out that problem you must create a OR condition so you can check for both 1 and 2. The problem becomes bigger if you want to trigger for salvo fired rockets or gun rounds, then you need many OR conditions. This condition would be much easier to use if the number was the MINIMUM number of missiles in a zone at a given time instead of the ABSOLUTE but that is not the case sadly.


Edited by Fisherman82
Link to post
Share on other sites
2 hours ago, StevanJ said:


...How would you find a resolve to a 'specific unit kills specific unit?'

 

Only by script for what I know. Here a .miz file as example (a S3 is engaged by Mig29A + Mig29S + Su27 / on S3's death a message tells who killed the S3). It's not much script to write :

 

function KillEvent(event)

        if event.id == world.event.S_EVENT_KILL then
        trigger.action.outText(event.target:getName() .. ' Got Killed by ' .. event.initiator:getName() .. '!', 10)
        end
end
KillEventID = mist.addEventHandler(KillEvent)

 

(note : this example requires MIST to be loaded at mission start)

test-who-killed.miz

  • Thanks 1
Link to post
Share on other sites
13 minutes ago, toutenglisse said:

 

Only by script for what I know. Here a .miz file as example ...

 

Thanks a lot, really useful .. I will store it on my DCS tips folder 👍

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to post
Share on other sites

If you want to make it only appear for a specific unit killing another specific unit, you can do this:

 

Handler = {}
function Handler:onEvent(event)
if event.id == world.event.S_EVENT_KILL and event.initiator == Unit.getByName('GoodGuyUnitName') and event.target == Unit.getByName('BadGuyUnitName') then
trigger.action.outText(event.initiator:getName().." killed "..event.target:getName(), 2)
end
end
world.addEventHandler(Handler)

 

No MIST required, but you have to edit the GoodGuyUnitName and BadGuyUnitName to the specific UNIT name of the units you want to reference.


Edited by Sedlo
  • Thanks 1
Link to post
Share on other sites
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...