Home   Help Search Login Register  

Author Topic: Array in Condition field?  (Read 2517 times)

0 Members and 1 Guest are viewing this topic.

Offline RT-SuperTron

  • Members
  • *
  • Prey...you will be
Array in Condition field?
« on: 21 Aug 2002, 21:24:40 »
 :D

Weee, I just wanna know how the f.....something I can make an array in the Condition field work.

exmpl.

Condition: ? Player in VehicleName

If I have several Vehicles for witch this condition must go, how should I put it in the Condition. ::) For some odd reason I cant make it work.

Thnx

[RT]SuperTron
+- PAIN IS YOUR FRIEND, IT WILL REMIND YOU THAT YOU ARE ALIVE -+

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re:Array in Condition field?
« Reply #1 on: 21 Aug 2002, 21:30:53 »
Hm, well, if you've got a host of different vehicles and each person must go into their separate vehicle, there's really no "easy" way to do this (as in with a forEach command). You'd have to put:

aP in Vehicle1 AND aB in Vehicle2 AND aC in Vehicle 3

Or, I suppose, depending on the situation, you could synchronize the "get In" waypoint with the trigger (or possible a Move waypoint right ahead of the vehicle, activating as soon as the Get In waypoint is complete -> after the person is in the vehicle), or put a small aBIn=true into the On Activation field of each waypoint. But that would be just as much work, so the whole string of AND's is probably the best.

If it was something else you wanted, please elaborate  :D

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

seanver

  • Guest
Re:Array in Condition field?
« Reply #2 on: 21 Aug 2002, 21:31:53 »
you mean you want something like: player in vehicle AND player2 in vehicle AND player3 in vehicle2

??

Offline RT-SuperTron

  • Members
  • *
  • Prey...you will be
Re:Array in Condition field?
« Reply #3 on: 21 Aug 2002, 22:00:35 »
 :o

D**n the F*****s are fast too.

You are on my trail but not quite so let me xplain a little further.

Im toying with some scripts for the "Comcag" witch you can obtain at www.operation-flashpoint.dk

This script is light version of some heavy "radio" scripting and the idea is that only the units present in the Comcag's can see other units on the "map", kinda like a radar system. So if you are in a comcag you can see and comunicate with other units, and if you are not then..."bad luck guys, last boat outa here leaves at 5.15, but i guess you'll never know  ;D"

Therefor the units/players dont have to be in the comcags at the same time.

It seams that if I use ..

Condition: ? Player in Cag1 OR Player in Cag2 OR Player in Cag3

It will only work with one of them..

[RT]SuperTron
+- PAIN IS YOUR FRIEND, IT WILL REMIND YOU THAT YOU ARE ALIVE -+

Bremmer

  • Guest
Re:Array in Condition field?
« Reply #4 on: 21 Aug 2002, 22:26:00 »
Untested, by I think it should work:

Declare an array of all the vehicles you are interested in in your init file. eg.

vehs = [car1,car2,tank1,tank2,boat1,boat2]

Don't forget to name the vehicles in the editor. Set up a repeating trigger with condition:

(vehicle player) in vehs

Now whenever you get in one of the vehicles you declared the trigger will be true, and false when you get out again.

Cheers

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Array in Condition field?
« Reply #5 on: 22 Aug 2002, 00:15:09 »
Quote
vehs = [car1,car2,tank1,tank2,boat1,boat2]

               Don't forget to name the vehicles in the editor. Set up a repeating trigger with condition:

               (vehicle player) in vehs

Bremmer, i think this condition will only check, if the variable "player" can be found
in array "vehs"

It would become true, if vehs=[car1,car2,player,tank1,tank2,etc.]

In this case, it would be false.

But probably could work:

"player in _x" foreach vehs

If not, you could try to capture the vehicles with a trigger (to get in use of trigger_list),
and then the condition should work:

"player in _x" foreach list trigger_name

:edit - but then again, i noticed: (vehicle player) in Bremmer's reply - yep, that should work aswell
 - sorry Bremmer.

~S~ CD
« Last Edit: 22 Aug 2002, 00:18:05 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Array in Condition field?
« Reply #6 on: 22 Aug 2002, 06:44:47 »
What you're after is the count command... it's kind of the equivelent of foreach in a condition field:

"player in _x" count [veh1,veh2,veh3] > 0

Throwing that into a condition field of a trigger will make it go off if the player jumps into one of the vehicles in the bold array. You can either add more vehicles there, or as Bremmer suggested, create an array in the init.sqs or where ever is more convenient and use that

tai mai shu

  • Guest
Re:Array in Condition field?
« Reply #7 on: 22 Aug 2002, 08:04:09 »
damn, you moderators are ofp gods!!!!  :P  ;)  ;D, but than again, thats probly why your mods on the best ofp sditing website on the planet
« Last Edit: 22 Aug 2002, 08:04:44 by tai mai shu »

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Array in Condition field?
« Reply #8 on: 22 Aug 2002, 17:45:53 »
huh - yeah off course it's count, not foreach.

Anybody seen my head laying around?  :D

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Array in Condition field?
« Reply #9 on: 28 Aug 2002, 19:57:16 »
#Problem solved! Nice  :D
Not all is lost.