• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Unit comes within range trigger issue

Status
Not open for further replies.
Level 4
Joined
Aug 12, 2014
Messages
48
I have several triggers that orders a creep to move to a "beacon unit" which then orders the creep to move to the next "beacon unit" and so on. This works great for a single unit. The problem and the point of the trigger/s is that I want the beacons to be able to move (via the ability blink) and change the route that the creep takes.

Trigger breaks as soon as a beacon unit is moved. Creeps stops at the previous position of the beacon - not the current position of the beacon.

Here is an example:
  • Beacon 1 Away
    • Events
      • Unit - A unit comes within 256.00 of Beacon 1 0042 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Ship
      • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
    • Actions
      • Trigger - Turn on Beacon 2 Away <gen>
      • Unit - Order (Triggering unit) to Move To (Position of Beacon 2 0043 <gen>)
      • Trigger - Turn off (This trigger)
As the unit moves, triggers turn on/off the other required triggers. I have an idea of what the problem is but not sure how i can fix it. Thanks in advance for any input.
 
Level 4
Joined
Aug 12, 2014
Messages
48
Starting destination trigger:
  • Trade Route Start
    • Events
      • Unit - A unit enters Trade Route Start <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Trade Galley
      • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
    • Actions
      • Item - Pick every item in Red create goods <gen> and do (Hero - Give (Picked item) to (Triggering unit))
      • Trigger - Turn on Beacon 1 Away <gen>
      • Unit - Order (Triggering unit) to Move To (Position of Beacon 1 0042 <gen>)
Followed by 3 beacon triggers all like this:
  • Beacon 1 Away
    • Events
      • Unit - A unit comes within 256.00 of Beacon 1 0042 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Ship
      • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
    • Actions
      • Trigger - Turn on Beacon 2 Away <gen>
      • Unit - Order (Triggering unit) to Move To (Position of Beacon 2 0043 <gen>)
      • Trigger - Turn off (This trigger)
Followed by the end destination trigger:
  • Trade Route Sell
    • Events
      • Unit - A unit enters Trade Goods Drop <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
      • (Unit-type of (Triggering unit)) Equal to Trade Galley
    • Actions
      • Trigger - Turn on Beacon 3 Return <gen>
      • Unit - Order (Triggering unit) to Move To (Position of Beacon 3 0044 <gen>)
On the way back, there is a similar trigger to the second one I posted here which repeats the entire loop:
  • Beacon 3 Return
    • Events
      • Unit - A unit comes within 256.00 of Beacon 3 0044 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Trade Galley
      • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
    • Actions
      • Trigger - Turn on Beacon 2 Return <gen>
      • Unit - Order (Triggering unit) to Move To (Position of Beacon 2 0043 <gen>)
      • Trigger - Turn off (This trigger)
Triggers work just fine as long as I don't move the beacons - as soon as I move one, the route gets broken and the ship stops where the beacon used to be.

I am guessing I need to create a variable for the unit/position and a condition that checks to see if it is met, otherwise, repeat the loop/action etc - I am just guessing here with my limited knowledge.
 
Level 2
Joined
Jun 28, 2015
Messages
20
try ordering them to follow the beacons rather than move to them.
  • Actions
    • Unit - Order (Triggering unit) to Follow (The beacon)
 
Status
Not open for further replies.
Top