Timer shows for all players ... =/

Troll

New Member
Reaction score
4
Code:
init 16
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set DyingHero = (Dying unit)
        Countdown Timer - Start ReviveTimer as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 5.00) seconds
        Countdown Timer - Create a timer window for (Last started timer) with title You will revive in:
        [B]Countdown Timer - Show (Last created timer window) for (Owner of DyingHero)[/B]        Wait ((Real((Hero level of DyingHero))) x 5.00) seconds
        Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Footmen Frenzy) and do (Actions)
            Loop - Actions
                Hero - Instantly revive DyingHero at (Position of (Picked unit)), Show revival graphics
                Unit - Set mana of DyingHero to 100.00%
                Camera - Pan camera for (Owner of DyingHero) to (Position of DyingHero) over 0.25 seconds
                Selection - Select DyingHero for (Owner of DyingHero)
        Countdown Timer - Destroy (Last created timer window)

i know where the problem is but, i dont know how to solve it.

how to "for" to "to" ...


btw if you want to develop my map ill give you it, i am really getting bored of it.
 

darkbeer

Beer is Good!
Reaction score
84
need the GetLocalPlayer() function:

Code:
init 16
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set DyingHero = (Dying unit)
        Countdown Timer - Start ReviveTimer as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 5.00) seconds
        Countdown Timer - Create a timer window for (Last started timer) with title You will revive in:
[COLOR="Red"]        CustomScript: if GetLocalPlayer() == GetOwningPlayer(udg_DyingHero) then
        Countdown Timer - Show (Last created timer window)
        CustomScript: endif[/COLOR]
        Wait ((Real((Hero level of DyingHero))) x 5.00) seconds
        Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Footmen Frenzy) and do (Actions)
            Loop - Actions
                Hero - Instantly revive DyingHero at (Position of (Picked unit)), Show revival graphics
                Unit - Set mana of DyingHero to 100.00%
                Camera - Pan camera for (Owner of DyingHero) to (Position of DyingHero) over 0.25 seconds
                Selection - Select DyingHero for (Owner of DyingHero)
        Countdown Timer - Destroy (Last created timer window)
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Hide it after creating it, then show it to your one player.

Countdown Timer - Create ...
Countdown Timer - Hide (Last created timer window)
Countdown Timer - Show (Last created timer window) for <some player>


> need the GetLocalPlayer() function

:banghead:
 

Troll

New Member
Reaction score
4
need the GetLocalPlayer() function:

Code:
init 16
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set DyingHero = (Dying unit)
        Countdown Timer - Start ReviveTimer as a One-shot timer that will expire in ((Real((Hero level of (Dying unit)))) x 5.00) seconds
        Countdown Timer - Create a timer window for (Last started timer) with title You will revive in:
[COLOR="Red"]        CustomScript: if GetLocalPlayer() == GetOwningPlayer(udg_DyingHero) then
        Countdown Timer - Show (Last created timer window)
        CustomScript: endif[/COLOR]
        Wait ((Real((Hero level of DyingHero))) x 5.00) seconds
        Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Footmen Frenzy) and do (Actions)
            Loop - Actions
                Hero - Instantly revive DyingHero at (Position of (Picked unit)), Show revival graphics
                Unit - Set mana of DyingHero to 100.00%
                Camera - Pan camera for (Owner of DyingHero) to (Position of DyingHero) over 0.25 seconds
                Selection - Select DyingHero for (Owner of DyingHero)
        Countdown Timer - Destroy (Last created timer window)

didnt work,


here is my optimized code with less leaks.


Code:
init 16
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set DYING_HERO = (Dying unit)
        Set HERO_DEATH_REVIVE_WAIT = ((Level of DYING_HERO) x 5)
        Countdown Timer - Start HERO_REVIVE_COUNTDOWN_TIMER as a One-shot timer that will expire in (Real(HERO_DEATH_REVIVE_WAIT)) seconds
        Countdown Timer - Create a timer window for (Last started timer) with title You will revive in:
        Wait (Real(HERO_DEATH_REVIVE_WAIT)) seconds
        Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Footmen Frenzy) and do (Actions)
            Loop - Actions
                Hero - Instantly revive DYING_HERO at (Position of (Picked unit)), Show revival graphics
                Unit - Set mana of DYING_HERO to 100.00%
                Camera - Pan camera for (Owner of DYING_HERO) to (Position of DYING_HERO) over 0.25 seconds
                Selection - Select DYING_HERO for (Owner of DYING_HERO)
        Countdown Timer - Destroy (Last created timer window)


anyways, any can help me tru this ?
 

Troll

New Member
Reaction score
4
didnt work,


here is my optimized code with less leaks.


Code:
init 16
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set DYING_HERO = (Dying unit)
        Set HERO_DEATH_REVIVE_WAIT = ((Level of DYING_HERO) x 5)
        Countdown Timer - Start HERO_REVIVE_COUNTDOWN_TIMER as a One-shot timer that will expire in (Real(HERO_DEATH_REVIVE_WAIT)) seconds
        Countdown Timer - Create a timer window for (Last started timer) with title You will revive in:
        Wait (Real(HERO_DEATH_REVIVE_WAIT)) seconds
        Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Footmen Frenzy) and do (Actions)
            Loop - Actions
                Hero - Instantly revive DYING_HERO at (Position of (Picked unit)), Show revival graphics
                Unit - Set mana of DYING_HERO to 100.00%
                Camera - Pan camera for (Owner of DYING_HERO) to (Position of DYING_HERO) over 0.25 seconds
                Selection - Select DYING_HERO for (Owner of DYING_HERO)
        Countdown Timer - Destroy (Last created timer window)


anyways, any can help me tru this ?


bump.
 

Troll

New Member
Reaction score
4
lol, i already done all what replies said ... i said it failed

and i don't know how to use scripts, i don't know jass or w/e it is.
 

Romek

Super Moderator
Reaction score
964
Read this post.
And actually read it. Don't just skim-read it and say you've read it and it didn't work.
 

Troll

New Member
Reaction score
4
Read this post.
And actually read it. Don't just skim-read it and say you've read it and it didn't work.


i already done it?

Countdown Timer - Create ...
Countdown Timer - Hide (Last created timer window)
Countdown Timer - Show (Last created timer window) for <some player>

so, it will still show the timers for all players, where i am suposed to use the getlocal thing?


how should it look like? i dont know anything about scripts lol, dont tell me to make an script myself.
 

Romek

Super Moderator
Reaction score
964
Hiding it for all players and then showing it for one player should work.
I really see no reasons why it shouldn't.

Show Timer Window for all players actually uses GetLocalPlayer() in the BJ.
So no need for scripts of your own there.
 

Troll

New Member
Reaction score
4
Hiding it for all players and then showing it for one player should work.
I really see no reasons why it shouldn't.

Show Timer Window for all players actually uses GetLocalPlayer() in the BJ.
So no need for scripts of your own there.



Code:
init 16
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set DYING_HERO = (Dying unit)
        Set HERO_DEATH_REVIVE_WAIT = ((Level of DYING_HERO) x 5)
        Countdown Timer - Start HERO_REVIVE_COUNTDOWN_TIMER as a One-shot timer that will expire in (Real(HERO_DEATH_REVIVE_WAIT)) seconds
        Countdown Timer - Create a timer window for (Last started timer) with title You will revive in:
        Countdown Timer - Hide (Last created timer window)
        Countdown Timer - Show (Last created timer window) for (Owner of DYING_HERO)
        Wait (Real(HERO_DEATH_REVIVE_WAIT)) seconds
        Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit)) of type Footmen Frenzy) and do (Actions)
            Loop - Actions
                Hero - Instantly revive DYING_HERO at (Position of (Picked unit)), Show revival graphics
                Unit - Set mana of DYING_HERO to 100.00%
                Camera - Pan camera for (Owner of DYING_HERO) to (Position of DYING_HERO) over 0.25 seconds
                Selection - Select DYING_HERO for (Owner of DYING_HERO)
        Countdown Timer - Destroy (Last created timer window)


it worked i think, tested but, now, if an enemy hero dies, and i die after he died, it will only revive me but not the enemy? maybe its for the variables? shit i toug hthey were right ... why are they screwing o.0
 

Nexor

...
Reaction score
74
it's because the wait, or it can be that you set the DYING_HERO variable to the last died Hero, so if another hero dies when the first is still reviving the first will be overwritten.
 

Troll

New Member
Reaction score
4
it's because the wait, or it can be that you set the DYING_HERO variable to the last died Hero, so if another hero dies when the first is still reviving the first will be overwritten.



how do you fix it?
 

Troll

New Member
Reaction score
4
Replace that variable with "Triggering unit", that should do it already.

Code:
init 16
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Set DYING_HERO = (Triggering unit)
        Set HERO_DEATH_REVIVE_WAIT = ((Level of DYING_HERO) x 5)
        Countdown Timer - Start HERO_REVIVE_COUNTDOWN_TIMER as a One-shot timer that will expire in (Real(HERO_DEATH_REVIVE_WAIT)) seconds
        Countdown Timer - Create a timer window for (Last started timer) with title You will revive in:
        Countdown Timer - Hide (Last created timer window)
        Countdown Timer - Show (Last created timer window) for (Owner of DYING_HERO)
        Wait (Real(HERO_DEATH_REVIVE_WAIT)) seconds
        Unit Group - Pick every unit in (Units owned by (Owner of DYING_HERO) of type Footmen Frenzy) and do (Actions)
            Loop - Actions
                Hero - Instantly revive DYING_HERO at (Position of (Picked unit)), Show revival graphics
                Unit - Set mana of DYING_HERO to 100.00%
                Camera - Pan camera for (Owner of DYING_HERO) to (Position of DYING_HERO) over 0.25 seconds
                Selection - Select DYING_HERO for (Owner of DYING_HERO)
        Countdown Timer - Destroy (Last created timer window)

didnt work, the enemy hero doesnt revive, but i do, it pans the camera twice too for me.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top