Jump to content

Radio call when player fires a weapon.


Gierasimov

Recommended Posts

Is it possible, to create a multi missile in zone trigger in ME?

Is there a script for the action like this.

 

Player is in zone.

Player shots AIM120C or AIM9X

Call is made over radio for either Fox3 or Fox2.

 

With ME I can achieve this for the first weapon shot of each type, but not for subsequent release of the same weapon.

Intel i7-13700KF :: ROG STRIX Z790-A GAMING WIFI D4 :: Corsair Vengeance LPX 64GB ::  MSI RTX 4080  Gaming X Trio  :: VKB Gunfighter MK.III MCG Ultimate :: VPC MongoosT-50 CM3 :: non-VR :: single player :: open beta

Link to comment
Share on other sites

How would you go about doing this in the ME? If it's a matter of a ONCE trigger, change it to a SWITCHED CONDITION...

Wayz Out

 

 

Intel Core i9 9900K | ASUS ROG Strix Z390E Gaming MB | G.Skill Ripjaws V 32gb DDR4-3200 | GeForce RTX 2080 Ti | Samsung 970 EVO Plus NVMe

HTC Vive Pro VR | Logitech G x56 HOTAS | Logitech G PRO Pedals

Link to comment
Share on other sites

Not quite

 

I am using switched condition trigger, but this is what it does -

 

The first time the missile enters the zone, the trigger action will be activated, because the previous check of the trigger conditions was evaluated as false (missile was not in zone).

 

The trigger will not activate any longer as long as the missile is inside the zone, because the previous check of the trigger conditions will be evaluated as true (missile remains inside zone).

 

However, if the missile exits the zone and then re-enters it again, the conditions will have once again switched from false to true and the trigger action will be activated.

 

So, my pilot will call Fox Three on the first AMRAAM, but not if I fire any follow-ups, hence the question.

 

A solution would be if I was able to use MISSILE IN MOVING ZONE condition, just like I can do with a UNIT. But MISSILE IN ZONE is the only one available.

Intel i7-13700KF :: ROG STRIX Z790-A GAMING WIFI D4 :: Corsair Vengeance LPX 64GB ::  MSI RTX 4080  Gaming X Trio  :: VKB Gunfighter MK.III MCG Ultimate :: VPC MongoosT-50 CM3 :: non-VR :: single player :: open beta

Link to comment
Share on other sites

I put this together some months ago from code I found posted on the forum. This will activate a different flag for Fox 1, 2 and 3 fired by a unit called _Player.

 

 

See if this helps

 

 

 

 

 

FoxplusHandler = {}
function FoxplusHandler:onEvent(event)
       if event.id == world.event.S_EVENT_SHOT and event.initiator == Unit.getByName('_Player') then
           local _wpn = event.weapon:getDesc()
           local _wpnType = _wpn.guidance
           if _wpnType == 4 then
                   trigger.action.setUserFlag('1001', true)
           end
           if _wpnType == 2 then
                   trigger.action.setUserFlag('1002', true)
           end
           if _wpnType == 3 then
                   trigger.action.setUserFlag('1003', true)
           end
   end
end
world.addEventHandler(FoxplusHandler)

Link to comment
Share on other sites

I put this together some months ago from code I found posted on the forum. This will activate a different flag for Fox 1, 2 and 3 fired by a unit called _Player.

 

 

See if this helps

 

 

 

 

 

FoxplusHandler = {}
function FoxplusHandler:onEvent(event)
       if event.id == world.event.S_EVENT_SHOT and event.initiator == Unit.getByName('_Player') then
           local _wpn = event.weapon:getDesc()
           local _wpnType = _wpn.guidance
           if _wpnType == 4 then
                   trigger.action.setUserFlag('1001', true)
           end
           if _wpnType == 2 then
                   trigger.action.setUserFlag('1002', true)
           end
           if _wpnType == 3 then
                   trigger.action.setUserFlag('1003', true)
           end
   end
end
world.addEventHandler(FoxplusHandler)

 

How would you change this if you wanted to apply this to a group instead of a unit?

 

Thanks

Link to comment
Share on other sites

  • 5 months later...
  • Recently Browsing   0 members

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