Home   Help Search Login Register  

Author Topic: to heck with waypoints... I'm going over there...  (Read 1367 times)

0 Members and 1 Guest are viewing this topic.

Offline ONoSixIsDown

  • Members
  • *
to heck with waypoints... I'm going over there...
« on: 10 Jun 2007, 07:15:59 »
ahh loons... how i hate them.  the main reason being...

   I'm currently trying to finish my first official mission and all that is really standing before me is the AI of a certain loons group leader who utterly refuses to follow waypoints.  At first i thought rationally about it and assumed that it was tanks in the distance turning this AI infantry leader into a coward, causing him to hide in trees untill he forgot about the enemy tank.  So I removed the tanks that were seemingly causing him to abandone his waypoint path with no apparent fix to the problem.  Once the tanks were gone he now heads off to a point no way near his waypoints.  Eventually, he will arrive at his waypoint but that can be a real show stopper waiting for a loon to walk/run 500m+ to where he is supposed to be with other AI loon squads waiting on him due to some syncronized waypoints. 
 
   what i need is a method to ensure he'll travel his waypoint route without deviating too far. causing the player to take a walk to the store while he waits for the AI loon to catch up.  What i don't want, is him running in a straight line along those waypoints completely devoid of common sence. (still react to contact with the enemy as normal)

   I've tried adding more waypoints to his path and even removing a few and tinkering with the "behaviour" settings.  I'm reluctant to use anything along the lines of
Code: [Select]
CO doMove GetMarkerPos "COwp1" out of fear that he'll just run along them like a lemming without a care and getting blown away without any reaction. though my knowledge of what to expect out of scripts is limited at best.

Any insight would be greatly appreciated and will find you a place in the credits when i'm done.  (big woop, right  ;) ? ) thanks in advance.
« Last Edit: 10 Jun 2007, 07:20:00 by OhNoSixIsDown »
CRIMSON REIGN COMMING..... eventually :/

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: to heck with waypoints... I'm going over there...
« Reply #1 on: 10 Jun 2007, 11:20:22 »
First of all, each unit has a particular behaviour, Careless, Safe, Aware etc.  Whatever behaviour is set will remain until re-set in some way.  This can happen automatically when a unit on Safe sees some enemy it will go to Aware or Combat for a while until the danger has gone.  So giving a unit a doMove instruction does not turn him into a moron, he will move to the location using the behaviour that has already been set for him.  You can setBehaviour in the init field.  All units in an AI group will take the same behaviour as the leader so you only need set it in the leader's init field.

Waypoints can get confused,  Try moving a few about a bit, or even deleteing and re-inserting them.  Nearby enemy tanks will cause a change in behaviour, especially if there are no AT infantry around they can all become cowards.  Also steep hills can cause units to take detours.

If playing around with the waypoints doesn't solve the problem I have used scripts to do what I want in the past.  Try something like:

_i = 0
#loop1
CO doMove getPos No2
#loop2
_ i = _i + 1
~5
if (CO distance No2 < 5) then {goto"gotthere"}
if (_i % 6 > 0) then {goto"loop2"}
goto"loop1"
#gotthere
Put here whatever it is you want to have happen when he gets close to No2

Syntax not guaranteed.
CO is the unit you are moving and No2 is the unit or object that you want to move him to.

Note I find it helpful to repeat the doMove instruction every 30 seconds or so as shown here.

« Last Edit: 10 Jun 2007, 11:43:50 by THobson »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re: to heck with waypoints... I'm going over there...
« Reply #2 on: 13 Jun 2007, 19:51:54 »
It can take some experiments to get waypoints right.   In general, fewer is better.  Moving their position a few metres can make an astonishing difference to the group's movements.   Moving static objects can do (although that mostly applies to vehicle groups and objects near roads.)

Play as a group member and think carefully about what the group leader is doing.  Sometimes, what at first appears really dumb annoying behaviour is in fact really smart tactical behaviour.  Don't ask your group to do something dumb, they might not do it.
Plenty of reviewed ArmA missions for you to play

Offline Surdus Priest

  • Members
  • *
  • Only I can Forgive You!
Re: to heck with waypoints... I'm going over there...
« Reply #3 on: 17 Jun 2007, 16:38:55 »
its often best to avoid giving AI complicated waypoints.  you can try this however:

#loop
co setbehaviour "safe"
goto "loop"

lol, when you activate this in a seperate script, that group might be continually be in safe mode.  i havent tested it though.  make sure your not in that group though or u might get constant orders to be at ease.
Campaigns are hard, I'll stick with scripting for now!

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: to heck with waypoints... I'm going over there...
« Reply #4 on: 21 Jun 2007, 02:29:10 »
I know I'm still a noob with such things but I didn't see it mentioned. How about the code .....unit allowfleeing 0......?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: to heck with waypoints... I'm going over there...
« Reply #5 on: 21 Jun 2007, 12:20:31 »
that will indeed cut down on the methods by which loons can frustrate your editing efforts, but by the sounds of it your loon's not fleeing, rather taking the scenic route. i'd go with thobson's method of giving move commands every 10 seconds or so. you could script something which defines a straight-line 'corridor' between points, and if the loon strays outside it you nudge him...

i dunno. there was a time when i hated loons due to this very sort of behaviour. lately though, i've come to realise that they are intelligent entities, trapped within a perpetual battlefield... i'm not sure anyone can blame them for occasionally going walkabout.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: to heck with waypoints... I'm going over there...
« Reply #6 on: 21 Jun 2007, 18:44:39 »
Sometimes if the waypoints are spaced too far apart the loons get confused. I have seen this many many times with loons and vehicles.
urp!