Home   Help Search Login Register  

Author Topic: AI man unable to board Mi17; bug?  (Read 2240 times)

0 Members and 1 Guest are viewing this topic.

Offline Ranger

  • Members
  • *
  • Hoo-ah!
AI man unable to board Mi17; bug?
« on: 10 Jul 2007, 19:37:40 »
I have an officer (o1) who is given a waypoint to move to an Mi17 (mi17_1), then is ordered to board the Mi17, all via a script.  However, the officer simply walks over to the Mi17 and does nothing.  In fact, he walks *through* the Mi17 and stands right in the middle of it, clipping through it.

The relevant code is as follows:

Code: [Select]
_wp = (group o1) addWaypoint [getPos mi17_1, 0]
_wp setWaypointType "MOVE"

#Loop
~4
? mi17_1 distance o1 < 50 : goto "Board"
goto "Loop"

#Board
o1 assignAsCargo mi17_1
[o1] orderGetIn true

Am I doing something wrong, or is this a bug?

If it makes a difference, prior to the officer attempting to board the Mi17, he rides in a UAZ from one town to the airfield where the Mi17 is, then is ordered to get out, then the above code is executed.
Ranger

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: AI man unable to board Mi17; bug?
« Reply #1 on: 10 Jul 2007, 20:33:38 »
Try this:

Code: [Select]
_dir = getDir mi17_1
_pos = [(getPos mi17_1 select 0)+sin(_dir - 90)*15,(getPos mi17_1 select 1)+cos(_dir - 90)*15, 0]
_wp = (group o1) addWaypoint [_pos, 0]
_wp setWaypointType "MOVE"

#Loop
~4
? ((mi17_1 distance o1) < 20) && (unitReady o1): goto "Board"
goto "Loop"

#Board
o1 assignAsCargo mi17_1
[o1] orderGetIn true

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re: AI man unable to board Mi17; bug?
« Reply #2 on: 10 Jul 2007, 20:41:54 »
Thank you, Mandoble.  I'll give that a try later when I'm home and see if it helps. :)
Ranger

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re: AI man unable to board Mi17; bug?
« Reply #3 on: 11 Jul 2007, 09:40:45 »
Mandoble,

I tried out the code you suggested, but unfortunately it doesn't help.  Now, the officer stops about 15 meters away from the Mi17 and just stands there without boarding.  I experimented by adding waypoints to make the officer get into the chopper with a "GETIN NEAREST" waypoint, and that didn't work, either.  I'm starting to think that there's some kind of AI bug that prevents the officer from boarding the chopper.

As another test, I put in a rifleman and within the editor gave him a GETIN waypoint that I placed on the Mi17.  With that, the rifleman was able to board the chopper.  So, maybe the officer unit isn't able to board choppers?  I'll have to experiment some more with other units using my script to see what happens.

Thank you for your help, though.
Ranger

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: AI man unable to board Mi17; bug?
« Reply #4 on: 11 Jul 2007, 11:14:29 »
Ranger, do no double post.

If you have something to add to your post after a short period of time (we'd prefer that about 3 days should pass), modify your post instead of replying to yourself.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: AI man unable to board Mi17; bug?
« Reply #5 on: 11 Jul 2007, 11:32:51 »
May be you need to add first an allowGetIn command.

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: AI man unable to board Mi17; bug?
« Reply #6 on: 11 Jul 2007, 12:47:24 »
Code: [Select]
_wp = (group o1) addWaypoint [getPos mi17_1, 0]
_wp setWaypointStatements ["true", ""]
_wp setWaypointType "GETIN"
_wp waypointAttachVehicle m17_1

And, essentially, the man will move over to the vehicle and get in, as per a normal editor-added waypoint? ^^ Alternative in the "setwaypointstatements" spot you could put something like "01 distance m17_1 < 20", and then force 01 to move to the Mi-17 with a simple doMove command.

Alternatively the problem with the above commands is that you don't set the waypoints' statements, and since it waits for "unitready", it might be the waypoint has some impossible statement which basically means the unit is never ready (since it can't pass the waypoint).

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: AI man unable to board Mi17; bug?
« Reply #7 on: 11 Jul 2007, 13:59:21 »
Also, if the officer was assigned to the UAZ, unassign him from it after he gets out.


Planck
I know a little about a lot, and a lot about a little.

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re: AI man unable to board Mi17; bug?
« Reply #8 on: 11 Jul 2007, 19:15:33 »
I did more experimenting, and I was able to get the officer to board the Mi17 by doing all of the following:

  • Attaching a GETIN waypoint within the editor to the Mi17 and commenting out my previous orderGetIn-related code
  • Starting the Mi17's engine before the officer tried to board it (previously, it was parked with the engine off)
  • Moving the Mi17 to a different spot on the airfield

I noticed that with the GETIN waypoint created by the editor, the officer would attempt to board the Mi17, but it as if an invisible barrier about 3 meters from the chopper was preventing him from boarding.  He kept twitching like he was trying to move closer but was unable to do so.  Conversely, when only using scripts to make him board, he would walk within 15 meters (using Mandoble's suggestion) and simply stop, as if the AI ceased to function.  So, that's why I then tried the waypoint created by the editor.

He also only seemed to be able  to board while the chopper's engine was on, because then the chopper would lift off, then try to find a more suitable spot for him to board.  That looks really dumb to me that the chopper is right in front of the officer, but it still has to lift off, then re-land so he can get in.  But, if that's the only way it'll work, I'll live with it.

Moving around the chopper was necessary because it seemed as if the officer's angle of approach affected whether he was able to board.  Or, it could just be my imagination.

In any event, I'm currently experimenting to see if I can get him to board the Mi17 without me having to move the Mi17 elsewhere.  I liked the position where I had it, and I hope he can board there.  So far, no luck.  Later today I'll be able to test more and see what happens.  I tried the above without yet trying the suggestions you all just gave me.  So, I'll try those ideas, too, and see if a combination of all of this makes it work properly.

Thank you for your suggestions!

h-: Apologies for the double post.
Ranger

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: AI man unable to board Mi17; bug?
« Reply #9 on: 12 Jul 2007, 01:45:33 »
I think AI don't like walking under certain rotors. I found this bug in OFP and see it in ArmA now and again. AI don't like walking under rotors to get to things if the engine is off.
Once the engine is on the rotors don't appear to the AI for some reason, and therefore he can sometimes walk underneath. There are certain positions around the aircraft designated for AI to go to to get in (the same places you go to to get in). Unfortunately AI don't see that walking under the rotors is ok. The reason why - I don't know, but I think this is a similar bug to the AI firing over sandbags bug.

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re: AI man unable to board Mi17; bug?
« Reply #10 on: 13 Jul 2007, 19:17:11 »
I got it to work--most of the time.  I did what I wrote in my previous post, plus I removed the H object that I had underneath the Mi17.  For good measure, I also unassigned the officer from his previous vehicle and removed the unitready part of the code.  So, what happens now is that in most cases the Mi17 lifts off, then lands somewhere else so that the officer can get in.  It's goofy, but it usually works.  Sometimes, though, the officer still refuses to board, even after the chopper comes back down to a more suitable location.

JasonO: It seems that you're right, that it's the non-moving rotors that somehow was preventing the officer from boarding.  Strange.

Thank you all for your help.
Ranger

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: AI man unable to board Mi17; bug?
« Reply #11 on: 15 Jul 2007, 17:55:30 »
JasonO: It seems that you're right, that it's the non-moving rotors that somehow was preventing the officer from boarding.  Strange.

I even managed to get myself killed on several occasions, when I was fooling around in the editor and accidentally walked into the rotor before it stopped spinning. Land your heli on a slope or hillside, jump out and see for your self. When the helicopter is tilted it's possible to touch the whirling blades, and apparently thats lethal in ArmA. It wasn't in OFP, as far as I remember.
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: AI man unable to board Mi17; bug?
« Reply #12 on: 15 Jul 2007, 21:18:38 »
Quote
I got it to work--most of the time.

Maybe this little script below can get you to 100% working.  It simply sends the unit to a position next to the chopper, then--when close enough--forces the board animation, and puts the unit in the chopper.  This hopefully eliminates the AI decision making on when he can board.

Code: [Select]
; [man,heli] exec "board_heli.sqs"

_man = _this select 0
_heli = _this select 1

; Send man to left-hand side of vehicle
_man domove (_heli modelToWorld [-2,0,0]);

; Loop until man is close to chopper
#loop
~2
?(_man distance _heli) > 7: goto "loop"

; Play GET IN animation
_man switchmove "AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium"
~.3
; Force unit into cargo
_man assignAsCargo _heli
_man moveInCargo _heli

exit
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline Ranger

  • Members
  • *
  • Hoo-ah!
Re: AI man unable to board Mi17; bug?
« Reply #13 on: 16 Jul 2007, 18:46:37 »
johnnyboy: Thank you for the script.  I'll give it a try!

nominesine: Interesting...I think I'll pass on trying to kill myself with rotors.  :D  That's good to know, though.  If I become a good enough pilot, I'll be able to kill my enemies with my rotors! ;)
Ranger