OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: GW on 26 Oct 2012, 07:57:32

Title: Joining and leving units again and again
Post by: GW on 26 Oct 2012, 07:57:32
i am making a mission,

in mission there are three squads,how can i join and leave them again and again. :scratch:
Title: Re: Joining and leving units again and again
Post by: Gruntage on 26 Oct 2012, 09:40:36
Do you mean that you want the player to leave and join groups at anytime?

Well, to leave a group, you use

Code: [Select]
[player] join grpNull
So, to join a group again afterwards you should be able to just:

Code: [Select]
[player] join _leader
_leader is a local variable which is the group leader of the group you want to join.

Make sure _leader is defined as:

Code: [Select]
_leader = (leader groupname)
I'm not near a computer with CWA on right now, otherwise I would check. Hopefully this'll work

Regards,
Gruntage
Title: Re: Joining and leving units again and again
Post by: GW on 28 Oct 2012, 04:56:07
any demo mission ?
Title: Re: Joining and leving units again and again
Post by: GW on 08 Apr 2014, 09:14:58
any help for thread question? ::)
Title: Re: Joining and leving units again and again
Post by: savedbygrace on 09 Apr 2014, 03:17:13
What sort of help? He answered your first question a year and half ago. You want to join a group? Make sure you have named that group in it's leaders init field.
Code: [Select]
Alpha = group this
Then when you need the player or any unit to join that group, just place in a trigger or script
Code: [Select]
Player join Alpha or
Code: [Select]
CustomNamedUnit join Alpha
To remove the player or unit from his current group place this in a trigger or script
Code: [Select]
player join GrpNull or
Code: [Select]
CustomNamedUnit join GrpNull
You could also do this using waypoint orders such as "Join" or "Join and Lead".
Title: Re: Joining and leving units again and again
Post by: GW on 29 Apr 2014, 09:03:01
actually i have 3 groups of 10 soldiers,want to lead them  and  stop enemies on three fronts.

 :(
Title: Re: Joining and leving units again and again
Post by: Gruntage on 29 Apr 2014, 22:09:04
So you want to be able to control 3 groups?

That would require a command interface of some kind, either a dialog or simply using the radio (0-0-?).

If you wanted to move a group to a location on the map, you could use 'onmapsingleclick' (see COMREF).

Another thing you could do is have a repeating radio trigger that moves a group to the location of the player at any time.

Or are you saying that you want to join each group successively? It would easier to move troops using the radio trigger solution.