OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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.
-
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)
-
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.
-
Ah okay thanks... But what if i want them to borad a truck also?
-
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)
-
Just put a getin waypoint on the truck.
-
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
-
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.
-
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)