Jump to content
PCanas

Forced moving forward in straight line

Recommended Posts

Hi folks :)

 

I'm trying to make a parade, for a video. I have a bunch of vehicles lined up and I want them to simply move forward, straight, and at constant speed. (will have infantry too)

Apparently, the "simply" part is not so simple...

 

I've serached the interwebz and found a bunch of commands like disableAI [whatever], but it didn't work. The only thing that seemed to work was "limitspeed" or "definespeed"... can't remember exactly.

I also tried placing a waypoint straight ahead of the vehicle, but it will follow the road next to him (I'm making it in the Altis airport runway).

 

Long story short, I can't make them move forward, in a straight line, ignoring any road nearby, or trying to move away from other vehicles. (I managed to put 5 tanks side by side in the runway; they're not that close to each other)

 

Need help.

 

Thanks! :)

Share this post


Link to post
Share on other sites

I've seen that. The problem with that is that its human dependable. It would be very hard to make all the vehicles start moving at the same time, and drive at the same speed... specially when you have about 50 vehicles, maybe more.

Share this post


Link to post
Share on other sites

You can record just one vehicle, and use that one result to playback 50 different vehicles with a delay. They will all behave in exactly the same way.

Share this post


Link to post
Share on other sites
21 minutes ago, Sgt. Dennenboom said:

You can record just one vehicle, and use that one result to playback 50 different vehicles with a delay. They will all behave in exactly the same way.

 

But won't they go to the same path as the first? I mean, BIS_fnc_UnitCapture records the path too, right? so if I place a second vehicle next to the first (wich got recorded), won't the second steer until it's the same track as the first?

Share this post


Link to post
Share on other sites

@Sgt. Dennenboom's suggestion is good.  but you may have to pre-record more than one path if you want some vehicles side by side.  For example, if you want some vehicle single file down middle of the road, you can use same recorded path for all, just start each one with a delay to space the out.  If you want some vehicles moving in paralellel, then  you need to record a different path for the left vehicle and the right vehicle.

 

Sadly, ground vehicles will not show their wheels turning when used with unitPlay.  So it may not work for you.  But if this is for a cutscene, then you can make it work with camera positions not showing wheels.

Share this post


Link to post
Share on other sites

What if... I tell the AI to move to a xyz coordinate? Would they move straight forward or would it work like a regular waypoint, i.e., they'd go to the road?

Share this post


Link to post
Share on other sites

Since this is for a video, and the parade units are to move straight, I think you can make this work by having lead unit move, and all following units (men and vehicles) attached to the lead unit.  You can try these steps with 10 units, and if it works, set up your large parade and try it.

 

  1. Set up units in desired formation.  Note the front unit's name as he will be the unit you attach all other units to.
  2. Loop through all parade units and attach them to lead unit while maintaining their current offset position to lead unit.
  3. For men units, execute a walking animation on all of them and loop it so they continue to look like they are walking (hopefully attached units can playmove/switchmove an animation...I'm not sure about that).
  4. Set the speed for the parade movement to an infantry walking speed, so the infantry looks natural (not gliding along).

So the lead unit could also just be a hidden object that you move via script that all units are attached to.  That is how this fly in formation script I wrote works.  There is no AI involved.  A similar approach might work for you:
JBOY Fly in Formation

 

Share this post


Link to post
Share on other sites
11 minutes ago, johnnyboy said:

Since this is for a video, and the parade units are to move straight, I think you can make this work by having lead unit move, and all following units (men and vehicles) attached to the lead unit.  You can try these steps with 10 units, and if it works, set up your large parade and try it.

 

  1. Set up units in desired formation.  Note the front unit's name as he will be the unit you attach all other units to.
  2. Loop through all parade units and attach them to lead unit while maintaining their current offset position to lead unit.
  3. For men units, execute a walking animation on all of them and loop it so they continue to look like they are walking (hopefully attached units can playmove/switchmove an animation...I'm not sure about that).
  4. Set the speed for the parade movement to an infantry walking speed, so the infantry looks natural (not gliding along).

So the lead unit could also just be a hidden object that you move via script that all units are attached to.  That is how this fly in formation script I wrote works.  There is no AI involved.  A similar approach might work for you:
JBOY Fly in Formation

 

 

Might work...

I actually used that to attach some smoke grenades into planes to make a flyby with the flag colors. Worked nice. Funny thing is the planes flew as intended with normal waypoints, only minor tweeking needed. I have 5 planes in a V formation, they're all independent from each other and each has it's own waypoint. They fly straight, in formation.

Apparently, ground units can't do that...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×