Hero Revive System / Specail Events Help

EoW.chips

New Member
Reaction score
2
Hey,
first i will give u a short instruction of my map: 2 Teams a 5 players. Each player has 1 hero to pick.
Now i need a reive system that creates a timer that revives fallen heros at a center of position xy after 60 seconds.

But the heros can also be revived by a specail event. That means a hero has died, 30 seconds later a special event starts and the hero should be revived instantly than.

Hope you get what i mean.
Any ideas how to do that? Thanks for help
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
just add all the heroes to a group where you just pick all those units and revive them with the special event and then create a normal trigger that revives units after 30 seconds, on the special event, remove this trigger from the que, so it doesnt fire again after the unit is revived the first time
 

EoW.chips

New Member
Reaction score
2
I made this:

Trigger:
  • Red Hero Revive
    • Ereignisse
      • Einheit - A unit owned by Spieler 1 (Rot) Stirbt
    • Bedingungen
      • And - All (Conditions) are true
        • Bedingungen
          • (Unit-type of (Dying unit)) Ungleich Thorn /// Fertig
          • (Unit-type of (Dying unit)) Ungleich Ancient tauren /// Fertig
          • ((Dying unit) is Ein Held) Gleich True
    • Aktionen
      • Set HeroRed = (Dying unit)
      • Countdown-Timer - Create a timer window for TimerRed2 with title (Name of HeroRed)
      • Countdown-Timer - Start TimerRed2 as a Einmalig timer that will expire in 70.00 seconds
      • Set TimerRed = (Last created timer window)
      • Countdown-Timer - Verbergen TimerRed
      • Auslöser - Turn on Red Revive 2 <gen>
      • Countdown-Timer - Zeigen TimerRed for Spieler 1 (Rot)


And this trigger:

Trigger:
  • Red Revive 2
    • Ereignisse
      • Zeit - TimerRed2 expires
    • Bedingungen
      • (HeroRed is dead) Gleich True
    • Aktionen
      • Held - Instantly revive HeroRed at (Center of HeroCreaterHumans <gen>), Verbergen revival graphics
      • Countdown-Timer - Destroy TimerRed
      • Countdown-Timer - Verbergen TimerRed
      • Auslöser - Turn off (This trigger)


But this doesnt affect the special event, I thought about reducing the timer duration to 0.01 sec shortly before a special event starts... But i dunno how to change the Time of a Timer
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
start the same timer as a new one with 0.01 seconds, it just replaces the current time without stopping any events based off the trigger expiration
 

EoW.chips

New Member
Reaction score
2
Here for i tried this:

Trigger:
  • Instant Revive
    • Ereignisse
    • Bedingungen
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (HeroRed is dead) Gleich True
        • 'THEN'-Aktionen
          • Countdown-Timer - Destroy TimerRed
          • Countdown-Timer - Verbergen TimerRed
          • Countdown-Timer - Create a timer window for TimerRed2 with title (Name of HeroRed)
          • Countdown-Timer - Start TimerRed2 as a Einmalig timer that will expire in 0.10 seconds
          • Set TimerRed = (Last created timer window)
          • Countdown-Timer - Verbergen TimerRed
          • Countdown-Timer - Zeigen TimerRed for Spieler 1 (Rot)
        • 'ELSE'-Aktionen


But that doesnt work... The Timer runs to 0.00 but doesnt disappear :( Any idea ?
 

TheLegend

New Member
Reaction score
10
here is an universal revive system
JASS:
function Trig_Revive_Hero_Actions takes nothing returns nothing
    local timerdialog WINDOW
    local integer HEROWAIT
    local timer OURTIMER
    local unit OURHERO
    set OURHERO = GetDyingUnit()
    if ( IsUnitType(OURHERO, UNIT_TYPE_HERO) == true ) and ( GetPlayerController(GetOwningPlayer(OURHERO)) == MAP_CONTROL_USER ) then
        set HEROWAIT = 60
        set OURTIMER = CreateTimer()
        call StartTimerBJ( OURTIMER, false, ( I2R(HEROWAIT) ))
        call CreateTimerDialogBJ( OURTIMER, GetPlayerName(GetOwningPlayer(OURHERO)))
        set WINDOW = GetLastCreatedTimerDialogBJ()
        call TimerDialogDisplayBJ( false, WINDOW )
        call TimerDialogDisplayForPlayerBJ( true, WINDOW, GetOwningPlayer(OURHERO))
        call PolledWait( HEROWAIT )
        call ReviveHeroLoc(OURHERO, GetRectCenter(udg_RespawnPoint[GetConvertedPlayerId(GetOwningPlayer(OURHERO))]), true )
        call DestroyTimerDialog(WINDOW)
        call SelectUnitForPlayerSingle( OURHERO, GetOwningPlayer((OURHERO)))
    endif
endfunction

//===========================================================================
function InitTrig_Revive_Hero takes nothing returns nothing
    set gg_trg_Revive_Hero = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive_Hero, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_Revive_Hero, function Trig_Revive_Hero_Actions )
endfunction

just one thing udg_RespawnPoint[GetConvertedPlayerId(GetOwningPlayer(OURHERO))] is a variable named RespawnPoint and its an array of rects
This will work for as many heroes you want, it will not overwrite and bug, there is one small point leak but that wont be a problem
THIS CODE IS NOT MINE
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
my german isnt good enough to quite get what your doing there with everything
mind translating?

oh gross dude...
get rid of those bjs and repost that lol :p
all those red things are useless extra calls, click them and replace them with a version of whats inside
 

TheLegend

New Member
Reaction score
10
i already said it it aint mine :D, its Ryokos old tutorial on reviving, i just had one of his TD maps
 

EoW.chips

New Member
Reaction score
2
Ahh sry but i edit in GUI since i am to stupid to learn Jass....

Here it is translated

Trigger:
  • Red Hero Revive
    • Event
      • Unit - A unit owned by Player 1 (Red) dies
    • Conditions
      • And - All (Conditions) are true
        • Contdition
          • (Unit-type of (Dying unit)) Unequal Thorn
          • (Unit-type of (Dying unit)) Unequal Ancient tauren
          • ((Dying unit) is a Held) Equal True
    • Action
      • Set HeroRed = (Dying unit)
      • Countdown-Timer - Create a timer window for TimerRed2 with title (Name of HeroRed)
      • Countdown-Timer - Start TimerRed2 as a Once timer that will expire in 70.00 seconds
      • Set TimerRed = (Last created timer window)
      • Countdown-Timer - Hide TimerRed
      • Trigger - Turn on Red Revive 2 <gen>
      • Countdown-Timer - Show TimerRed for Player 1 (Red)


Trigger:
  • Red Revive 2
    • Events
      • Time - TimerRed2 expires
    • Condition
      • (HeroRed is dead) Equal True
    • Action
      • Hero - Instantly revive HeroRed at (Center of HeroCreaterHumans <gen>), Hide revival graphics
      • Countdown-Timer - Destroy TimerRed
      • Countdown-Timer - Hide TimerRed
      • Trigger - Turn off (This trigger)



Trigger:
  • Instant Revive
    • Event
    • Condition
    • Action
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Condition
          • (HeroRed is dead) Equal True
        • 'THEN'-Action
          • Countdown-Timer - Destroy TimerRed
          • Countdown-Timer - Hide TimerRed
          • Countdown-Timer - Create a timer window for TimerRed2 with title (Name of HeroRed)
          • Countdown-Timer - Start TimerRed2 as a Once timer that will expire in 0.10 seconds
          • Set TimerRed = (Last created timer window)
          • Countdown-Timer - Hide TimerRed
          • Countdown-Timer - Show TimerRed for Player 1 (Red)
        • 'ELSE'-Action



The last trigger here "instant Revive" is what i do 1 sec before the special event starts... But it doesnt work and i dont know why :(
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
JASS:
function Trig_Revive_Hero_Actions takes nothing returns nothing
    local timerdialog WINDOW
    local integer HEROWAIT
    local timer OURTIMER
    local unit OURHERO
    set OURHERO = GetDyingUnit()
    if ( IsUnitType(OURHERO, UNIT_TYPE_HERO) == true ) and ( GetPlayerController(GetOwningPlayer(OURHERO)) == MAP_CONTROL_USER ) then
        set HEROWAIT = 60
        set OURTIMER = CreateTimer()
        call TimerStart(OURTIMER, (I2R(HEROWAIT)), false, null)
        set bj_lastCreatedTimerDialog = CreateTimerDialog(OURTIMER)
        call TimerDialogSetTitle(bj_lastCreatedTimerDialog, GetPlayerName(GetOwningPlayer(OURHERO))
        call TimerDialogDisplay(bj_lastCreatedTimerDialog, false)
        set WINDOW = bj_lastCreatedTimerDialog
        if (GetLocalPlayer() == GetOwningPlayer(OURHERO)) then
            call TimerDialogDisplay(WINDOW, true)
        endif
        call PolledWait( HEROWAIT )
        call ReviveHeroLoc(OURHERO, Location(GetRectCenterX(udg_RespawnPoint[GetPlayerId(GetOwningPlayer(OURHERO))+1]), GetRectCenterY(udg_RespawnPoint[GetPlayerId(GetOwningPlayer(OURHERO))+1]), true )
        call DestroyTimerDialog(WINDOW)
        if (GetLocalPlayer() == GetOwningPlayer(OURHERO)) then
            call ClearSelection()
            call SelectUnit(OURHERO, true)
        endif
    endif
endfunction

//===========================================================================
function InitTrig_Revive_Hero takes nothing returns nothing
    set gg_trg_Revive_Hero = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive_Hero, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_Revive_Hero, function Trig_Revive_Hero_Actions )
endfunction


see how much less red there is?
polled wait is somewhat complex so i just left it as is, didnt change the event either, but all other red is gone

none of your triggers fire events off the expiration of TimerRed, only TimerRed2
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
i need to see the special event trigger before i can say exactly whats happening, can you post it?
in english please again lol :p
 

EoW.chips

New Member
Reaction score
2
Here it is:

Trigger:
  • Boss Stage 1 Check
    • Event
      • Time - Every 2.00 seconds of game time
    • Condition
      • And - All (Conditions) are true
        • Condition
          • (Number of units in (Units in (Playable map area) matching ((((Matching unit) is a building) equal False) and ((Owner of (Matching unit)) equal player 12 (Darkgreen))))) equal 0
          • (Number of units in (Units in (Playable map area) matching ((((Matching unit) is a building) equal False) and ((Owner of (Matching unit)) equal player 12 (Brown))))) equal 0
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- --------
      • -------- --------
      • Game - Display to (All players) the text: |cffFFCC00Hero even...
      • Trigger - Run Instant Revive <gen> (checking conditions)
      • Wait 20.00 seconds
      • -------- --------
      • -------- --------
      • Countdown-Timer - Create a timer window for TimerHeroDuell2 with title Time left,,,
      • Countdown-Timer - Start TimerHeroDuell2 as a Once timer that will expire in 240.00 seconds
      • Countdown-Timer - Show (Last created timer window)
      • Set HeroDuellTimer = (Last created timer window)
      • Set TimerCondition = 1
      • Gamel - Display to (All players) the text: |cffFFCC00Hero even...
      • Set WinningTeamItem = Frozen orb
      • Set WinningTeamGold = 750
      • Spielergruppe - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Hero - Make (Picked player) Heroes gain 0.00% experience from future kills
      • Trigger - Turn on Hero Dies <gen>
      • Playergroup - Pick every player in Humans and do (Actions)
        • Loop - Actions
          • Unitgroup - Pick every unit in (Units owned by (Picked player) matching (((Matching unit) is Ein Held) Gleich True)) and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to (Center of Team 1 Hero Arena <gen>)
              • Unit - Set life of (Picked unit) to 100.00%
              • Unit - Set mana of (Picked unit) to 100.00%
              • Unit - Reset ability cooldowns for (Picked unit)
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
and what is it that isnt working? have you tried a larger interval timer? i just realized how vague the "it doesnt work" sentence was, the more info you provide the easier it is to help you
 

EoW.chips

New Member
Reaction score
2
Okay, when a the hero of player Red is dead and the special event starts, the Timer which should expire in 0.10 seconds, runs to 0.00 seconds but doesnt disappear. So the revive trigger isnt working cuz the timer doesnt disappear.

Tried a higher value, changed value to 2 seconds... still doesnt work :(
 

TheLegend

New Member
Reaction score
10
the problem is that a timer's count down probably goes per second so try setting it to a integer
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
thats what i was meaning when i said to set it to something higher
try 1.00 seconds rather than 0.10
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top