Jump to content
Sign in to follow this  
Toumaxx

Multiple unit detection for triggers

Recommended Posts

I'm building a mission here ...

The plot: Your unit is sent to scout for a tank platoon (consisting of 16 armoured units, all empty, not grouped).

Upon detection of every single unit, the mission shall end.

As to my problem:

Is it possible to check for multiple units inside a single trigger (for the trigger's activation)? If so, how do you do it? I've only been able to connect the trigger to a single unit.

Share this post


Link to post
Share on other sites

Well it is possible to do what you want but it will take 17 triggers.

1. First you will need a init.sqs file in the mission directory, and add this into it :

detect = 0

2. After that make a trigger grouped with the empty unit and set it up how you want it to activate, then in the onactivation feild put :

detect = detect + 1

Now do this for all the units you want to be detected (making new triggers with the same set up as the first, ie detected by east).

3. Have a trigger (size 0,0)with :

detect == 16 (or how many units you are wanting to check)

in its condition feild.

And to make that trigger end the mission make the trigger type #end1

Hope that helped you.

RED

Share this post


Link to post
Share on other sites

Indeed, this has helped me. I'm not that big into maths, so I've probably never would have figured this out myself the way you described it  wink.gif . But I'm learning as I go. Thanks, man !!!

Share this post


Link to post
Share on other sites

There are more ways to do that (without counting

variables or using init.sqs).

Create a gamelogic - name it how you want -

give it a waypoint (type: AND) - syncronize the

waypoint with all detect-triggers.

Now the gamelogic is waiting at the waypoint, until

all triggers have been activated.

Now there are more ways to continue:

1) use the onactivation field of the waypoint to set a

variable to true, and let the end-trigger wait for that

variable

2) create a 2nd waypoint for the gamelogic, which leads

into the end-trigger area - group the gamelogic with

the trigger and select: activated by gamelogic.

Also i noticed, it's only your unit, which needs to detect

the other 16 units. Why aren't you using the knowsabout

command in only one trigger?

I don't know exactly how the syntax is, but i suppose it should

be:

?(you_soldier knowsAbout enemy_soldier == x)

where x is a value from 1 to 4 this depends on how much the

unit knows about the other one (only hear footsteps, or really

detected type,rank etc..)

You could use 16 of them in only one trigger like:

?(your_s knowsAbout enemy1 == 4) and (your_s knowsAbout enemy2 == 4) and ........

You could save many triggers with that, and you could even

choose, how detailed the detection should be.

As i already said, i'm not sure if the syntax is correct, but you could still look into the official comref for that.

Also just to inform you, the gamelogic's waypoint has another

type (OR), which you could use is you only want one of some

triggers be required.

Share this post


Link to post
Share on other sites

Whoa ... I'm sure with all that information I'll get it to work, one way or another. Thank you, guys !!

Share this post


Link to post
Share on other sites

I'll apologise in advance to my esteemed colleagues, but I think they are WAY over complicating what you have too do here.

I am certain you can do this with one trigger and one simple script.

I have just moved from Australia to the USA, and I've only today gotten back online. Within about 24 hours I will get back to you with a Trigger description and script.

I'm really sure about this, so be patient with me...

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  

×