Revival Timer

Revengez

New Member
Reaction score
1
They have to have: gg_rct_ in front of their name, and it should then be: Region_001, with 2 0's.

so:

gg_rct_Region_001 and gg_rct_Region_002


That's not the problem then. The timer still doesn't show up.

I used JASS Newgen on the previous script you posted. Is this updated? The last one gave me errors.
 

Kenny

Back for now.
Reaction score
202
Thats because of this:

JASS:
if GetLocalPlayer() == p then
    call ClearSelection()
    call SelectUnit(Heroes<i>,true)        
    call PanCameraToTimed(GetUnitX(Heroes<i>),GetUnitY(Heroes<i>),1.00)
endif
</i></i></i>


It pans the camera to the location of the revived unit. So if its panning to where your unit died, there must be something wrong with how it is detecting dying units.

Is there anything else in you map that revives or does anything similar to dead units?
 

Revengez

New Member
Reaction score
1
Thats because of this:

JASS:
if GetLocalPlayer() == p then
    call ClearSelection()
    call SelectUnit(Heroes<i>,true)        
    call PanCameraToTimed(GetUnitX(Heroes<i>),GetUnitY(Heroes<i>),1.00)
endif
</i></i></i>


It pans the camera to the location of the revived unit. So if its panning to where your unit died, there must be something wrong with how it is detecting dying units.

Is there anything else in you map that revives or does anything similar to dead units?


No. Nothing...

I found the problem.

It was the glitched backdoor system i added a long time ago. It still doesn't pan camera to where you revive though.

Anywho, thanks man. It's perfect.
 

Revengez

New Member
Reaction score
1
No. Nothing...

I found the problem.

It was the glitched backdoor system i added a long time ago. It still doesn't pan camera to where you revive though.

Anywho, thanks man. It's perfect.

It stopped working for some reason.
 

Kenny

Back for now.
Reaction score
202
Stopped working... Are you sure you didn't re-enable the backdoor system or something? Although, i forgot to add, this will only work properly if each player only has one unit...
 

Revengez

New Member
Reaction score
1
Stopped working... Are you sure you didn't re-enable the backdoor system or something? Although, i forgot to add, this will only work properly if each player only has one unit...

I didn't re-add anything. I tested it, it worked perfectly. I wont back to WE, edited a model, some soundsets, added some doodads, went back into testing. I died, the timer popped up, and i didn't respawn.
 

Kenny

Back for now.
Reaction score
202
JASS:
library HeroDies initializer Init

globals   
    private constant boolean ShowAll = true // If true, it will show all death timers to everyone. Good for testing purposes.
    public timerdialog array Dialogs // Don&#039;t touch.
    public timer array Timers        // Don&#039;t touch.
    public unit array Heroes         // Don&#039;t touch.
endglobals

//=======================================================================
private function Interval takes unit u returns integer
    return GetHeroLevel(u)*4 // Revive time.
endfunction

//=======================================================================
private function Update takes nothing returns nothing   
    local timer t = GetExpiredTimer() 
    local player p
    local integer i = 0
    
    loop
        exitwhen Timers<i> == t or i == 15
        set i = i + 1
    endloop
    
    if i == 15 then
        set t = null
        return
    endif
    
    set p = GetOwningPlayer(Heroes<i>)    
    call PauseTimer(t)
    call DestroyTimerDialog(Dialogs<i>)
    
    if (i &lt;= 5) then
        call ReviveHero(Heroes<i>,GetRectCenterX(gg_rct_Region_001),GetRectCenterY(gg_rct_Region_001),true)
    elseif (i &gt;= 7) then
        call ReviveHero(Heroes<i>,GetRectCenterX(gg_rct_Region_002),GetRectCenterY(gg_rct_Region_002),true)
    endif
    
    if GetLocalPlayer() == p then
        call ClearSelection()
        call SelectUnit(Heroes<i>,true)        
        call PanCameraToTimed(GetUnitX(Heroes<i>),GetUnitY(Heroes<i>),1.00)
    endif
    
    call SetUnitState(Heroes<i>,UNIT_STATE_LIFE,GetUnitState(Heroes<i>,UNIT_STATE_MAX_LIFE))        
    call SetUnitState(Heroes<i>,UNIT_STATE_MANA,GetUnitState(Heroes<i>,UNIT_STATE_MAX_MANA))


    call DestroyTimer(t)    
    set t = null
endfunction   

//=======================================================================
private function Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local player p = GetOwningPlayer(u)
    local integer i = GetPlayerId(p)
    
    set Timers<i> = CreateTimer()
    set Dialogs<i> = CreateTimerDialog(Timers<i>)
    call TimerDialogSetTitle(Dialogs<i>,&quot;Revive Time&quot;)    
    set Heroes<i> = u
    call TimerStart(Timers<i>,Interval(Heroes<i>),false,function Update)
    call TriggerSleepAction(0.00)
    
    if ShowAll then
        call TimerDialogDisplay(Dialogs<i>,true)
    else
        if GetLocalPlayer() == p then
            call TimerDialogDisplay(Dialogs<i>,true)
        endif
    endif
endfunction

//=======================================================================
private function Conditions takes nothing returns boolean
    return IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) == true 
endfunction

//=======================================================================
private function Init takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(trig,EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddCondition(trig,Condition(function Conditions))
    call TriggerAddAction(trig,function Actions)
endfunction

endlibrary

</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>



Try that maybe.
 

Revengez

New Member
Reaction score
1
I get an error.

adasdoj1.png
 
General chit-chat
Help Users

      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