Home   Help Search Login Register  

Author Topic: Leader leave group.  (Read 614 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Leader leave group.
« 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
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Blanco

  • Former Staff
  • ****
Re:Leader leave group.
« Reply #1 on: 29 Mar 2005, 10:57:27 »
BIS did it probably with a join and lead waypoint.
« Last Edit: 29 Mar 2005, 10:57:38 by Blanco »
Search or search or search before you ask.

Offline 456820

  • Contributing Member
  • **
Re:Leader leave group.
« Reply #2 on: 29 Mar 2005, 11:01:51 »
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

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Leader leave group.
« Reply #3 on: 29 Mar 2005, 11:19:03 »
This is the final version

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.
« Last Edit: 29 Mar 2005, 11:29:50 by THobson »

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Leader leave group.
« Reply #4 on: 29 Mar 2005, 14:04:26 »
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?  ???
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Leader leave group.
« Reply #5 on: 29 Mar 2005, 14:15:07 »
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

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Leader leave group.
« Reply #6 on: 29 Mar 2005, 14:26:33 »
[leader groupname] join grpNull
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Leader leave group.
« Reply #7 on: 29 Mar 2005, 15:22:25 »
I am always forgetting those damn square brakets!!

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Leader leave group.
« Reply #8 on: 29 Mar 2005, 19:45:45 »
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.
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Leader leave group.
« Reply #9 on: 29 Mar 2005, 21:14:20 »
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.  
Plenty of reviewed ArmA missions for you to play

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Leader leave group.
« Reply #10 on: 29 Mar 2005, 21:16:47 »
Probably.
Plenty of reviewed ArmA missions for you to play

Offline Blanco

  • Former Staff
  • ****
Re:Leader leave group.
« Reply #11 on: 29 Mar 2005, 21:17:44 »
 ;D
Search or search or search before you ask.