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

How to do unit movement

Status
Not open for further replies.
Level 27
Joined
Sep 24, 2006
Messages
4,979
How to do unit movement like this: When a unit enters a region he is commanded to go to the next region (Just like an AoS uses this system) and when all enemies on the battlefield are defeated they carry to the enemy encampment.

The problem is i dunno how i make them advance when all units are dead, and the units keep walking back ! >.<
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
  • Unit Movement
    • Events
      • Unit - A unit enters MoveRegion
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player_Team1
    • Actions
      • Set loc1 = (Center of Team2Encampment)
      • Unit - Order (Triggering unit) to Attack-Move To loc1
      • Custom script: call RemoveLocation( udg_loc1 )
This is the trigger I use.
-MoveRegion is the region where you want the units to move to when you first spawn them. Usually I put this region where both teams would intersect.
-Player_Team1 is the owner of the units spawner
-loc1 is just a Point variable to store the location.
-Team2Encampment is the region where you want the unit to attack-move to.
 
Level 27
Joined
Sep 24, 2006
Messages
4,979
Ok i've figured out how to get them walking without walking back every time. But now they still walk back at the end. and when the fight in the middle is finished (For example all peasants finished of the acolytes) they also walk back, how to make them walk forward to the enemy encampment? Can you do it with checking something with a variable? =/
 
Level 17
Joined
Apr 13, 2008
Messages
1,597
You must have made a mistake in your triggers. Copy paste your triggers here, that would help.
When a unit stands at PointA and you order your unit to attack move to PointB there is no way that unit will go back to PointA unless you ordered it to patrol instead of attack move, or you ordered it to move back to PointA. You must have made a mistake you are not aware of in the code. Double check it and if you don't find it post your triggers so we can check it for you.
 
Level 27
Joined
Sep 24, 2006
Messages
4,979
I think you've understood me wrong.

The waypoints are working and the units are walking the right way and don't walk back. But at the end both unit streams will collide and battle eachother.

And here comes the problem, when one of the two teams won they walk back automatically. What to do to make them advance further into the enemy camp?
 
Level 11
Joined
Aug 25, 2006
Messages
971
Quite simple solution is to change their player to anything but neutral hostile.

Neutral hostile units have a leash range which cause them to walk back.
 
Status
Not open for further replies.
Top