OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: greg147 on 29 Mar 2005, 10:36:50
-
Hi all,
Bit of an easy question here. I have a group of soldiers, one of which is the player. When they enter a trigger, I want the leader to leave the group and follow his waypoints, and the player take over command of the group and follow different waypoints.
Can this be done ???
Exactly like BIS did on the second Red Hammer campaign mission, where you have to capture the towns and airport. In the second town, your leader runs off and you become leader ;)
I tried De-PBOing the mission, but I couldn't make any sense of what I found. :P
-
BIS did it probably with a join and lead waypoint.
-
im not sure but try this
leader_name join null
that should make the leader leave but im not sure if he will follow his waypoints
then for the leader take over there is a script in the beta test part
here it is
http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=22167
made by blanco
-
This is the final version
http://www.ofpec.com/editors/resource_view.php?id=770 (http://www.ofpec.com/editors/resource_view.php?id=770)
Blanco kindly gave me credit for some code I had that avoided a problem with the original.
To get the old leader to follow waypoints he will need to join another exisiting group. If that is not possible give him some doMove instructions instead.
-
The scripts works fine, but when I try to get the leader to leave the group by using 'leader join null', I get an error in game. Is there any other way to do it?
If I give the group a join and lead waypoint, will that just make the leader join the group and his old group continue without him? ???
-
It should be
unitname join grpNull
or
leader groupname join grpNull
leader is a reserved word that returns a value but you have to tell it leader of what. Also it is grpNull not Null
-
[leader groupname] join grpNull
-
I am always forgetting those damn square brakets!!
-
OK, thanks ;D
When I said 'leader', that was the units name ;)
I should have said that before to avoid confussion.
Thanks for the help.
-
Don't name anything with a word that appears in the game as a command or a variable. So don't use "leader" for the name of a unit. OFP will crash, burning the wires in your computer, which will explode the local electricity substation and burn down your house.
-
Probably.
-
;D