OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: crisbal on 11 May 2011, 13:49:38

Title: To add some units to my group
Post by: crisbal on 11 May 2011, 13:49:38
How can I get another group of soldiers to my group when I lost 6 units of my own group of soldiers
unless I have to call on the radio for replacements or support?
Thanks any comments!
Title: Re: To add some units to my group
Post by: Walter_E_Kurtz on 11 May 2011, 20:58:08
If English is not your first language it helps to use more than ONE sentence to explain your request.

Is this to be done via the radio OR should it happen automatically?
Is the other group of soldiers already in the mission near the player OR can they appear by magic?
How many times should this happen?

If you answered 'Radio, Magic, Once', here is (http://www.ofpec.com/forum/index.php?topic=34980.msg242415#msg242415) a fairly simple way.
Title: Re: To add some units to my group
Post by: Aldo15 on 12 May 2011, 03:16:35
I think he's saying about How to add units to his group when he have lost 6 units? I think you should use the count units command, for example.

(count units group1) < 1

Hope it helps

Cheers,
Aldo15
Title: Re: To add some units to my group
Post by: crisbal on 13 May 2011, 16:22:03
Automatically , the group of soldiers are already in the mission, only one time.
Title: Re: To add some units to my group
Post by: Walter_E_Kurtz on 13 May 2011, 17:44:08
In the Init line of the leader of the group of spare troops write
      extratroops = group this

Make sure that the player has a higher rank than any of the spare troops.

For the following I assume you want reinforcements when you have no soldiers left alive under the player's command. If that's not the case you can raise the number, but remember that there can be no more than 12 in a group.

Create a trigger and enter as the condition
      (count units player) < 2
and for the On Activation line
      {[_x] join player} forEach units extratroops

As written above, the trigger will happen when all the soldiers have been reported killed (someone says "Oh no. x is down.") and they get removed from the Command bar at the bottom of the screen.
Title: Re: To add some units to my group
Post by: crisbal on 13 May 2011, 17:57:38
Exactly it's what I need, thank's!  :good:  :clap: