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

Problems starting

Status
Not open for further replies.
Level 6
Joined
Jul 26, 2010
Messages
167
my doubt is... why my unit only moves to one location if I sent him two move twice?. my wc3 is in spanish, I hope somebody understad this :/

  • Acontecimientos
    • Map initialization
  • Condiciones
  • Acciones
    • Partida de refriega - Create starting units (for all players)
    • Partida de refriega - Run melee AI scripts (for computer players)
    • Unidad - Create 1 Soldado raso for Jugador 1 (rojo) at ((Center of (Playable map area)) offset by (200.00, 200.00)) facing Vista edificio predeterminada (270.0) degrees
    • Unidad - Order (Last created unit) to Mover a ((Center of (Playable map area)) offset by (2000.00, 2000.00))
    • Unidad - Order (Last created unit) to Mover a ((Center of (Playable map area)) offset by (1000.00, 1000.00))
 
Last edited:
Level 12
Joined
Mar 24, 2011
Messages
1,082
Erm... the unit can't split in two to go to both places.

You can set destination1 and when it comes near it command it to go to destination2.

(I think there was a way to force Shift-order but I am not sure if I remember correctly)
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Set a point variable - Destination1
Set a point variable - Destination2
Set a unit variable - MoovingUnit the unit you want
That can be done in the map initialization trigger.
  • Untitled Trigger 003
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempPoint = (Center of (Playable map area))
      • Set Dest1 = TempPoint offset by (2000.00, 2000.00))
      • Set Dest2 = TempPoint offset by (1000.00, 1000.00))
      • Unit - Create 1 Footman for Player 1 (Red) at TempPoint facing Default building facing degrees
      • Set MoovingU = (Last created unit)
      • Unit - Order MoovingU to Move To Dest1
In another trigger which runs evry 1 sek
set TempPoint to position of MoovingUnit
If then else - If - distance betwen TempPoint and Destination1 is less than 200 Then - order MoovingUnit to move to Destination2
and to remove leaks
call RemoveLocation(udg_TempPoint)

  • Untitled Trigger 004
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint = (Position of MoovingU)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between TempPoint and Dest1) Less than 200.00
        • Then - Actions
          • Unit - Order MoovingU to Move To Dest2
          • Custom script: call RemoveLocation(udg_Dest1)
          • Trigger - Turn off (this trigger)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint)
I know that it leaves a leak but 1 point shouldn't be a problem.
 
Level 4
Joined
Jan 28, 2013
Messages
94
thnx man it worked. Theres any way to make the condition work without the timer?... cuz sometimes the time is not enough or is too much
How about Event - Unit Enters Region? Then when it's inside the region it gets command to move to the next point. Or maybe when it's inside a certain range of location 1?

I do not know if that may cause a leak though.
 
Status
Not open for further replies.
Top