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.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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