Jump to content
Sign in to follow this  
jakerod

Or Problem

Recommended Posts

guer_at_ty==1 or guer_at_dock==1 or guer_at_power==1

That is in the condition field of a trigger I have. I was under the impression that only one of those needs to be true in order for the trigger to trip. However, that is not the case. When the first one becomes true... the above trigger doesn't activate. Why is that?

Share this post


Link to post
Share on other sites

Hi Jakerod

Could you be a little more precise describing the situation and the purpose of the trigger just to understand a bit better. it is strange though cause the trigger should get activated as soon as 1 of the above conditions are met. What is the purpose of the trigger and the condition?

Share this post


Link to post
Share on other sites
Hi Jakerod

Could you be a little more precise describing the situation and the purpose of the trigger just to understand a bit better. it is strange though cause the trigger should get activated as soon as 1 of the above conditions are met. What is the purpose of the trigger and the condition?

guer_at_ty is set up so that if independent is detected within an area by blufor it goes guer_at_ty=1. That works fine because I made sure that that wasn't the problem.

When I cut out the guer_at_power and guer_a_docks part then the trigger works fine. I don't understand why it does that though.

The trigger the top code is found in is synced to a few waypoints so that men (switch) will get into helicopters. If I take out the power and docks one then it works fine. But when I put them in and the guer_at_ty=1 trigger is tripped they don't do anything.

So it has to be a problem with the or then thing I think.

Share this post


Link to post
Share on other sites

I'm a bit confused by the code in the condition field for being honest, As far as I understood you have set 3 triggers ty - power - docks and as soon as independent is detected by Blufor within the set trigger areas they send in reinforcements. You could try to sync a movement trigger (switch) condition field (move) to the relative waypoints for the reinforcements instead of grouping them to the condition trigger. I experienced sometimes trouble when syncing waypoints some units got stucked and they wouldn't move so I always try to find a work around. What did you put in the activation fields of the condition triggers when Indipendent is spotted?

Now I just tried something in the editor therefore my late reply. I set 3 triggers (ty, docks, power on Utes Activation by Independent detected by Blufor. first trigger Activation move1 = true . The other 2 set in activation move2= true and 3rd move3 = true. I set 3 reinforcement humvees (car1,car2,car3) instead of the choppers, for each location one reinforcement humvee. I set 3 triggers condition (move1,move2,move3) set to switch and synced to their respective waypoint of the humvees and it works perfectly. Without problem. Once independent is detected every humvee moves to his destination.

It is not ideal but it might be a work around to reach your purpose.

unfortunately I'm not good in scripting therefore I need to find a lot of work arounds with triggers.LOL:D

regards

nettrucker

Share this post


Link to post
Share on other sites

Using OR should work fine it does for me.

Are you defining the variables in a gamlogic or unit init first ie guer_at_ty=0 ect , if not it won't work.

Share this post


Link to post
Share on other sites
Using OR should work fine it does for me.

Are you defining the variables in a gamlogic or unit init first ie guer_at_ty=0 ect , if not it won't work.

thank you, i will look into that.

@nettrucker- thanks for the work around. I tend to need to find those a lot too. I'll use that if I can't get it to work.

Share this post


Link to post
Share on other sites

As F2k Sel said, you need to define variables before using them.

If/while/trigger condition/etc, all of them are checked completely, even if they are "ORs". One undefined variable will break the whole condition.

Btw, you can use booleans in Arma 2:

var = true

var2 = false

Then you can use cleaner trigger condition:

var || var2

Share this post


Link to post
Share on other sites

If you're using booleans in the trigger, they don't need to be defined. Following works without error:

Trigger A condition: BLUFOR present

Trigger A activation: test = true

Trigger B condition: test

Share this post


Link to post
Share on other sites

Yeah, one var will work.

But, try this:

Trigger A: test = true

Trigger B: test2 = false

Trigger C cond: test || test2

Fire A and C will not fire. Then, fire B and C will go off, not because test2 is true, but because it's defined. ;)

Edit:

Even this condition will not fire, because test is undefined:

true || test

Edited by Shuko

Share this post


Link to post
Share on other sites

Right you are :), though neither example gave rpt errors for me.

..and you just solved a bug I was trying to fix in my last mission.

Share this post


Link to post
Share on other sites
Right you are :), though neither example gave rpt errors for me.

..and you just solved a bug I was trying to fix in my last mission.

Yep, I have a feeling this issue is one of the major causes for peoples trigger problems.

Share this post


Link to post
Share on other sites

guer_at_ty=0; guer_at_dock=0; guer_at_power=0

I have that in the init line of a gamelogic now so that it defines them as 0 as soon as it starts. Now the problem is that the helicopters take off immediately instead of waiting for one of them to become true.

The problem seems to be a trigger that says guer_at_dock=1. The thing about it though is that it is set to Independent detected by BLUFOR / On Activation: guer_at_dock=1; hint "ahahahaha" <-for testing purposes.

The problem with it is that it trips even without independent units detected in there. There are no independent units even in the area when the level starts. So I switched it to OPFOR detected by BLUFOR. It still trips. There aren't even any OPFOR units on the map!!! Anyone know what's going on? There are some empty vehicles in the area but I made sure that they are all civilian. It also trips off with seized by OPFOR or seized by Independent.

PROBLEM SOLVED: I just deleted the trigger and made a new one with the exact same stuff in it. For some reason that one trigger was bugged which makes no sense to me but it is at least working.

Edited by Jakerod

Share this post


Link to post
Share on other sites

If you do need to use the other conditions in a trigger ie the anyone present ect then you would need a trigger looking like this

Cond

 this and (guer_at_ty==1 or guer_at_dock==1 or guer_at_power==1)

At least you got it working.

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  

×