Jump to content
Crimson Mage

Arma 3 A trigger must be triggered when a Independant soldier shoots

Recommended Posts

Hi, I need help with my mission. I have made voice clips for my characters and I want one of my characters to say a line in the beginning of a mission when they are being shot at. I used to use "Detected By BLUFOR" but it just wouldn't line up correctly. So is it possible for a trigger to be activated when a Independent shoots?

Share this post


Link to post
Share on other sites

Show your code of triggers onAct field please

Gesendet von meinem SUNNY mit Tapatalk

Share this post


Link to post
Share on other sites

As an example, in the unit's init field you would have something like:

 

this addEventHandler ["Fired", {code}];

 

The examples on the wiki are a really good way to work it out, so wrap your head around those and you'll be off to a good start. Then once you think you've got something to work with, post it here with any problems or questions you still have.

Share this post


Link to post
Share on other sites

How do you make it so that the event handler will be triggered when a group or any independent soldier shoot? I just wantit to shoot once. I have tried a array of unit variable names but it did not work.

Share this post


Link to post
Share on other sites
Just now, Crimson Mage said:

How do you make it so that the event handler will be triggered when a group or any independent soldier shoot? I just wantit to shoot once. I have tried a array of unit variable names but it did not work.

Follow the comment from beno_83au above your post.

Or show what you have tried already.

 

Cheers

Share this post


Link to post
Share on other sites

{_x setVariable ["firing", _x addEventHandler ["Fired", {

  < your code here>;

  {_x removeEventHandler ["fired", _x getVariable "firing"]} forEach yourArray;

  }]

]} forEach yourArray;

 

Why? Because you want to fire just once the code, regardless of the units of your array. Then no more units must trigger this EH and you must remove it on every unit.

The only way to identify the good EH to remove, as far as you can have other "fired" EH in addons or else, is to pass it through a variable attached to the unit.

That works.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×