• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
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.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
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.
 
Level 2
Joined
Jul 20, 2009
Messages
11
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?
 
Level 2
Joined
Jul 20, 2009
Messages
11
I did, and it doesn't... so what might have i done to really mess with my map so that it doesn't work?
 
Level 2
Joined
Jul 20, 2009
Messages
11
Changing the trigger to periodic, then instantly off, triggered by another trigger fixed it... no idea why.
 
Level 5
Joined
Dec 21, 2008
Messages
101
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

  • Simple Respawn System.w3x
    19.5 KB · Views: 74
Last edited:
Status
Not open for further replies.
Top