Jump to content
Sign in to follow this  
zeeFish

Variables, Tasks, and Triggers

Recommended Posts

[Apologies in advance if this is not the correct place. I felt this question fit better here than in the other sections on mission editing]

So I'll admit before anything else that I'm new to Arma's community, bear that in mind. However I am fairly familiar with writing code, syntax, etc as I've been interested in C and C++ for a very long time. I have spent many hours attempting to solve the problem I am having here, and those hours have included looking at many examples from various forums on the subject in the community. At this point I don't know if I'm simply putting the information in the wrong place, or if the system doesn't work how I have come to understand it does.


For the purpose of solving this problem specifically I have set up a new scenario, just to keep things simple. I have two objectives, with a 3rd trigger that is set up (via script) to create a third objective once the first two are completed (in any order). I have confirmed that the creation script is working correctly, so the 3rd objective does create properly once it is triggered.


The problem appears to be with the Boolean variables I have set up in my init.sqf. The entirety of the document reads simply:
 

obj1 = false;
obj2 = false;


The purpose is simply to set up these variables so that I can modify them when an objective is completed successfully. The 3rd trigger condition is then set to fire, once both variables read true. The problem here is that this never happens.

What I am attempting to do is simply change obj1 and obj2 to equal true in the "On Activation" part of their respective triggers. Is this not how the system works?


Thank you in advance for any assistance you can lend, I would very much like to know what I'm doing wrong.

Share this post


Link to post
Share on other sites

I can't address how you have your init.sqf set up, but I can shed some light on trigger syntax. Firstly, here is a great reference: https://community.bistudio.com/wiki/triggerActivated 

I have a a trigger similar to what you are describing. I need a message to be sent when 2 triggers' conditions have been met.  So, in my Conditions field, I have  

this && triggerActivated trig1;

So when "this" trigger and trigger 1 (trig1) have been activated, my message is sent. 

Share this post


Link to post
Share on other sites

Also, It might be easier, and more flexible if you use numbers...

 

obj1 = 0;

obj2 = 0;

 

 

Then in your Trigger it's looking for both obj1 and obj2 to be a 1.

((obj1 == 1) && (obj2 == 1))

Share this post


Link to post
Share on other sites

Thanks for the advice, guys. Didn't know about triggerActivated. I went over it again (for the millionth time) and somehow it's working now. Appreciate the input!

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  

×