Home   Help Search Login Register  

Author Topic: Determining if specific units are in trigger boundaries  (Read 815 times)

0 Members and 3 Guests are viewing this topic.

Rocko Bonaparte

  • Guest
I was an east trigger for detecting west units, but I don't want it to go off unless certain west units are present within its boundaries.  My first though was the write a function (sqf) to return my value.  This won't work, though, because the return value has to be set to a variable IIRC.  I don't believe I can just call the function and have its return value power the expCond.  

The units in question are all in a group, and they are all also individually named.  I could go the long way and just test them all individually, but that's a lot of logic; I would have to do it for every trigger.

Any suggestions before I do something very hard and pointless?

Offline Pilot

  • Contributing Member
  • **
Re:Determining if specific units are in trigger boundaries
« Reply #1 on: 24 Jan 2005, 02:51:14 »
Can't you simply group the unit(s) to the trigger, then set the trigger to "any group member" or "whole group" present?

Rocko Bonaparte

  • Guest
Re:Determining if specific units are in trigger boundaries
« Reply #2 on: 24 Jan 2005, 03:51:49 »
I dunno -- maybe.

I've written a ton of code for the game, and didn't discover the "Advanced" tab in the mission editor today.   :-X
« Last Edit: 24 Jan 2005, 03:52:02 by Rocko Bonaparte »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Determining if specific units are in trigger boundaries
« Reply #3 on: 24 Jan 2005, 11:22:11 »
Quote
I've written a ton of code for the game, and didn't discover the "Advanced" tab in the mission editor today.

 ;D  You poor bastard, that's not funny at all .....

Depending on exactly what you want, there are two possible solutions.   The first is Rocko's - group the trigger to the group and look at the new options in the Activation box.

If that doesn't work, you can use thislist.    thislist is an array returned by a trigger and consisting of all the units in the trigger area that are on the "side" first mentioned in the Activaiton box.     For example, if you set the Activation box to East not present, thislist would return an array of all the East units in the trigger area.    

You can use thislist in the Condition line, for example:-

Condition:   this and (loon1 in thislist)


By using the command list you can also use the array elsewhere, for example in a script.    Note that the array is dynamic:  if you want to "capture" it at a moment in time you need a + command.     For example, I have a script with this code:

_trigList = list mapTrig
_upList = +_trigList

where mapTrig is the name of a trigger.
Plenty of reviewed ArmA missions for you to play