timer?

X-maul

AKA: Demtrod
Reaction score
201
how do i create a timer if a hero die that will ekspire in 30 seconds??...
 
Events
Unit - A unit dies

Conditions
Dying unit is a Hero Equal to True

Actions
Start ReviveTimer as a one-shot timer that will expire in 30 seconds.

--------------------

ReviveTimer is a Timer variable.
 
Code:
timer1
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Countdown Timer - Start timer as a One-shot timer that will expire in 30.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title Revive in
        Countdown Timer - Show (Last created timer window)
        Set hero = (Triggering unit)
Code:
timer2
    Events
        Time - timer expires
    Conditions
    Actions
        Hero - Instantly revive hero at (Center of (Playable map area)), Show revival graphics

It uses 2 variables, hero is an unit variable and timer is a timer variable.
 
thx - but theres a proplem with it - when the timer ekspires there's just an timerwindow with 0 seconds:confused: how i get it removed?
 
the timer variable is an "timer (timer)" or an "timer window (timerdialog)"?
 
it doesnt works they still doesnt get destroyed - here is the trigger so you can see if there's something wrong -

Code:
    Events
        Unit - A unit owned by Player 3 (Teal) Dies
        Unit - A unit owned by Player 4 (Purple) Dies
        Unit - A unit owned by Player 5 (Yellow) Dies
        Unit - A unit owned by Player 6 (Orange) Dies
        Unit - A unit owned by Player 7 (Green) Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Countdown Timer - Start (Create a periodic One-shot timer lasting 30.00) as a One-shot timer that will expire in 30.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Triggering player))
        Countdown Timer - Show (Last created timer window)
        Set hero = (Triggering unit)
        Game - Display to (All players) the text: -------------------...
        Wait 30.00 seconds
        Countdown Timer - Destroy timer
        Camera - Pan camera for (Owner of (Dying unit)) to (Center of Rect 010 <gen>) over 0.00 seconds
        Special Effect - Create a special effect at (Center of Rect 010 <gen>) using Abilities\Spells\Other\Awaken\Awaken.mdl
        Hero - Instantly revive (Dying unit) at (Center of Rect 010 <gen>), Show revival graphics
        Special Effect - Create a special effect at (Center of Rect 010 <gen>) using Abilities\Spells\Demon\ReviveDemon\ReviveDemon.mdl
 
the marked one
Code:
    Events
        Unit - A unit owned by Player 3 (Teal) Dies
        Unit - A unit owned by Player 4 (Purple) Dies
        Unit - A unit owned by Player 5 (Yellow) Dies
        Unit - A unit owned by Player 6 (Orange) Dies
        Unit - A unit owned by Player 7 (Green) Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Countdown Timer - Start (Create a periodic One-shot timer lasting 30.00) as a One-shot timer that will expire in 30.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Triggering player))
        Countdown Timer - Show (Last created timer window)
        Set hero = (Triggering unit)
        Game - Display to (All players) the text: -------------------...
        Wait 30.00 seconds
        Countdown Timer - Destroy [B][FONT="Arial Black"]timer[/FONT][/B]
        Camera - Pan camera for (Owner of (Dying unit)) to (Center of Rect 010 <gen>) over 0.00 seconds
        Special Effect - Create a special effect at (Center of Rect 010 <gen>) using Abilities\Spells\Other\Awaken\Awaken.mdl
        Hero - Instantly revive (Dying unit) at (Center of Rect 010 <gen>), Show revival graphics
        Special Effect - Create a special effect at (Center of Rect 010 <gen>) using Abilities\Spells\Demon\ReviveDemon\ReviveDemon.mdl
 
the marked one
Code:
    Events
        Unit - A unit owned by Player 3 (Teal) Dies
        Unit - A unit owned by Player 4 (Purple) Dies
        Unit - A unit owned by Player 5 (Yellow) Dies
        Unit - A unit owned by Player 6 (Orange) Dies
        Unit - A unit owned by Player 7 (Green) Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Countdown Timer - Start timer as a One-shot timer that will expire in 30.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Triggering player))
        [U]Set Timer window = (last created timer window)[/U]
        Countdown Timer - Show (Last created timer window)
        Set hero = (Triggering unit)
        Game - Display to (All players) the text: -------------------...
        Wait 30.00 seconds
        Countdown Timer - Destroy [B][FONT="Arial Black"]timer[/FONT][/B]
        Camera - Pan camera for (Owner of (Dying unit)) to (Center of Rect 010 <gen>) over 0.00 seconds
        Special Effect - Create a special effect at (Center of Rect 010 <gen>) using Abilities\Spells\Other\Awaken\Awaken.mdl
        Hero - Instantly revive [B][FONT="Arial Black"]hero[/FONT][/B] at (Center of Rect 010 <gen>), Show revival graphics
        Special Effect - Create a special effect at (Center of Rect 010 <gen>) using Abilities\Spells\Demon\ReviveDemon\ReviveDemon.mdl


I've changed it now, it should work. Bold parts is where I've changed something, so change it so it looks like the bold part instead.
Underlined is where I've added something, so just add it too.
 
You didn't declare the timer; you got to split the trigger into two(waits are never accurate). First, create a timer that goes as far as before the wait. Set the Dying Unit into a Unit Array variable, and then create another trigger. Also make the timer and the window arrays to make it MPI, and add the events Timer[1],Timer[2]... expires. Add the actions 1 to number of players Integer A,
If Time Remaining In Timer[Integer A] equal to 0, then do the actions you want.
 
Code:
Set Timer window = (last created timer window)

the Timer Window is the variable?

hehe i really dont get it :p hehe
 
but when 2 heroes dies 1 in 10 seconds and 1 in 20 seconds when number 1's timer has expired number 2's timer will be destroyed and number 1's timer will stand still at 0 seconds

:eek::confused:
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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