• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Random Location Spawn

Status
Not open for further replies.
Level 5
Joined
May 11, 2005
Messages
130
I am wondering how you would make a trigger that Haves a unit respawn in a random location, BUT the locations a preset

Ex: the pally dies, he has 3 sec till revive... when he revives he has four possible locations to spawn in

I would like to give thanks for any help in advance!
 
Level 3
Joined
Mar 27, 2007
Messages
23
  • Untitled Trigger 011
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Paladin
    • Actions
      • -------- You must first make Regions with the region editor and then enter the names of the regions in the triggers --------
      • Set Varibablereal = (Random real number between 0.00 and 5.00)
      • Wait 3.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Varibablereal Equal to 0.00
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of (Your_Rect(region)here)), Hide revival graphics
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Varibablereal Equal to 1.00
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of (Your_Rect(region)here)), Hide revival graphics
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Varibablereal Equal to 2.00
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of (Your_Rect(region)here)), Hide revival graphics
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Varibablereal Equal to 3.00
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of (Your_Rect(region)here)), Hide revival graphics
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Varibablereal Equal to 4.00
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of (Your_Rect(region)here)), Hide revival graphics
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Varibablereal Equal to 5.00
        • Then - Actions
          • Hero - Instantly revive (Dying unit) at (Center of (Your_Rect(region)here)), Hide revival graphics
        • Else - Actions
          • Do nothing
Try this and see if it works
 
Level 3
Joined
Mar 27, 2007
Messages
23
Ive done it!

Ok this is how you do it

first of all make a variable specifically a region make sure to check array
then make this trigger:
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Respawnregion[1] = Region 000 <gen>
      • Set Respawnregion[2] = Region 002 <gen>
      • Set Respawnregion[3] = Region 001 <gen>
      • Set Respawnregion[4] = Region 003 <gen>
      • Set Respawnregion[5] = Region 004 <gen>
This will set the regions to those given numbers.
Then make this trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Paladin
    • Actions
      • Wait 3.00 seconds
      • Hero - Instantly revive (Dying unit) at (Center of Respawnregion[(Random integer number between 1 and 5)]), Hide revival graphics
and there you have it random hero respawn
 
Status
Not open for further replies.
Top