OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Storm-Dk on 28 May 2004, 13:26:15

Title: How to make a squard retreat?
Post by: Storm-Dk on 28 May 2004, 13:26:15
Hey guys.

How can i make a squard retreat. I mean. I make the real mission with waypoints and stuff. And lets say.. if the commander is dead and.. there is only 4 or 5 left in the squard.. how can i make them to chance the waypoints to a retreating position and go to a truck?

Hope you can help me

Storm out.
Title: Re:How to make a squard retreat?
Post by: macguba on 28 May 2004, 14:37:03
Two ways (at least) depending on exactly what you want to do.   You could give them an allowFleeing command which would make them run away.  

Alternatively, use a switch trigger to switch them into a new set of waypoints.     This set of waypoints follows the original ones, with the switch trigger synchroed to the last waypoint of the original set.

The condition field of the trigger will be something like this (syntax not guaranteed)

Condition:    (not alive loon1) and (count units grp1 <= 5)
Title: Re:How to make a squard retreat?
Post by: StonedSoldier on 28 May 2004, 14:39:20
ok, sounds straight forward

first in the group leaders init field type grp1 = group this

now lets make a place for them to retreat to with a marker (place the marker where you want the group to retreat to call the maker retreatpos

then just for arguments sake lets say this squad only has 1 WP

make a trigger
Condition : count units grp1 < 5
Activation : [grp1, 1] setWPPos getMarkerPos "retreatpos"

so basically this squad has a move waypoint that they will try to get to but if the squad is reduced to less than 5 men the waypoint will move to the retreat postion

sorry i havent explained myself, im rushing this coz i wanna go home and my brain hurts coz ive just has a computer programming exam.
Title: Re:How to make a squard retreat?
Post by: Storm-Dk on 28 May 2004, 18:16:42
Ah okay thanks... But what if i want them to borad a truck also?
Title: Re:How to make a squard retreat?
Post by: headshot_snipe on 28 May 2004, 21:50:46
i suppose you could have something like:

loon1 assignasdriver truck
loon2 assignascargo truck

or something like that in the trigger activation with a get in waypoint, or you could just make a script

I'm sure you will find enough information in the ed depot to get you started, i seem to remeber a retreat script. just search, there is so much to find...  8)
Title: Re:How to make a squard retreat?
Post by: macguba on 28 May 2004, 23:24:54
Just put a getin waypoint on the truck.
Title: Re:How to make a squard retreat?
Post by: Storm-Dk on 29 May 2004, 13:29:23
I cant just put a waypoint on the truck, because, they allready got the other waypoints, and when they are retreating.. thats not a waypoint.. soo.. well.. i think i got it here.. anyway thanks for the help guys
Title: Re:How to make a squard retreat?
Post by: macguba on 29 May 2004, 15:35:21
Yes you can.   ;)

For example, you could have a waypoint sequence like this.

MOVE
MOVE
SEEK & DESTROY
MOVE
HOLD   <------ synchro your switch trigger with this one
MOVE
GETIN
MOVE
HOLD


If the trigger is never fired the group will move to the first hold waypoint and stop there.    This is your "win" scenario.    If the trigger is fired ("retreat" scenario) the group will jump straight to the first move waypoint after that hold WP, and then continue from there.    
Title: Re: How to make a squard retreat?
Post by: OrnelP on 27 Jun 2006, 04:51:32
I love the forums, i have been looking for this for years, and to think, all i had to do was use the search button.... mmmm Flauta Where is u  8)