• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Hero Revive Trigger???

Status
Not open for further replies.
Level 2
Joined
Jul 20, 2009
Messages
11
  • Events
  • Unit - a unit dies
  • Conditions
  • ((Owner of (Dying Unit)) Controller) Equal to User
  • Actions
  • Wait 5.00 Seconds
  • Hero - Instantly revive (Dying Unit) at (Center of Region 077 <gen>), Show reveal graphics
This does not work.... anyone got an idea why not?
 
For Christ's sake. It's because you're using a Wait at the very beginning of your trigger. Event responses don't work after waits. This has been mentioned time and time again in various posts all throughout the Triggers & Scripts section. If you remove the wait, it will work. If you save the "Dying unit" or "Triggering unit" as a variable, then do the wait and use the variable to reference the unit then it will also work.
 
For Christ's sake. It's because you're using a Wait at the very beginning of your trigger. Event responses don't work after waits. This has been mentioned time and time again in various posts all throughout the Triggers & Scripts section. If you remove the wait, it will work. If you save the "Dying unit" or "Triggering unit" as a variable, then do the wait and use the variable to reference the unit then it will also work.

Event Responses work just fine after waits. =)

@qbz23: I just tested your trigger and it works fine. Add:
  • Game - Display to (All players) the text: The hero exists!
Before or after the wait to see if the code even executes.
 
You're right, at the beginning of the trigger there are no problems (at least in a couple of really low key tests) but I would say it's dangerous ground. In this case, the trigger the author posted works fine.
 
Tried without wait... no luck
Tried with specific units... (mountain king dies, revive mountain king)
There's gotta be some kind of problem here, does anyone have an idea of something in gameplay constants or hero stats or something that might mess this up?
 
I did, and it doesn't... so what might have i done to really mess with my map so that it doesn't work?
 
Changing the trigger to periodic, then instantly off, triggered by another trigger fixed it... no idea why.
 
Alright, here you go.. Use game-time wait instead of real-time wait..
Just made you a respawn system :)
Should work, tested it.. :)

  • Respawn On Death
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to User
    • Actions
      • Wait 3.00 game-time seconds
      • Trigger - Run Respawn System <gen> (ignoring conditions)
  • Respawn System
    • Events
    • Conditions
    • Actions
      • Set ReviveLocation = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
        • Then - Actions
          • Hero - Instantly revive (Triggering unit) at ReviveLocation, Show revival graphics
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Unit-type of (Triggering unit)) is Undead) Equal to True
            • Then - Actions
              • Unit - Remove (Triggering unit) from the game
              • Special Effect - Create a special effect at ReviveLocation using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at ReviveLocation facing ReviveLocation
            • Else - Actions
              • Unit - Remove (Triggering unit) from the game
              • Special Effect - Create a special effect at ReviveLocation using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at ReviveLocation facing ReviveLocation
      • Custom script: call RemoveLocation(udg_ReviveLocation)
Else..

  • Respawn System
    • Events
    • Conditions
    • Actions
      • Set ReviveLocation = (Position of (Triggering unit))
      • Hero - Instantly revive (Triggering unit) at ReviveLocation, Show revival graphics
      • Custom script: call RemoveLocation(udg_ReviveLocation)
 

Attachments

Last edited:
Status
Not open for further replies.
Back
Top