• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Plane slide pathing bug

Status
Not open for further replies.
Level 4
Joined
Oct 2, 2015
Messages
74
I have been working on a slide system for planes for my map to give them more realistic movement that somewhat resembles that of games like empire earth and rise of nations.
The planes are moved towards their facing every 0.03 seconds with the SetUnitX and SetUnitY actions.
When the planes get orders from their player, they work perfectly fine with no issue whatsoever.
However, when ordered towards a target unit/point by a trigger, something really weird happens.
The planes just won't turn towards their target and will continue moving to the same direction until they hit the edge of the map.
I will also add that their turning is not made in triggers, it's the natural unit turning, and it otherwise works perfectly fine.
Is there anything that i might be missing?
 
Level 4
Joined
Oct 2, 2015
Messages
74
One last thing i forgot to mention, the planes are ordered towards their target every 0.03 seconds when they are out of mana.
 
Level 4
Joined
Oct 2, 2015
Messages
74
Ordering them so frequently might be the case since the unit might never get to execute the order due to being interrupted by another (same issued again) order.
maybe, but i am not entirely sure since it's random.
at times when the planes have to go back to refuel, they will do so normally, but in other times, the bug happens.
assuming the frequency is the culprit, is there anything else i can do besides ordering the planes to refuel every 0.03 seconds?
my goal is that until refueled, the plane will not listen to the player's orders or do anything else in general besides flying towards the closest airfield and refueling.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
You can issue it every second or so. Then use another trigger which intercepts the player issuing the plane an order and then cancels that order out by re-issuing the return to base order. Since the event fires before the player order is issued, you either need to delay the cancel to directly after (such as 0 seconds later) or I recall the trick being to pause cycle the unit before issuing the new order.
 
Level 4
Joined
Oct 2, 2015
Messages
74
the bug is still happening.
what other potential culprits are there?

EDIT:

Problem Solved.

I have based the planes' refuel movement on the GUI's "Move Unit And Face Point (Instantly)" action as it prevents the plane from moving on itself, and from the player from commanding it. The planes now no longer fly towards the edge of the map.

Since "Move Unit And Face Point (Instantly)" does not allow orders, i have made the trigger detect when the plane is near an airfield, so it releases the plane from the "Move Unit And Face Point (Instantly)" loop and orders it to refuel.

Either way, thanks for trying to help.
i'd give +1 rep but idk how to do with the new hive interface.
 
Last edited:
Status
Not open for further replies.
Top