Home   Help Search Login Register  

Author Topic: Checking mutliple conditions  (Read 1327 times)

0 Members and 1 Guest are viewing this topic.

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Checking mutliple conditions
« on: 26 Mar 2008, 03:05:24 »
I've been out of the loop for too long.
How do I check if multiple conditions have been met an a script?

Let's call my conditions,
Con1
Con2
Con3

Appreciate it. Cheers.
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Nexolate

  • Members
  • *
  • The lurking S.T.A.L.K.E.R.
Re: Checking mutliple conditions
« Reply #1 on: 26 Mar 2008, 07:16:15 »
Wouldn't you use a GameLogic Unit?

Create an "AND" Waypoint off it, then synchronise seperate Triggers with each of the conditions to that Waypoint?
It's in the Guide on the site if I haven't made myself clear enough.
You'll only notice me when it's too late.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Checking mutliple conditions
« Reply #2 on: 26 Mar 2008, 10:06:54 »
Code: (SQF) [Select]
if (Con1 && Con2 && Con3) then {blah blah}
or

Code: (SQS) [Select]
? Con1 && Con2 && Con3 : blah blah
or for a trigger

Code: (trigger) [Select]
Condition: Con1 && Con2 && Con3
On activation : Blah blah

Not much harder than that. ;)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Checking mutliple conditions
« Reply #3 on: 27 Mar 2008, 00:23:38 »
Cheers for the syntax Wolfrug.

Here's what's not working.
I have four triggers. Each of the triggers are set to BLUFOR. On activation in each is 1Clear 2Clear 3Clear respectivley.
Here's my code.

Code: [Select]
#Start
? 1Clear && 2Clear && 3Clear : goto "exit"
~1
goto "Start"


#Exit
hint "All CLear"
Exit

Nothing is happening once all my guys have past through the triggers.  :(
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: Checking mutliple conditions
« Reply #4 on: 27 Mar 2008, 00:29:21 »
I guess it's up to me to ask the dumb questions  :D

In the on activations, did you clearly typed:
1clear = true

Did you tried to hint out the status of the conditions?

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Checking mutliple conditions
« Reply #5 on: 27 Mar 2008, 00:51:12 »
Yes to both.

If I use Wolf's code;

Code: [Select]
Condition: Con1 && Con2 && Con3
On activation : Blah blah

then it asks me for missing (



Fixed it.
Although I originally said my condidtions were Con1, 2 etc. When I wrote the script I made the conditions 1Clear, 2Clear, etc. ArmA Doesn't like the first character in a condition to be a number so I swapped the number to the end and made the conditions Clear1, Clear2 etc. Now it works fine.
Thanks for the help guys.  :good:
« Last Edit: 27 Mar 2008, 11:39:29 by h- »
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."