• 🏆 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!

[Trigger] Unit move bugging out?

Status
Not open for further replies.
Level 2
Joined
Mar 14, 2012
Messages
20
  • Convert Units redblue
    • Events
      • Unit - A unit owned by Player 1 (Red) Finishes training a unit
      • Unit - A unit owned by Player 2 (Blue) Finishes training a unit
    • Conditions
    • Actions
      • Unit - Change ownership of (Trained unit) to Player 6 (Orange) and Change color
      • Unit - Order (Trained unit) to Move To (Center of RedBlueunits <gen>)
The first part ^^

  • redblue to castleunit
    • Events
      • Unit - A unit enters RedBlueunits <gen>
    • Conditions
    • Actions
      • Unit - Move (Triggering unit) instantly to (Center of Humanunitcastle <gen>), facing (Position of (Triggering unit))
      • Unit - Order (Triggering unit) to Attack-Move To (Center of sendrecievehuman <gen>)
The bit I THINK i'm having issues with.

The problem being when the unit reaches it's planned destination (sendrecievehuman) it will stop, but then after about 1 second it will begin running back to the building it was trained from (I assume).

Any Ideas?
 
Level 2
Joined
Mar 14, 2012
Messages
20
Thanks!

By manually I assumed an action? since the units are converted to player 6 (computer) instantly, so i have no control over they're movement when they're trained (triggers galore!)

I've got it working...slightly :D
The current problem being they stop right at the edge of the region they're told to go to.

Of course I can make another region inside that region for when they get to the center, but the problem being i'll have to make the second region relatively big, since this region may be collecting quite alot of units, and if there becomes a sort of build up, some units don't reach the stop region.

Is there any trigger that has something like, unit in center of region?
or 'unit within range of center of region'?

Never mind I've fixed the issue by adding in a slight wait before the units are ordered to stop in the region.

I heard waits aren't recommended to be used, any idea why? o.0
 
Last edited by a moderator:
Level 19
Joined
Aug 8, 2007
Messages
2,765
You leak a total of 4 times in those triggers. Just saying

Check the sticky "things that leak" (especially the part about points/locations)
 
Level 2
Joined
Mar 14, 2012
Messages
20
Yeah Ive got it working now as intended, but now it has brought up some more similar bugs of units deciding to ditch my issue order commands and try and run back to their building. I think of something

Im sure im hitting around 15 leaks atm :D, I'm not focusing on anything like that until i've actually got the map working XD
 
Last edited:
Level 14
Joined
Jul 25, 2011
Messages
1,065
Yeah Ive got it working now as intended, but now it has brought up some more similar bugs of units deciding to ditch my issue order commands and try and run back to their building. I think of something

Im sure im hitting around 15 leaks atm :D, I'm not focusing on anything like that until i've actually got the map working XD

I think that's a bad idea. You should remove leaks first. I costs a lot of time if you remove it later.
 
Level 11
Joined
Aug 6, 2009
Messages
697
If you ever have this problem where the units retreat before they enter the region (like they encounter a unit and attack it on the way. Sometimes this will make the unit move back to where it was spawned.) add all the trained units to a unit group and make it so every 10 seconds or so the unit is order to enter the region. I do that anyways.
 
Level 14
Joined
Jul 25, 2011
Messages
1,065
If you ever have this problem where the units retreat before they enter the region (like they encounter a unit and attack it on the way. Sometimes this will make the unit move back to where it was spawned.) add all the trained units to a unit group and make it so every 10 seconds or so the unit is order to enter the region. I do that anyways.

Your idea is better.
 
Status
Not open for further replies.
Top