Home   Help Search Login Register  

Author Topic: How to set behaviour of whole groups using triggers?  (Read 1482 times)

0 Members and 1 Guest are viewing this topic.

Offline Kneehi

  • Members
  • *
Hi guys!
I've been trying to do this for a while now, with no succeed... :confused:
What I'm trying to do is:
I have a group that is moving between two waypoints. Between those waypoints i inserted a Trigger(in the place that i want the action to happen), with this written on the activation field:
Quote
{_x Setbehaviour "safe"} foreach units grp
Where Grp is the name of the group i've chosen...
Quote
In the leader's init field i've written: Grp=group this
Then i grouped the trigger with the group.
The problem is: When they enter the trigger area, only the group leader changes its behaviour, and the other group members also stop following the leader!
Please, any ideas? :P (I really need this to be done with a trigger/script.. Can't be done with a waypoint..)

BY THE WAY, MERRY CHRISTMAS!!! :)  :D

Thanks... :)
« Last Edit: 29 Dec 2011, 09:54:56 by bedges »
War ain't fair.

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: How to set behaviour of whole groups using triggers?
« Reply #1 on: 25 Dec 2011, 00:19:43 »
Hmm have you tried changing the group name?

I tried the exact same thing as you did with 'wgrp1' as the group name and it worked; all of the units of that group switched their behaviour to 'safe'.

It's possible that the game may interpret 'grp' as part of a command, namely GrpNull. If this is the case, then it would explain why the party members stop following the leader.

Hope this helps

Gruntage
"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: How to set behaviour of whole groups using triggers?
« Reply #2 on: 26 Dec 2011, 20:35:40 »
Double check your syntax, because I duplicated your scenario as you explained it and it worked fine for me. The spelling is not case sensitive either.

Offline Kneehi

  • Members
  • *
Re: How to set behaviour of whole groups using triggers?
« Reply #3 on: 26 Dec 2011, 22:41:44 »
Gruntage, thanks bro, that worked.. Can't believe it was that obvious..  :cool2: Hahaha

savedbygrace, that's wierd, i just Ctrl+C Ctrl+V from my editor... Can't be a syntax error... But nevermind, the problem is solved...

Cheers! :)
---------------------------------------------------------------------------------------------------------------------------
Damn, now i got another wierd issue...

First i'll have to give you guys a context of the mission...
It is basically this: At the start, I got loads of soldiers boarding two Chinooks, then they para-jump in a certain area, than proceed between cities to kill the enemy.
The point is: Before i added the triggers to change the groups behaviour, everything was ok, but after i inserted them, the problem showed up!
I tested the trigger system sepparatedly from my mission, and it worked ok... But when i do the same damn thing in my mission, i get this:
Quote
'wgrp1|#|=group this; ': Error Reserved variable in expression
And the mission starts with no one boarding the Chinooks...

Any clues? :P
« Last Edit: 27 Dec 2011, 00:30:20 by Kneehi »
War ain't fair.

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: How to set behaviour of whole groups using triggers?
« Reply #4 on: 29 Dec 2011, 02:01:06 »
Seems like your using wgrp1 as a variable twice. Once as a group name and again as a unit name. Check all of your unit and group names.

Offline Kneehi

  • Members
  • *
Re: How to set behaviour of whole groups using triggers?
« Reply #5 on: 29 Dec 2011, 03:50:29 »
No, i'm sure i'm not.... I think it's something related with the moveincargo command I'm use in the init.sqs to start the mission with the soldiers already boarding the chinooks.. =/
War ain't fair.

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: How to set behaviour of whole groups using triggers?
« Reply #6 on: 29 Dec 2011, 09:50:18 »
You could just put this in the init line of the group leader:

Code: [Select]
"_x moveincargo chinook1" foreach units group this
So you don't have to use an init.sqs to move everyone inside vehicles.

I've had that error before now and it was because I had 'eg1' in the group leader's name box and:

Code: [Select]
eg1 = group this
...in his init box.

"But one thing I can tell you from not just OFP but life in general:  criticism is directly proportional to quality. The more criticism a mission receives, the better the outcome" - macguba