Xen0tech 10 Posted April 29, 2013 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
Messiah 2 Posted April 29, 2013 https://community.bistudio.com/wiki/addEventHandler So in the unit who's not allowed to fire a gun or mission fail, add: this addeventhandler ["fired", whateveryouwanttohappen] whateveryouwanttohappen could be a variable becoming true which in turns triggers a trigger to end the mission, a script, etc etc Share this post Link to post Share on other sites
Xen0tech 10 Posted April 29, 2013 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
mikie boy 18 Posted April 29, 2013 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
Messiah 2 Posted April 29, 2013 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
neokika 62 Posted April 29, 2013 You need curved brackets / code. this addEventHandler ["Fired", { hint "Fired"; }]; Share this post Link to post Share on other sites
Xen0tech 10 Posted April 30, 2013 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