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

[Trigger] Moving unit to a spot

Status
Not open for further replies.
Level 17
Joined
Apr 24, 2005
Messages
762
So i have 2 players, each player is only in control of 1 hero . When the timer ends there will be a cinematic. And after the cinematic i want to move player 1 to spot 1 and player 2 to spot 2 (kinda like duel). So could anyone please tell me how to do this?
 
Level 21
Joined
Jan 5, 2005
Messages
3,515
you can either
A. select the unit directly if the unit already exists on the map
B. assign a variable to the unit when it spawns and use the variable to issue orders
C. have the unit trigger an event
D. unit selection with conditions to ensure it is the unit you want.

there are probably other ways i cant remember as i havent taken the time to think about it much, but i know they work.

if you give details on how the hero comes into being on the map we can tell you what to do.
 
Level 18
Joined
May 27, 2007
Messages
1,689
Alright this is what you need, i would recommend placing some sort of unit in ur dueling arena to use for moving purposes. What you will need is a few variables, "Timer" a timer variable,"HeroRed" unit variable, "HeroBlue" unit variable, "BLue" point variable, and "Red" point variable. then you will need basically three triggers.
  • Timer
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Countdown Timer - Start Timer as a Repeating timer that will expire in 20.00 seconds
This will start your timer for when you want your duel to occur, if you want it to happen every X seconds use a repeating timer, if you want it to occur once use a one shot timer then use this to intiate the duel.

  • Duel
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (((Picked unit) is A Hero) Equal to True) and ((Owner of (Picked unit)) Equal to Player 1 (Red))
            • Then - Actions
              • Player Group - Pick every player in (All players) and do (Camera - Pan camera for (Picked player) to (Center of Region 000 <gen>) over 1.00 seconds)
              • Camera - Pan camera for Player 1 (Red) to (Position of Duel Spot 0000 <gen>) over 1.00 seconds
              • Set HeroRed = (Picked unit)
              • Set Red = (Position of (Picked unit))
              • Unit - Move (Picked unit) instantly to (Position of Duel Spot 0000 <gen>)
            • Else - Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (((Picked unit) is A Hero) Equal to True) and ((Owner of (Picked unit)) Equal to Player 2 (Blue))
            • Then - Actions
              • Camera - Pan camera for Player 2 (Blue) to (Position of Duel Spot 0001 <gen>) over 1.00 seconds
              • Set HeroBlue = (Picked unit)
              • Set Blue = (Position of (Picked unit))
              • Unit - Move (Picked unit) instantly to (Position of Duel Spot 0001 <gen>)
            • Else - Actions
This will bring your camera and units to the duel arena and finally

  • Revive
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If ((Dying unit) Equal to HeroBlue) then do (Hero - Instantly revive (Dying unit) at Blue, Show revival graphics) else do (Unit - Move HeroBlue instantly to Blue)
      • If ((Dying unit) Equal to HeroRed) then do (Hero - Instantly revive (Dying unit) at Red, Show revival graphics) else do (Unit - Move HeroRed instantly to Red)
      • Custom script: call RemoveLocation (udg_Blue)
      • Custom script: call RemoveLocation (udg_Red)
I have also included a test map for you if it is tuff to figure out you can also if you are keeping points when the unit dies do a "Multiple Actions" "If Then Else" and just do "Leaderboard or Multiboard-Change Text" to keep track of kills hope this helps :thumbs_up: BTW this is only if you have one hero per player and two players, it wouldnt be too hard to change to more players
 

Attachments

  • duel test.w3x
    19.3 KB · Views: 44
Status
Not open for further replies.
Top