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

What the.. Easy Revive Script doesnt work

Status
Not open for further replies.
Level 4
Joined
Jan 4, 2007
Messages
67
  • Hero Revive
  • Events
  • Unit - A Unit owned by Player 2(Blue) dies
  • Conditions
  • ((Triggering Unit) is a Hero) =true
  • Actions
  • Time - Wait 10 seconds
  • Hero - Instantly Revive (Triggering Unit) at (revive base left <gen>), hide revival graphics
Just a simple trigger to revive a hero after 10seconds.
Why i get errors when i try to save the map?

And another question:
How do i create a 10 second timer for the player that has to wait?
 
this isnt a gui trigger.... you typed that by hand into the trigger tag?
anyway, i think you mean this trigger:
  • Hero Revive
    • Events
      • Unit - A unit owned by Player 2 (Blue) Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Wait 10.00 seconds
      • Hero - Instantly revive (Triggering unit) at (Center of revive base left <gen>), Hide revival graphics
I tested it and it works fine.
However this isnt multi instanceable.
 
ok i made a complete multi instanceable and non leaking revive trigger in gui using custom script.
  • Hero Revive
    • Events
      • Unit - A unit owned by Player 2 (Blue) Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Custom script: local timer tim = CreateTimer()
      • Custom script: local timerdialog timd = CreateTimerDialog( tim )
      • Custom script: local unit dieunit = GetTriggerUnit()
      • Custom script: local location where = GetRectCenter( gg_rct_YourRegionName )
      • Custom script: local real waittime = 10.00
      • -------- Setting up and starting the Timer --------
      • Custom script: call TimerDialogSetTitle( timd, GetPlayerName( GetOwningPlayer ( dieunit ) ) )
      • Custom script: call TimerDialogDisplay( timd, true )
      • Custom script: call TimerStart( tim, waittime, false, null )
      • -------- What to do after the Wait --------
      • Custom script: call PolledWait( waittime )
      • Custom script: call ReviveHeroLoc( dieunit, where, false )
      • -------- Cleaning up the leak --------
      • Custom script: call RemoveLocation( where )
      • Custom script: set where = null
      • Custom script: set dieunit = null
      • Custom script: call DestroyTimer( tim )
      • Custom script: set tim = null
      • Custom script: call DestroyTimerDialog( timd )
      • Custom script: set timd = null
Code:
Custom script:   local location where = GetRectCenter( gg_rct_[color=red]YourRegionName[/color] ) //Rename it to your region name
Code:
Custom script:   local real waittime = [color=red]10.00[/color] //Change it to your wait time

I think its easy to understand and yes i know i used polled wait, but only to prevent a second trigger.
 
Last edited:
Level 11
Joined
Jul 12, 2005
Messages
764
Your code seems to be fine, but one thing cought my attention: all players will see the timerdialog! If you don't want this, replace the line:

  • Custom script: call TimerDialogDisplay( timd, true )
With this:

  • Custom script: call TimerDialogDisplay(timd, GetLocalPlayer() == GetOwningPlayer(dieunit))
And i recommend to forget that Polled Wait thing, it's only a rumor that it's better than a simple Wait.
 
Status
Not open for further replies.
Top