Home   Help Search Login Register  

Author Topic: Chopper circling around his waypoint?  (Read 778 times)

0 Members and 1 Guest are viewing this topic.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Chopper circling around his waypoint?
« on: 21 Mar 2004, 21:17:30 »
Hello, my name is Artak and I'll be your n00b today.

I have two choppers in a mission where the island of Nogova is devided in two parts by the river. East and West side. the West side has a UH60 and the East side a Mi17 flying around on their areas.

Have you ever had a chopper 'miss his waypoint and start circling around it like crazy trying to hit the exact spot'? I have. I don't know wtf is going on when the chopper starts doing a tiny little circle in the sky, but it looks like a dog chasing his own tail.

I was thinking that the chopper misses it's waypoint and turns back and tries desperately to hit it. So I made a little script to solve it:

Code: [Select]
#loop

mi17gl setpos [1755.46,11097.74,100]
mi17 move [1755.46,11097.74,100]
@ mi17 distance mi17gl < (random 200)+300 || (!alive mi17)
?!alive mi17: exit
mi17gl setpos [5551.70,9335.96,100]
mi17 move [5551.70,9335.96,100]
@ mi17 distance mi17gl < (random 200)+300 || (!alive mi17)
?!alive mi17: exit
mi17gl setpos [7822.41,3811.23,100]
mi17 move [7822.41,3811.23,100]
@ mi17 distance mi17gl < (random 200)+300 || (!alive mi17)
?!alive mi17: exit
mi17gl setpos [2476.50,3686.79,100]
mi17 move [2476.50,3686.79,100]
@ mi17 distance mi17gl < (random 200)+300 || (!alive mi17)
?!alive mi17: exit
mi17gl setpos [6661.61,6786.15,100]
mi17 move [6661.61,6786.15,100]
@ mi17 distance mi17gl < (random 200)+300 || (!alive mi17)
?!alive mi17: exit
mi17gl setpos [2163.83,7279.56,100]
mi17 move [2163.83,7279.56,100]
@ mi17 distance mi17gl < (random 200)+300 || (!alive mi17)
?!alive mi17: exit
goto "loop"

However, the script solved nothing. The chopper still sometimes just stops at one point and starts chasing his tail.

The choppers are in captive mode with careless behaviour and full skill. they fly in 130 meters and with full speed.

Has anyone ever experienced anything like this?

[edit]
Oh and btw I'm moving a civilian plane with a similar script and the plane doesn't start spinning around at one spot.
« Last Edit: 21 Mar 2004, 21:45:06 by Artak »
Not all is lost.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Chopper circling around his waypoint?
« Reply #1 on: 22 Mar 2004, 00:18:51 »
lo Artak,

have you tried moving the waypoint yet?

I mean: maybe the waypoint is placed onto an object on
the map, and the chopper is trying to reach that object, but
upon flyingheight it just cannot.

Anyway, i asume you've already tried changing the waypoint's
location, so this might not solve your prob.

What else could you try?

hmm - what about a waypoint: scripted

Just give the chopper a waypoint scripted, and enter the name
of the script to be executed into the field: scripted (at the bottom
of the waypoint's options menu).

let's say: heli_script.sqs

You can't pass parameters with this script, but it automatically
passes a few little info's to the script:

_this select 0    .....  owner of the waypoint - unit/group which
owns the waypoint.

_this select 1    ...... location of the waypoint - position array, like
you get returned by getpos object

_this select 2    ...... target of the waypoint - may be object or unit, where the waypoint is placed onto


Now the script will be executed, once the waypoint before wp type scripted has been passed. The unit/group will not advance to waypoint scripted, and will follow only the orders of the script,
for the time the script is running. Once the script exits, the next waypoint after wp scripted becomes active.

Now your script could look at the beginning like that:

;<<heli_script.sqs>>

_group = _this select 0
_leader = leader _group
_chopper = vehicle _leader
_pilot = driver _chopper
_height = (getpos _chopper select 2)
_pos = _this select 1

;now you have all units, you will need for the script

:note - _pos and _height are useful imho, as you can use them
to store the original flyingheight and as a reference point on the
map.

hope this helps

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Drwyd

  • Guest
Re:Chopper circling around his waypoint?
« Reply #2 on: 22 Mar 2004, 01:42:49 »
I've had this problem after changing the flyinheight via a script, I solved it by setting flyinheight to 100m or less (also via script). A workaround might be to make the waypoint a "switch" type and use a trigger grouped to the helo.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Chopper circling around his waypoint?
« Reply #3 on: 22 Mar 2004, 17:01:35 »
Thanks a lot Chris, you're most helpful as always. I did try the things you first mentioned earlier, they solved nothing. Also I tried the script wp thingy and no score.

Drwyd hit on the nail here. I set the chopper to fly in 90 meters instead of the 130 I had, then followed the chopper for an hour with a cam script and yes, the chopper didn't get stuck anymore  :o
What can we make of this? Yet another bug in the chopper AI.. I remember one of the 1.9x updates was said to improve chopper AI behaviour.. seems they've missed this one :P

I asked about this in irc (#ofpec and #ofptf) and actually quite a few people recognized the bug when I described it. Outtis actually suggested me the same as Drwyd here.

I noticed that the place where the chopper usually got stuck was near Mokropsy, when it flew over the big mountais to the valley; that's when it had the most height and the waypoint was then right 'under' him.


But as said, the problem got solved by setting the height at 90 meters.. and even the paratroopers survive from that altitude, so everything's fine now.

Thanks guys  :-*
Not all is lost.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Chopper stopping mysteriously
« Reply #4 on: 17 Sep 2004, 12:21:14 »
A long time has passed and I've been building some other stuff in the mission. Now the mission has started it's beta testing run and I see the choppers acting very weird again.

They don't start spinning around the same spot anymore, but rather hover still. The problem doesn't exist in editor, but only when the mission is tested in MP environment. I've even removed the random values in the script, but no cigar.

The choppers always fly once around the island and then just stop to hover, always at the same spot. Why?

[edit]
Indeed I believe it's a MP problem, so if a moderator spots this, he could kindly move the thread to the MP board  :)
« Last Edit: 17 Sep 2004, 15:35:12 by Artak »
Not all is lost.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Chopper circling around his waypoint?
« Reply #5 on: 17 Sep 2004, 21:09:48 »
Alright, I started to solve the dilemma saying "choppers are dumb" to myself and build another script that checks more than just the distance to move target gl.

Code: [Select]
_unit = mi17
_gl = mi17gl
_coords = [[1755.46,11097.74,100],[5551.70,9335.96,100],[7822.41,3811.23,100],[2476.50,3686.79,100],[6661.61,6786.15,100],[2163.83,7279.56,100]]
_max = count _coords
_selector = 0

#start
_pos = _coords select _selector
_selector = _selector +1
?_selector == _max: _selector = 0
_gl setpos _pos
_unit move _pos
~20

#checkloop
~2
?_unit distance _gl < 500 || speed _unit < 4 || unitready _unit: goto "start"
?!alive _unit:exit
goto "checkloop"

The above works in MP and the sweetest thing is that I can even start flying the choppers at 120 meters again. I'm happy now.  :)
Not all is lost.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Chopper circling around his waypoint?
« Reply #6 on: 17 Sep 2004, 22:08:51 »
About as much as I have learned about choppers:

- Sometimes they will hang around at a waypoint - but eventually they move on
- Sometimes they circle a waypoint - but eventually they get there
- They cannot be relied on to fly straight between waypoints, the route they take seems to be chosen to minimise the altitude of the land they are flying over.
- If they are told to land on a H that is not on flat ground, and they can see flat ground miles away - that is where they land
- when told to land they will often overshoot, if they are told to land or even just descend, in front of rising ground they will fly into the ground.

I am impressed that you seem to have dealt with it.  My solution was to change my mission to fit them and to build the random crashes into the story

DiFool

  • Guest
Re:Chopper circling around his waypoint?
« Reply #7 on: 20 Sep 2004, 11:34:02 »
Change size of the Waypoint?

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Chopper circling around his waypoint?
« Reply #8 on: 20 Sep 2004, 11:40:22 »
I believe that is not possible.  Increasing the radius of a waypoint just increase the area in which the the mission will randomly place the waypoint.  It will not increase the size of the waypoit itself.
« Last Edit: 20 Sep 2004, 11:40:41 by THobson »