Issue with "Wandering Movement"

S

Searingdeath

Guest
So as part of my map there's this mini-game, much like frogger. The problem is, I can't get the cars to move in a straight line.

Right now I have an array of regions for each side. Whenever one is entered, it teleports the car to the other side (facing the side it entered) and issues an order to move to the side it entered.

The cars loop just fine, but they seem to "bend" up and down, without going in a straight path.

I reduced the collision on them a bit because they were a bit close together, although even ones that are far away from the rest of the cars sway up and down as they move toward the other side.

Do I need to make a special pathing map for that specific unit, and if so, how do I go about doing this? Is there a function where I can lock the domain of a unit to a region (would be a thin strip across the road).

Thanks in advance...

-- Searingdeath
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Hello, Searingdeath!


This problem is commonly stumbled upon when making tower defenses, too - creeps that seem to be drunk and don't follow the path in a straight line.

I suggest you to use more regions, and order them more often or use pathing blockers
(under doodaad palette) to force the units to move in a straight.

However, pathing blockers aren't the best idea if you need other units to be able
to cross the path - the pathing blockers would not allow that.
 
S

Searingdeath

Guest
Hmm. Alright, I'll try that. I'll write a script to dynamically generate the regions so I can destroy them all when that specific mini-game isn't being played...

I just thought of something though. Could be be that the unit I made the cars from is derived from that Human vehicle thing (can't remember the name at the moment). I'll try calling "SetUnitTurnSpeed" on them to try to fix it first, since spawning lots of regions seems like it has potential to lag...

If I use that to set the turn speed to 0.00, does that mean that it won't turn from the 0 degrees they're set to?
 

Quauhtli

I have the right to remain silent.
Reaction score
62
Alternatively you could use andrewgosu's pathing blocker idea but surround the paths the cars drive on with small ground blockers and give the frogger movement type "Fly".
 
S

Searingdeath

Guest
If possible I'd like to avoid using techniques that don't actually lock the cars to a straight line. Correct me if I'm wrong, but won't the pathing blockers merely restrict it to a thin strip within which the car can move?

I like the multiple regions idea. It's easier to manage to me, since I can dynamically generate all of it (rects and triggers) and then destroy it all. The pathing blockers seem to be a bit harder...

Still, I'll try the turn speed thing when I get home.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top