Home   Help Search Login Register  

Author Topic: Retreating...  (Read 638 times)

0 Members and 1 Guest are viewing this topic.

joe_mamma518

  • Guest
Retreating...
« on: 18 Jul 2003, 01:44:14 »
Okay there is probabily a really simple answer to this but hey, im an idiot.....  So anyways I have 3 groups of 10 men all controlled by AI defending an area.  Now when they get attacked and lose 2/3 of their men and only 10 or less are left in total from all the groups (say 5 from 1 group 3 from another and 2 from another) i want then to all get up an run back to defend another position.  Heres the thing, the second position has 2 groups in it already.  Now i want the same thing to happen in this place where when 10 or less men are left they retreat to the last postion where they hold it to the last man.  I really dont know anything on how to make the AI retreat when they are all in different groups so if u can help me remember..... im an idiot.... use small words that i can understand and try to be specific. lol

Rubble_Maker

  • Guest
Re:Retreating...
« Reply #1 on: 18 Jul 2003, 10:51:32 »
Well I think you must either script this, or use waypoints and triggers to get it to work. There IS a way to make AI retreat automatically, i.e.

soldierOne allowFleeing 1

will work, but they will run in some non-specific direction, and not where you want them, so you need to throw in some waypoints or even script this stuff.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Retreating...
« Reply #2 on: 18 Jul 2003, 11:11:11 »
This is a job for switch triggers.

For each group, create waypoints for what you want them to do.    Basically that will mean a hold waypoint at each defensive postition.

Now, for each defensive position create a trigger, make it type switch, and synchro it with all the hold waypoints in that position.       Make the size of the trigger cover the postition and set to East present (or whatever your defending loons are).

In the On Activation field of the trigger write the conditions that you want.    It might look something like this

count units thislist < 10

or this

(count units grp1 < 5) and (count units grp2 < 5) and (count units grp3 < 5)

Syntax not guaranteed.

In the init field of the group leader for each group write

"_x allowfleeing 0" forEach units group this

which will prevent them from running away when you don't want them to.    Alternatively, don't bother ..... they may then flee when you don't want them to, but that will make the whole thing more unpredictable and realisitic.     There is also a good chance they will run towards their next waypoint, if there have been no enemy in the that direction.     They are more likely to run that way if they know that there are friendlies there and if that is where they started from.   In other words, if there is time in the mission, insert these loons near the final postition and get them to move through the other positions until they get to their own place.     Loons tend to run away towards where they came from, as long as its safe.   The will also rally after a while.

I would suggest that, when some of these groups get down to 2 or 3 loons, you join them together.    Small groups of AI are not very good.     Use the command join in a trigger activated with the count command like the ones above.
Plenty of reviewed ArmA missions for you to play

joe_mamma518

  • Guest
Re:Retreating...
« Reply #3 on: 18 Jul 2003, 20:16:05 »
Ok now i did exactly what u said but when I try the mission i get this:

'count units thislist <|#| 10': Error units: Type Array, expected Object,group

Now this really doesnt mean much to me so can anyone plz tell me how i can fix this.  Also i tried your other way but it didnt work either........ I looked up all the differnt count things in the command reference but none of them sound like they would work even if I could figure out how to work them.  All that i need is a way to make people from different groups retreat simultaneously to another position.  Also if i could figure out that I would be able to send in reinforecements automatically when a certain number of men have died.

max_killer_payne

  • Guest
Re:Retreating...
« Reply #4 on: 18 Jul 2003, 20:28:59 »
Maybe you could use a script and put something like this in. Plz note I havent tried this yet so it may not work:

?(soldiername fleeing 1 < soldiername): goto "flee"

#flee
soldiername domove getpos place

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Retreating...
« Reply #5 on: 18 Jul 2003, 20:52:07 »
@ macca

u can do

Quote
count units thislist < 10

but u can do

count thislist ;)

:P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Retreating...
« Reply #6 on: 18 Jul 2003, 20:55:26 »
whoa whoa whoa

All that's happened is  that you have received a simple error message.  

Quote
'count units thislist <|#| 10': Error units: Type Array, expected Object,group

The # is there to try and give an indication of where the problem lies.    The text at the end is often - as in this case - very helpful in telling you what the problem is.    What's happened here is that the game was expecting an object or group, and instead it's been given an array.    It doesn't know what to do so the error message appears.

If you read my post carefully you will find

Quote
Syntax not guaranteed.

which I always put in because syntax is not my strong point.    

Well done for having a go at the command ref and trying to figure out what's going wrong.    I've had a look myself and rediscovered that count takes an array ... thislist is an array so try

count thislist < 10

and see if that works.    

The important thing is that switch triggers and the count command are the solution to your problem.   Once you understand both of those you're home and dry.     The same "toolbox" will allow you to send in reinforcements as well.


Edit:  Ah, I see LCD is clearing up my syntax errors as fast as I can make them.  ;D
« Last Edit: 18 Jul 2003, 20:56:34 by macguba »
Plenty of reviewed ArmA missions for you to play

joe_mamma518

  • Guest
Re:Retreating...
« Reply #7 on: 19 Jul 2003, 01:06:26 »
IT WORKED!!!!!

Thanks man your my hero, i have been trying to make people retreat and send in reinforcements for about a month now.  This is sweet i can do so much more now........