OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: BHD Mod on 15 May 2005, 08:04:24

Title: Simple Retreat script
Post by: BHD Mod on 15 May 2005, 08:04:24
Lets say i have a group named grp1. I was wondering if anyone could tell me how to make grp1 run away after they only have 6 units left. I was thinking maybe something where the script counts the units in the group and then it activates a switch trigger to another waypoint? I don't know how to do this though. Thanks!
Title: Re:Simple Retreat script
Post by: THobson on 15 May 2005, 08:09:07
A switch trigger would be okay for this.  You need to give the group a name and then have the trigger fire when the number left alive is < 7.  As follows:

Put this in the init field of one member of the group:

Grp1 = group this

in the condition field of the trigger put:

{alive _x} count units Grp1 < 7
Title: Re:Simple Retreat script
Post by: 456820 on 15 May 2005, 10:48:21
well this is a follow up of Thobsons post.
Then sycronize the trigger to the groups very last waypoint and make sure the trigger is a switch type. That should work
Title: Re:Simple Retreat script
Post by: bdfy1 on 15 May 2005, 12:23:18
How to make units retreat under fire? (http://www.ofpec.com/yabbse/index.php?board=8;action=display;threadid=23191)
I used in a script the following lines
Quote
#povtor
~3
_alive = ("alive _x" count units Gr1) + ("alive _x"  count units Gr2) + ("alive _x" count units Gr3)  
;hint format ["&#1073;&#1086;&#1081;&#1094;&#1086;&#1074; &#1086;&#1089;&#1090;&#1072;&#1083;&#1086;&#1089;&#1100; %1",_alive]
?(_alive <= 25):goto "retreat"
goto "povtor"
Title: Re:Simple Retreat script
Post by: mr reality on 18 May 2005, 20:45:19
@BHD Mod

Did you get this to work....All that happens is the trigger activates  immedeatly  ???. All i need is a condition read %50 group size and i've searched like crazy on here and in the scripts but to no avail  :(.  Please can someone help me because i can't be beaten on this..... >:(