Multiple Hero Revive After Timer

  • Thread starter Thread starter kii064
  • Start date Start date
K

kii064

Guest
Okay, so I initially had a one hero revival trigger:

Code:
    Events
        Unit - A unit owned by Player 7 (Green) Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Countdown Timer - Start ReviveHero7 as a One-shot timer that will expire in HeroReviveTime seconds
        Countdown Timer - Create a timer window for (Last started timer) with title ((Name of (Triggering player)) + (Evil))
        Countdown Timer - Change the color of the title for (Last created timer window) to (0.00%, 90.00%, 0.00%) with 0.00% transparency
        Set MsgTimerWindow[(Player number of (Triggering player))] = (Last created timer window)
        Set HeroToRevive[7] = (Triggering unit)
        Set Text = (Your hero will automatically revive in  + ((String((Integer(HeroReviveTime)))) +  seconds.))
        Trigger - Run DoTextColor <gen> (ignoring conditions)
        Game - Display to (Player group((Owner of (Triggering unit)))) for 10.00 seconds the text: TextColored
        Wait HeroReviveTime seconds
        Set i = 7
        Countdown Timer - Destroy MsgTimerWindow[i]
        Hero - Instantly revive HeroToRevive[i] at (Center of BadPlace <gen>), Show revival graphics
        Camera - Pan camera for (Player(i)) to (Center of BadPlace <gen>) over 1.00 seconds
        Game - Display to (All players) the text: ((PlayerColor[i] + ((Name of (Player(i))) + |r)) + 's hero has revived.)
        Unit - Set mana of HeroToRevive[i] to 100.00%

But then I decided to have more than one hero available, and it doesn't work exactly... When my first hero dies, it's fine, but when my second hero dies, the trigger restarts and ignores the first hero that died. You still see the timer for the first hero, but when it reaches zero, the timer stays there and nothing happens. When the timer for the second hero finishes, that second hero revives. The first hero is forever lost...
Can someone help?
 
Can you increase the text size? :D I can't read it.
 
Set HeroToRevive[7] = (Triggering unit)

That's the problem right there, when another unit dies that is owned by player 7 and is a hero that second death will overwrite the first hero that died and put into this variable. I would replace the HeroToRevive[] with a 'local unit HeroToRevive', that way each copy of the trigger will have its own variable and nothing will be overwriten. =]
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Real users can't really disable Javascript anymore these days.
  • Ghan Ghan:
    The internet is broken without it.
  • Ghan Ghan:
    Bot readable, not human usable.
  • The Helper The Helper:
    got it
  • The Helper The Helper:
    Happy Thursday!
  • The Helper The Helper:
    Check out the new Featured Content feature we apparently got with the forum software upgrade! https://www.thehelper.net/featured/
  • The Helper The Helper:
    Also on the bottom right side bar we now have a Trending Content Box!
    +1
  • The Helper The Helper:
    Not on the Headline News page just on the Forums page can we get that Featured and Trending on the home page?
  • Ghan Ghan:
    Since the home page is technically a forum, it now shows on all forum views. Still in the sidebar.
    +1
  • The Helper The Helper:
    Happy Friday! Hope everyone has a fantastic day and an even better weekend!
  • The Helper The Helper:
    Happy Sunday!
  • The Helper The Helper:
    I lovc that I can post webp and X links now! :)
  • The Helper The Helper:
    Happy Thursday!
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top