• 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.

Every wave respawn

Status
Not open for further replies.

xplicitjohn

X

xplicitjohn

Can anyone help me create a trigger?




Whenever a hero dies. It will have to wait till the wave is over inorder to revive.

Im stuck with reviving the hero.
 
Level 5
Joined
Jan 4, 2007
Messages
103
This?:

  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Dying unit) is A Hero) Equal to True
    • (Owner of (Dying unit)) Equal to Your Player
  • Actions
    • Set Number = (Number + 1)
    • Set Hero[Number] = (Dying unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Wave Equal to 0
      • Then - Actions
        • Hero - Instantly revive (Dying unit) at (Your Region)), Show revival graphics
      • Else - Actions
        • Trigger - Turn on (Second Trigger)
Second Trigger:

  • Events
    • Time - Every 0.50 seconds of game time
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Wave Equal to 0
      • Then - Actions
        • For each (Integer A) from 1 to 10, do (Actions)
          • Loop - Actions
            • Hero - Instantly revive Hero[Integer A] at (Your Region)Show revival graphics
          • Trigger - Turn off (this Trigger)
          • Set Number = 0
      • Else - Actions
        • Do nothing
Just add this to your wave trigger when the wave starts:

  • Set Wave = 1
And this when the wave ends:

  • Set Wave = 0
Number is an Integer variable. Hero is an Integer with an array variable. Wave is an Integer variable ect. Hope it helps:)
 
The_DooM, you don't need a "Do Nothing" action; the trigger will by default do nothing, if no action is involved.
It would be better if you combined it with a basic trigger respawn system.
  • Te
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Levels = 1
      • Set Units[1] = Knight
      • Set Units[2] = Frost Wyrm
      • Set Units[3] = Green Dragon Whelp
      • Set Units[4] = Green Dragon
      • Trigger - Turn on Tri <gen>
  • Tri
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Set Point = (Center of Region 000 <gen>)
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Units[Levels] for Neutral Hostile at Point facing Default building facing degrees
          • Unit Group - Add (Last created unit) to TempGroup
      • Special Effect - Create a special effect at Point using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation (udg_Point)
      • Trigger - Turn off (This trigger)
  • Tre
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Neutral Hostile
        • Then - Actions
          • Unit Group - Remove (Triggering unit) from TempGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TempGroup) Equal to 0
            • Then - Actions
              • Set NP = (Center of (Playable map area))
              • Unit Group - Pick every unit in DeadHeroes and do (Actions)
                • Loop - Actions
                  • Hero - Instantly revive (Picked unit) at NP, Show revival graphics
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Levels Less than 4
                • Then - Actions
                  • Set Levels = (Levels + 1)
                • Else - Actions
              • Trigger - Turn on Tri <gen>
              • Custom script: call RemoveLocation (udg_NP)
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) controller) Equal to User
              • ((Owner of (Triggering unit)) slot status) Equal to Is playing
              • ((Triggering unit) is a Hero) Equal to True
            • Then - Actions
              • Unit Group - Add (Triggering unit) to DeadHeroes
            • Else - Actions
In the test map, hit escape to kill the heroes. Then, when the neutrals spawn, kill them with the priests. For testing purposes, the "whosyourdaddy" cheat is enabled. You will notice that, when the neutrals die, every hero will respawn back.
 

Attachments

  • Spawn Triggers and Dead Heroes.w3x
    19.2 KB · Views: 74

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Create a unit array and store all heroes in it at their corrosponding index to the player who owns them. The first player in WC3 has the number 0 when passed to the native whereas in SC2 or if using the GUI parameter in WC3 it is 1.

Once a wave ends (or a wave begins)...
For every player matching the conditions that he is valid for revival (was playing at some stage or is still playing, the choice is yours)....
If the hero stored in the index of the player slot number is dead...
Revive the hero stored in the index of the player slot number ...

Additionally if players can have multiple heroes, you may wish to use a partial array to store the heroes independiently of player and just loop through them and revive the dead ones once the round ends.
 
Status
Not open for further replies.
Top