Show a timer window to only one player

M

Mikechaos

Guest
god. Read my first post. It says i'm getting RoC and TFt like monday.

Anyway. Could u transfered it to custom script plz? (only the "show timer for player". I'll do the rest.

Tank you for all the helping up to know.
 

Anachron

New Member
Reaction score
53
My world editor is currently broken and may not open any longer but if you wait a few days for reinstalling the game by me.. ;)
 
M

Mikechaos

Guest
Well terror, could you transfer it in custom script plz?
 
M

Mikechaos

Guest
YOu didn't need to know jass, you just gotta do the trigger and convert it to custom script.

But like you said, thos both helped me perfecly and i'm posting to say that it worked exactly like i wanted!

So tank you very much
 
M

Mikechaos

Guest
OK so i now got TFT.
Someone asked me to do a timer like i did in my map.
He needed a timer that was shown when a hero died, so the owner of that hero could know when he would be back alive.

The problem is the time is show only to the first person dying. Others get a window Timer but with no time.

(ill give you bot trigger (gui and jass)) They are exactly the same.

here
GUI :
Code:
Hero die
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Countdown Timer - Create a timer window for revivetimer[(Player number of (Owner of (Triggering unit)))] with title Revive In
        Set ReviveWindow[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
        Countdown Timer - Hide EvilWindow
        Countdown Timer - Show ReviveWindow[(Player number of (Owner of (Triggering unit)))] for (Owner of (Triggering unit))
        Countdown Timer - Start revivetimer[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 60.00 seconds
        Game - Display to (Player group((Owner of (Triggering unit)))) for 60.00 seconds the text: Don't Worry, you wi...
        Wait 60.00 seconds
        Countdown Timer - Destroy ReviveWindow[(Player number of (Owner of (Triggering unit)))]
        Hero - Instantly revive (Triggering unit) at (Center of rez <gen>), Hide revival graphics
        Camera - Pan camera for (Owner of (Triggering unit)) to (Center of rez <gen>) over 1.00 seconds

Code:
Jass :
function Trig_Hero_die_Conditions takes nothing returns boolean
    if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Hero_die_Actions takes nothing returns nothing
    call CreateTimerDialogBJ( udg_revivetimer[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))], "TRIGSTR_306" )
    set udg_ReviveWindow[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = GetLastCreatedTimerDialogBJ()
    call TimerDialogDisplayBJ( false, udg_EvilWindow )
    call TimerDialogDisplayForPlayerBJ( true, udg_ReviveWindow[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))], GetOwningPlayer(GetTriggerUnit()) )
    call StartTimerBJ( udg_revivetimer[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))], false, 60.00 )
    call DisplayTimedTextToForce( GetForceOfPlayer(GetOwningPlayer(GetTriggerUnit())), 60.00, "TRIGSTR_307" )
    call TriggerSleepAction( 60.00 )
    call DestroyTimerDialogBJ( udg_ReviveWindow[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] )
    call ReviveHeroLoc( GetTriggerUnit(), GetRectCenter(gg_rct_rez), false )
    call PanCameraToTimedLocForPlayer( GetOwningPlayer(GetTriggerUnit()), GetRectCenter(gg_rct_rez), 1.00 )
endfunction

//===========================================================================
function InitTrig_Hero_die takes nothing returns nothing
    set gg_trg_Hero_die = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_die, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Hero_die, Condition( function Trig_Hero_die_Conditions ) )
    call TriggerAddAction( gg_trg_Hero_die, function Trig_Hero_die_Actions )
endfunction
 

Exide

I am amazingly focused right now!
Reaction score
448
I had the same problem recently.
This is what my trigger looks like:

JASS:

function Trig_Hero_Respawning_Func027C takes nothing returns boolean
    local integer id = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
    return id&lt;5
endfunction

function Trig_Hero_Respawning_Conditions takes nothing returns boolean
    if ( ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
        return true
    endif
    if ( Trig_Hero_Respawning_Func027C() ) then
        return true
    endif
    return false
endfunction

function Trig_Hero_Respawning_Actions takes nothing returns nothing
    local timer t = CreateTimer()
    local real time = 2.5
    local location loc = GetRectCenter(gg_rct_Hero_Respawn_Region)
    local player owner = GetOwningPlayer(GetTriggerUnit())
    local unit hero = GetTriggerUnit()
    local integer a = GetHeroLevel(hero)
    local integer time

    if a &lt;= 9 then
        set time = 15+(5*a)  
    else
        set time = 60
    endif

    call DisplayTimedTextToForce( udg_All_Players, 10.00, &quot; &quot; )
    call DisplayTimedTextToForce( udg_All_Players, 10.00, ( &quot;|cff32cd32&quot; + ( GetPlayerName(owner) + &quot;&#039;s Hero has been killed!|r&quot; ) ) )
    call DisplayTimedTextToForce( udg_All_Players, 10.00, ( &quot;|cff32cd32&quot; + ( GetPlayerName(owner) + ( &quot;&#039;s Hero will respawn in &quot; + ( I2S( time) + &quot; seconds!|r&quot; ) ) ) ) )
    call TimerStart( t,time,false,null )
    call CreateTimerDialogBJ( t, ( &quot;|cff32cd32&quot; + &quot;Hero respawn in:|r&quot; ) )
    set udg_Timer_Window[GetConvertedPlayerId(owner)] = GetLastCreatedTimerDialogBJ()
    call TimerDialogDisplayBJ( false, GetLastCreatedTimerDialogBJ() )
    call TimerDialogDisplayForPlayerBJ( true, GetLastCreatedTimerDialogBJ(), owner)
    call TriggerSleepAction( I2R( time) )
    call TimerDialogDisplayForPlayerBJ( true, GetLastCreatedTimerDialogBJ(), owner)
    call DestroyTimerDialogBJ( udg_Timer_Window[GetConvertedPlayerId(owner)] )
    call PanCameraToTimedLocForPlayer( owner, loc, 0 )
    call ReviveHeroLoc( hero, loc, true )
    call RemoveLocation( loc)
    set loc = null
    set hero = null
    set owner = null
endfunction

//===========================================================================
function InitTrig_Hero_Respawning takes nothing returns nothing
    set gg_trg_Hero_Respawning = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_Respawning, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_Hero_Respawning, Condition( function Trig_Hero_Respawning_Conditions ) )
    call TriggerAddAction( gg_trg_Hero_Respawning, function Trig_Hero_Respawning_Actions )
endfunction
 
M

Mikechaos

Guest
You mean that this trigger is now working? Or that its not and you wanna have help? lol
 

Exide

I am amazingly focused right now!
Reaction score
448
Yea, that's my trigger and it's working.
Thanks to a lot of help from others. :p

I thought you wanted help, so I showed you mine to compare.
Maybe I misunderstood everything.. :p
 
M

Mikechaos

Guest
Nope that's perfect.

I'm going to check your trigger and try to find out why mine isnt working.

Though could you explain me what you did for it to work or give me the link to your topic?
 

Exide

I am amazingly focused right now!
Reaction score
448

Drakethos

Preordered Sc2 ftw!
Reaction score
56
the easiest is
Code:
pick every player in player group matching conidtions: matching player is not owner of triggering unit
Loop action: hide counter for picked player
thats is a lot easier and requires no jass or varibles. Unless you want to remove the leak which is generated by the player group, but i wouldn't worry about it since you wont be using it that much.
 
M

Mikechaos

Guest
hmm that was last week problem, and if you look, at as been solved.
Read the second post on this page...
 
M

Mikechaos

Guest
Hmm Really? Did i asked something wrong lol? Cause its making one week and i have no answer..
 

Exide

I am amazingly focused right now!
Reaction score
448
As Dargoth put it: 'thats what you wanted so why you say it isnt?'
You replied: 'hmm that was last week problem, and if you look, at as been solved. Read the second post on this page...'

Second post was made by X.Terror.X, so I have no clue what your current problem is. :p

Would you mind telling us about, or create a new thread about the problem?
-Easier to try and help someone, that way. :p
 
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