OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ryankaplan on 04 Mar 2005, 13:20:35
-
i was wondering if there was a command to make a leader of a squad order all his soldiers to "take cover" (sort of like the command 1,8)? the player is not in the squad which is going to take cover so i just need a squad of ai to hide in a city (i know they aren't all that good at hiding but it'll do)
thanks in advance
-
hey ryan, in a city you could use something like
{_x domove (buildingPos [nearestbuilding _x, 1])} foreach arrayofmen
thatll make them move to the nearest building and move to position #1 of that building
-
Or set them in stealth and they should crawl off to nearby cover of their own choosing:
{_x SetBehaviour "STEALTH"} foreach arrayofmen
Try it and see...
nb. might work by group or Leader group as well - check the comref.
Or: mygroup SetBehaviour "STEALTH"
-
I have a feeling that if you set the behaviour of a group leader the rest of the group do the same thing.
-
group setBehaviour behaviour
Operand types:
group: Object or Group
behaviour: String
Type of returned value:
Nothing
Description:
Set group behaviour mode. Behaviour is one of: "CARELESS", "SAFE", "AWARE", "COMBAT", "STEALTH".
Example:
groupOne setBehaviour "SAFE"
I do miss the comref on my recently-reloaded work PC...
-
But Stealth is not the same as take cover. The menu option you get as a group leader to get your loons to take cover causes them to hide. Stealth does something different. This does seem to be a lack in the setBehaviour options
-
Yes - hide/take cover might be a compound action of several commands; or one of those engine functions that hasn't been given a command (oh, to be able to script-switch waypoints). There's quite probably a link to a nearestobject function as I have witnessed the behaviour of a group that will either crawl forward to cover or stay in formation in the open depending on the placement of the waypoint a couple of yards one way or the other.
But I also suspect that STEALTH behaviour frigs the detectability of said stealthy units to compensate for limitations of the terrain modelling and the AI?
-
There's quite probably a link to a nearestobject function
I suspect you are right. I don't really know.
I just know that as a group leader if I give them the command Danger (ie Stealth) they behave one way if I tell them to take cover they behave another (and the they also have Hide written above them.