Help with a countdown trigger!

Da_HP_Geek

New Member
Reaction score
8
I suppose that this trigger leaks, and is it MUI? I can't see if it works for other than myself...

Trigger:
  • Revive Initialization
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
      • Unit - A unit owned by Player 2 (Blue) Dies
      • 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
      • Unit - A unit owned by Player 8 (Pink) Dies
      • Unit - A unit owned by Player 9 (Gray) Dies
      • Unit - A unit owned by Player 10 (Light Blue) Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
          • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
        • Then - Actions
          • Countdown Timer - Create a timer window for ReviveTimer[(Player number of (Owner of (Triggering unit)))] with title ((Name of (Owner of (Triggering unit))) + revives in)
          • Set ReviveTimerWindow[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
          • Countdown Timer - Start ReviveTimer[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 30.00 seconds
          • Countdown Timer - Show ReviveTimerWindow[(Player number of (Owner of (Triggering unit)))]
          • Game - Display to (Player group((Owner of (Dying unit)))) the text: |Cffff0000Your hero...
        • Else - Actions
 

Komaqtion

You can change this now in User CP.
Reaction score
469
First, either use this event:
Trigger:
  • Unit - A unit Dies


And leave these conditions as they are:
Trigger:
  • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
    • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)


Or use your events and remove those two conditions :D

But this should still work for others too :D And no leaks ;)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Code:
Game - Display to (Player group((Owner of (Dying unit)))) the text: |Cffff0000Your hero...
is a leak. instead of using (Player group((Owner of (Dying unit)))) use a playergroup variable.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
creating a player group is just the same as creating a unit group. by creating a group you use memory and by not destroying it after it was used you lose that memory.
only exceptions are (all players) because this player group is already made, destroying it would cause bugs.

(if you dont know how to destroy playergroups with GUI its "call DestroyForce (udg_xxx))
 

Da_HP_Geek

New Member
Reaction score
8
I removed all that stuffs with the message, but now I got an other problem... The count down timer only works for player 1...

Trigger:
  • Revive Initialization
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
          • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
        • Then - Actions
          • Countdown Timer - Create a timer window for ReviveTimer[(Player number of (Owner of (Triggering unit)))] with title ((Name of (Owner of (Triggering unit))) + revives in)
          • Set ReviveTimerWindow[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
          • Countdown Timer - Start ReviveTimer[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 30.00 seconds
          • Countdown Timer - Show ReviveTimerWindow[(Player number of (Owner of (Triggering unit)))]
        • Else - Actions
 

Komaqtion

You can change this now in User CP.
Reaction score
469
First, remove the if, and move the conditions with "((Triggering unit) is A Hero) Equal to True" :D

Also, how did you test if it works for more than player 1 ??
 

Da_HP_Geek

New Member
Reaction score
8
Well, I see the other players name, but not the countdown when I am player 1. Just my own, and when I am an other player, it still jsut work for player 1...
 

deebee

New Member
Reaction score
15
Trigger:
  • Revive Initialization
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
      • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
    • Actions
      • Countdown Timer - Create a timer window for ReviveTimer[(Player number of (Owner of (Triggering unit)))] with title ((Name of (Owner of (Triggering unit))) + revives in)
      • Set ReviveTimerWindow[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
      • Countdown Timer - Start ReviveTimer[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 30.00 seconds
      • Countdown Timer - Show ReviveTimerWindow[(Player number of (Owner of (Triggering unit)))]


You can just do that as well. What is the size of those Timer arrays?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
Just a note on leaks. All Players does not leak. Also, do not try to call DestroyForce on it, or you will be in trouble. That is all.
 

LordXavier

TH.net Regular
Reaction score
16
it is MPI. has leaks (others already pointed them out). another thing, in my opinion (just makes it look nicer in game) you should put the
Trigger:
  • Countdown Timer - Show
before the
Trigger:
  • Countdown Timer - Start
 

Da_HP_Geek

New Member
Reaction score
8
Like this then?

Trigger:
  • Revive Initialization
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Triggering unit) is A Hero) Equal to True
          • (Owner of (Triggering unit)) Not equal to Player 11 (Dark Green)
          • (Owner of (Triggering unit)) Not equal to Player 12 (Brown)
    • Actions
      • Countdown Timer - Create a timer window for ReviveTimer[(Player number of (Owner of (Triggering unit)))] with title ((Name of (Owner of (Triggering unit))) + revives in)
      • Set ReviveTimerWindow[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
      • Countdown Timer - Show ReviveTimerWindow[(Player number of (Owner of (Triggering unit)))]
      • Countdown Timer - Start ReviveTimer[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 30.00 seconds


But its still something wrong, it wont cool down... Shall I do one for each player?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, are you sure the array of the timer has a size of 12 ??? :S
 

Da_HP_Geek

New Member
Reaction score
8
U mean the ReviveTimerWindow? But why would it make any diffrence if I had 12 arrays, cause I only use it one time... So 1 for each player?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yepp, one for each player... And you still use 12 (Yes, 1 at a time but player 1 uses the first, and pleyer 2 the second so it becomes more)
 
General chit-chat
Help Users
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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