Jump to content
Sign in to follow this  
Xen0tech

Need help with fired event handler

Recommended Posts

I've tried seaching but could not find a step by step guide for dummies. All I want to know is in as simple terms as possible how to make it so when an enemy fires his weapon the mission will fail.

Any help will be greatly appreciated :)

Share this post


Link to post
Share on other sites

So if for example I wanted the whateveryouwanttohappen to be setting of another trigger that has an alarm effect is that possible?

Share this post


Link to post
Share on other sites

yep - if im understadning you correctly - using a global or public variable to be accessed by another trigger - whateveryouwanttohappen = true; could stick this in a condition, waituntil{whateveryouwanttohappen}; but looking at it - if you are coding single player Messiah has given you all the tools you need.

this addeventhandler ["fired", endMission "END1";]; 

or

endgame {endMission "END1";};
this addeventhandler ["fired", spawn endGame];    

Share this post


Link to post
Share on other sites

Aye, sorry, was in a rush with the reply. Like mikie says (and this is me quickly spitballing, I may be a little wrong with the coding here):

this addeventhandler ["fired", (variablename = true)]

where variablename is any name you want to make up, such as end_mission or whatever, then in a trigger you can set the condition line to read:

variablename

when the guy fires, the variable will become true, and then the trigger will be activated. You can also throw in a bit of a countdown to shake things up so it's not the exact same second that he fires his weapon.

Share this post


Link to post
Share on other sites

You need curved brackets / code.

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

Share this post


Link to post
Share on other sites

wow thanks guys i'll give it a try and make one countdown trigger for alarm noise then another a few seconds longer to lose mission :)

---------- Post added at 10:00 AM ---------- Previous post was at 09:51 AM ----------

It worked :D That was much easier than I expected thank you so much! I tried to read a guide on event handlers and it mentioned sqf files and all sorts of complicated stuff without even mentioning the basics.

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
Sign in to follow this  

×