• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Hero Revival

Status
Not open for further replies.
I found an example hero revival system online that uses local variables via custom script to create hero revivals. Problem is, other players can see the timers for their enemies and allies, which I need changed for my map. I want only the player whos hero died to be able to see the timer. I am a GUI guy, so a GUI solution would be best (as in custom script is ok, I don't want to write the whole thing in JASS because I might screw it up o_O)

  • Revive Hero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Custom script: local timerdialog WINDOW
      • Custom script: local integer HEROWAIT
      • Custom script: local timer OURTIMER
      • Custom script: local unit OURHERO
      • Custom script: set OURHERO = GetDyingUnit()
      • Custom script: set HEROWAIT = ( GetHeroLevel(OURHERO) * 5 )
      • Custom script: set OURTIMER = CreateTimer()
      • Custom script: call StartTimerBJ( OURTIMER, false, ( I2R(HEROWAIT) ))
      • Custom script: call CreateTimerDialogBJ( OURTIMER, GetPlayerName(GetOwningPlayer(OURHERO)) )
      • Custom script: set WINDOW = GetLastCreatedTimerDialogBJ()
      • Custom script: call TimerDialogDisplayForPlayerBJ( true, WINDOW, GetOwningPlayer(OURHERO) )
      • Custom script: call PolledWait( HEROWAIT )
      • Custom script: call ReviveHeroLoc( OURHERO, GetPlayerStartLocationLoc(GetOwningPlayer(OURHERO)), true )
      • Custom script: call DestroyTimerDialog(WINDOW)
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
JASS:
function CreateTimerDialogBJ takes timer t, string title returns timerdialog
    set bj_lastCreatedTimerDialog = CreateTimerDialog(t)
    call TimerDialogSetTitle(bj_lastCreatedTimerDialog, title)
    call TimerDialogDisplay(bj_lastCreatedTimerDialog, true)
    return bj_lastCreatedTimerDialog
endfunction

displays the dialog on default.
 
Status
Not open for further replies.
Top