OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Kneehi on 24 Dec 2011, 19:57:06
-
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: {_x Setbehaviour "safe"} foreach units grp
Where Grp is the name of the group i've chosen...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... :)
-
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
-
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.
-
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: 'wgrp1|#|=group this; ': Error Reserved variable in expression
And the mission starts with no one boarding the Chinooks...
Any clues? :P
-
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.
-
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.. =/
-
You could just put this in the init line of the group leader:
"_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:
eg1 = group this
...in his init box.