Jump to content
jAMDup

Counter measures also trigger the "fired" EH

Recommended Posts

The vehicle I'm working on has three "weapons", a smoke screen, an M2 .50 cal (Non functional at the moment), and the main armament. This main armament can only work by script, otherwise it doesn't have the desired effect. The problem is I use the "fired" event handler  to run the script, and after some testing I found out, when the smoke screen is deployed, it also sets of the main armament. I've looked through the EH page on the wiki and saw nothing of use, which begs the question, is there a work around for this problem?

 

Thanks

Share this post


Link to post
Share on other sites

How do I implement the arguments though?

Right now I have this:

 

class Eventhandlers

{

     init = "_ok = _this execVM '\ Init File Path'";

     fired = "_ok = _this execVM '\main armament'";

};

Thank you!

Share this post


Link to post
Share on other sites

Throw an if statement around the execVM or put the if inside the file you execute for fired. Both have their own benefits being inside config will be more immediate, and inside file will run slightly smoother but slower.

Share this post


Link to post
Share on other sites

I've deciced on putting the "If" statement in the executed file, but I'm a little confused on the syntax.

If (fired..) then{ // What do I use here to check the weapon?

 

 

 

};

Sorry, I'm new to using EH. Thank you for the assistance so far.

Share this post


Link to post
Share on other sites

Your config should stay similar, but inside the .sqf you call you should put something like

If (_this select 1 isKindOf "main_armament_classname") then { //insert code for firing main armament };

Share this post


Link to post
Share on other sites

Perfect, that's what I was looking for. Thank you so much.

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

×