Home   Help Search Login Register  

Author Topic: Trigger Q  (Read 1876 times)

0 Members and 1 Guest are viewing this topic.

B-2-0

  • Guest
Trigger Q
« on: 26 Aug 2003, 07:02:55 »
I have a trigger i want to be only activated when all alive units are inside....thing is, there are 4 groups so i can't use the 'All members of group' option for the trigger.

How do i go about doing this?  Bearing in mind that if one of the groups is wiped out i still need the trigger to be activated when the remaining 3 groups are in the area.

Komuna

  • Guest
Re:Trigger Q
« Reply #1 on: 26 Aug 2003, 11:47:45 »
- Activated by the groups' side or "anybody".

- Add a condition which counts every unit in the trigger list and checks if it satisfies each group units count:

({_x in thislist} count units group1 == count units group1);
//Notice that dead units will be automatically skipped by the 'count' function.

Do the same for every group in the same trigger CondField.

B-2-0

  • Guest
Re:Trigger Q
« Reply #2 on: 26 Aug 2003, 13:01:04 »
Thanx for your reply Komuna!

So what u are saying is, i need just the one trigger with that code in the condition field once for each group (with the group names changed obviously), right?

Will this still activate the trigger if one of the groups is wiped out?

Komuna

  • Guest
Re:Trigger Q
« Reply #3 on: 26 Aug 2003, 13:21:59 »
Of course. If the 'count' still works as usual, it will count alive units (in alternative add this: "Alive _x" count units groupN), which means that if "count units in thislist" == "count alive units" : 0==0;

Understood? It may look weird through my explanation, but I'm sure you won't have any probs... ;)

B-2-0

  • Guest
Re:Trigger Q
« Reply #4 on: 26 Aug 2003, 14:57:40 »
Ok, i am getting an error with this syntax 'Type bool, expected nothing'

({_x in thislist} count units Ranger_A == count units Ranger_A);# <--(error)
({_x in thislist} count units Ranger_B == count units Ranger_B);
({_x in thislist} count units Delta_A == count units Delta_A);
({_x in thislist} count units Delta_B == count units Delta_B);

I have put them on seperate lines just for ease of viewing

Putin

  • Guest
Re:Trigger Q
« Reply #5 on: 26 Aug 2003, 15:22:28 »
Or you could try somethin else.
Create 4 Triggers ( for the 4 groups), make them all the same radius.
Now you link every trigger to one group, and in the activation field of the triggers, you use:

Trigger 1: wp1=1
Trigger 2: wp2=2
Trigger 3: wp3=3
Trigger 4: wp4=4

Now create another trigger, and in its condition fiel you write :

wp1==1 and wp2==2 and wp3==3 and wp4==4

Thats how I always do it.

B-2-0

  • Guest
Re:Trigger Q
« Reply #6 on: 26 Aug 2003, 15:36:07 »
Yeah, but what if one of the groups has been blown away by a herd of rampaging T-80's?  The trigger that coresponds to that group will remain false.

B-2-0

  • Guest
Re:Trigger Q
« Reply #7 on: 26 Aug 2003, 15:44:45 »
Although, if i did it that way, could i have a trigger that detects if a squad is wiped out and if so, sets the corresponding trigger to true?  Hmm..

Komuna

  • Guest
Re:Trigger Q
« Reply #8 on: 26 Aug 2003, 15:56:27 »
Hey, I sent you a message. Test the code and tell us something.

Putin

  • Guest
Re:Trigger Q
« Reply #9 on: 26 Aug 2003, 16:05:39 »
If you create a trigger for each group, where it says for example : "when whole team not present"

on activation wp1=1


That would then be 9 triggers in the whole.


Komuna

  • Guest
Re:Trigger Q
« Reply #10 on: 26 Aug 2003, 16:16:20 »
GEEZZZZZ B-2-0!!! I received you message! Of course my syntax is WRONG!!!!

("_x in thislist" count units group Delta1 == "alive _x" count units group Delta1) && ("_x in thislist" count units group Delta2 == "alive _x" count units group Delta2) && ...

&& || - and or repectively

ITS A CONDITION, not a command chain.

Now your prob is surely solved. Excuse my deadly mistakes!!! ::)  :-[
« Last Edit: 26 Aug 2003, 16:18:03 by Komuna »

B-2-0

  • Guest
Re:Trigger Q
« Reply #11 on: 26 Aug 2003, 16:23:30 »
He he...most excellent!!  Works fine now m8 ;D

Thanx...definitley a 2 thumbs up  :thumbsup: :thumbsup:

[Edit] Oh yeah, i spotted that u left a 1 instead of putting the 2 in there ;)
« Last Edit: 26 Aug 2003, 16:24:51 by B-2-0 »

B-2-0

  • Guest
Re:Trigger Q
« Reply #12 on: 26 Aug 2003, 17:43:52 »
Ummm....this still aint right...lol

It worked fine on the small test situation i made with 2 squads but when i preview it in the main mission i am getting an error across the top of the screen....

("_x in thislist" count units group Delta_A ==# "alive _x" count units group Delta_A) &&
("_x in thislist" count units group Delta_B == "alive _x" count units group Delta_B) &&
("_x in thislist" count units group Ranger_A == "alive _x" count units group Ranger_A) &&
("_x in thislist" count units group Ranger_B == "alive _x" count units group Ranger_B)

See it?  After the ==......thing is, i can't read the actual error coz the code is too long (or is there a way to scroll through it?)
« Last Edit: 26 Aug 2003, 17:45:24 by B-2-0 »

Komuna

  • Guest
Re:Trigger Q
« Reply #13 on: 26 Aug 2003, 17:49:16 »
What's Ranger_A and so on? Aren't they already groups, as you posted just a few posts before?

Then you won't need to use the 'group' command!!! The 'group' command returns the group (var) in which a certain unit is.

The command 'units' only makes a 'group into an array

Therefore:

... count units Delta_A ...
« Last Edit: 26 Aug 2003, 17:50:42 by Komuna »

B-2-0

  • Guest
Re:Trigger Q
« Reply #14 on: 26 Aug 2003, 17:54:21 »
Those are the 4 squad names.......btw, i am totally lost now u are talking about arrays and variables ???

Could u correct my syntax pls? ;D :cheers: