Home   Help Search Login Register  

Author Topic: Joining and leving units again and again  (Read 2822 times)

0 Members and 1 Guest are viewing this topic.

Offline GW

  • ofp cadet
  • Members
  • *
  • The great Himalaya
Joining and leving units again and again
« 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:
Be happy.
ofp die-hard fan for whole life

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Joining and leving units again and again
« Reply #1 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
"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 GW

  • ofp cadet
  • Members
  • *
  • The great Himalaya
Re: Joining and leving units again and again
« Reply #2 on: 28 Oct 2012, 04:56:07 »
any demo mission ?
Be happy.
ofp die-hard fan for whole life

Offline GW

  • ofp cadet
  • Members
  • *
  • The great Himalaya
Re: Joining and leving units again and again
« Reply #3 on: 08 Apr 2014, 09:14:58 »
any help for thread question? ::)
Be happy.
ofp die-hard fan for whole life

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Joining and leving units again and again
« Reply #4 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".

Offline GW

  • ofp cadet
  • Members
  • *
  • The great Himalaya
Re: Joining and leving units again and again
« Reply #5 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.

 :(
Be happy.
ofp die-hard fan for whole life

Offline Gruntage

  • Missions Depot
  • Administrator
  • *****
  • How do I get outta this chickensh*t outfit?
Re: Joining and leving units again and again
« Reply #6 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.
"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