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

Revive System v1.1

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Revive System v1.1
This is a System similar like DotA, when a player hero died, it will
create a timer that shows the respawn time of the player hero.
Each level increases the respawn time by 5 seconds.


Actually not mine project,
thehelper.net, Ryoko.


*Increase respawn time can be change to whatever you like
*Respawn regions can be change also

I tried this system many times and i find no problems.

Any credits, bugs, problems or comments just post it here.


Keywords:
Revive, System, Hero, timer,
Contents

Revive System v1.1 (Map)

Reviews
16:18, 4th Mar 2011 Bribe: I can't see this getting an approval as Base's library is so much better as-is. It's Ryoko's submission, as well, it's not even yours :O Next time you submit something, make sure it's yours and also ... post the...

Moderator

M

Moderator

16:18, 4th Mar 2011
Bribe:

I can't see this getting an approval as Base's library is so much better as-is. It's Ryoko's submission, as well, it's not even yours :O

Next time you submit something, make sure it's yours and also ... post the triggers!

Status: Rejected
 
post the triggers please
-----------------------

this system is only useful because it saves time. Instead of writing the code, you could just download it from here and copy-paste it. (unless it's horrible)

I think it's AWESOME... Scratch that: HORRIBLE

I implemented this system from thehelper.net 7 months ago, but I had to do A LOT of modifications to it.

As "baassee" said, i had to null the timer and fix the location leak.
 
Last edited:
Level 22
Joined
Nov 14, 2008
Messages
3,256
  • 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, GetRectCenter(GetPlayableMapRect()), true )
      • Custom script: call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), GetUnitLoc(OURHERO), 0.60 )
      • Custom script: call DestroyTimerDialog(WINDOW)
No it's not useful at all because it is so wrong. I've made 2 easy systems that have 0 leaks and yet the best performance. Easy to implement to with a great GUI example.

Yet instead of advertsing, let me fix this crap in 2 seconds. For those of you who are way too GUI.

EDIT:

Copy this straight into the custom script section

JASS:
function PolledWaitFixed takes real dur returns nothing
    local timer t
    local real timeRemain
    if dur > 0. then
        set t = CreateTimer()
        call TimerStart(t, dur, false, null)
        loop
            set timeRemain = TimerGetRemaining(t)
            exitwhen timeRemain <= 0.
            if timeRemain > bj_POLLED_WAIT_SKIP_THRESHOLD then
                call TriggerSleepAction(0.1 * timeRemain)
            else
                call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
            endif
        endloop
        call DestroyTimer(t)
        set t = null
    endif
endfunction

function HeroRevive takes unit hero, real time returns nothing
    local unit h = hero
    local real t = time
    local real x = GetUnitX(h)
    local real y = GetUnitY(h)
    local timer tim = CreateTimer()
    local timerdialog td
    local player p = GetOwningPlayer(hero)
    call TimerStart(tim, t, false, null)
    set td = CreateTimerDialog(tim)
    if GetLocalPlayer() == p then
        call TimerDialogDisplay(td, true)
    endif
    call PolledWaitFixed(t)
    call ReviveHero(h, x, y, true)
    if GetLocalPlayer() == p then
        call PanCameraTo(x, y)
    endif
    set h = null
    call DestroyTimer(tim)
    set tim = null
    call DestroyTimerDialog(td)
    set td = null
endfunction

and then you will just need this function

  • Revive Hero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Custom script: call HeroRevive(GetTriggerUnit(), 15.)
 
Top