Home   Help Search Login Register  

Author Topic: move in a straight line for pity's sake...  (Read 1459 times)

0 Members and 1 Guest are viewing this topic.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
move in a straight line for pity's sake...
« on: 27 Sep 2006, 17:34:52 »
scenario:

i have a bmp with AI commander, driver and gunner. they are on an out-of-the-way island. they have no waypoints, and no ammo. their "target" and "autotarget" ai is disabled.

at a specific point in a cutscene, i setpos the bmp to a marker on the road in the small village at the southern point of kolgujev. i need it to move slowly along the road to the other end of the village.

problem:

i tried making a waypoint, setting it to slow speed, careless, also set the ai skill to maximum, but no matter what i tried, with the AI in control of the vehicle they would always veer off to the sides and into the buildings. this will no doubt be a familiar scenario to everyone who knows flashpoint AI drivers...

i then tried using setvelocity in a fairly fast loop, which sometimes works, sometimes doesn't. sometimes the bmp turns round 180 degrees (despite dowatch commands) and moves along backwards, sometimes the bmp slides a little to either side, slaloming along the road, sometimes the bmp simply sits there stationary with its engines running.

the only thing that works is a setpos loop, but this does not leave the pretty tracks on the road, and looks exactly like what it is - a setpos loop sliding a bmp along a road.

i am at my wits end. i thought i knew enough about flashpoint to prevent this sort of thing happening, but this one bmp is testing my patience.

any help gratefully appreciated.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re: move in a straight line for pity's sake...
« Reply #1 on: 27 Sep 2006, 18:25:23 »
Make sure there are no static objects near the road elsewhere on the map.    Or at least for a mile or two.    A tent too close to the road can make an AI driver a mile away go mad.    Move the tent by a couple of feet and all is well.

Welcome to the world of OFP mission editing. :weeping:
Plenty of reviewed ArmA missions for you to play

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: move in a straight line for pity's sake...
« Reply #2 on: 27 Sep 2006, 18:34:53 »
Quote
this will no doubt be a familiar scenario to everyone who knows flashpoint AI drivers...
:D
A sheer nightmare for "UK's worst driver" (or whatever it is) host/instructor/whatnot...  ::)

But yeah, it's basicly like macca said..
If there's a road on the island you better not have the island under the road, or any objects anywhere on the map..


Although, this might be a sort of performance issue because the AI in general gets more retarded by every time the FPS drops just a bit..
You can easily test it by having an enemy soldier about 50 meters from you (that's OFP 50 meters, which is everything between 50 and 100 meters..) and previewing with such settings that the FPS runs full.. The enemy soldier will instantly kill you..
'Lag up' the game so that you can see it visibly 'jerking'/'stuttering' and the enemy AI will not spot you, not unless you move or shoot at it..

So maybe they drive better when their brains are not 'stuttering' ???
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: move in a straight line for pity's sake...
« Reply #3 on: 27 Sep 2006, 19:04:03 »
You probably have a good reason for setposing the Bmp to the road at a certain point in your cutscene...but if not, this may work.

I've noticed the drivers always suck when they first start out, but once they get moving along the road (in careless mode), they prefer the road, and will stick to it.  So if you can start the BMP out of town a bit on the road, and give him enough time to start driving well, he can arrive at the desired point at the desired time (depending on starting placement).

Also, to build on mac's point, any units near the road will disturb the AI driving. 

And finally, I helped Cheetah fix a convoy driving problem in his Falling Stars mission by setting dammage to 1 to all static objects near the road (trees, streetlamps, bushes, signs, etc.).  This worked pretty well:

"object _x setdamage 1"  ForEach [14595, 14596, 14588, 14644, 14645, etc.......]

You find all the object ids of object near the road, and make a trigger that is true once with the above line of code (using your object ids)
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 Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: move in a straight line for pity's sake...
« Reply #4 on: 27 Sep 2006, 19:33:30 »
Bedges,
setVelocity should work fine, just dont give more than 0.01 secs free time between setVelocity commands. To ensure the BMP does not fly with that command, use a -1 or -1.5 component for Z, so it keeps "pressing" the ground. With setVelocity you dont need a driver, just delete that unit as the script is the driver. You only need setVelocity and setDir for every rect segment of the road. If you need any help scripting this, PM me.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: move in a straight line for pity's sake...
« Reply #5 on: 27 Sep 2006, 19:42:29 »
Quote
With setVelocity you dont need a driver

 :o

ladies and gentlemen, i think we have a winner...

thanks for the input folks. i'll test and post with results.  :thumbsup:

EDIT - well, thanks to mandoble's suggestion that empty vehicles can have their velocity set, i did some experimentation. it seems the reason my vehicles were not having their velocity set was the time between their being setpos'd into position and being given the setvelocity command. i have now createvehicle'd the empty bmp into place just before it is required and presto, it moves beautifully in a perfectly straight line, without any ai fooling around with the steering wheel.

many thanks again for the input. i love OFPEC, so much it makes my wife jealous  :shhh:
« Last Edit: 28 Sep 2006, 15:49:30 by bedges »

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: move in a straight line for pity's sake...
« Reply #6 on: 28 Sep 2006, 20:51:12 »
Why not use real waypoints?  Start the BMP far far away with no fuel, but with lots of waypoints where you want them.

When needed fuel it up, setPos it a little ways from the first WP and then  doMove getPos myBMP for good measure.
urp!

PetriHonka

  • Guest
Re: move in a straight line for pity's sake...
« Reply #7 on: 01 Oct 2006, 15:37:38 »
To build on Mr.Peanut's point, if you zoom in to the maximum in the editior and place the waypoints so there is no gap between the circle of one and the next  (of the WP markers) then the AI will not have time to swerve and slalom (this works in most cases)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: move in a straight line for pity's sake...
« Reply #8 on: 01 Oct 2006, 23:23:32 »
thanks for the suggestions. using mandoble's absent driver idea i now have this working.

topic solved.