Timer Window Reference??

KILLJAW

New Member
Reaction score
0
> Set TempUnit1 = (Dying unit)

Any unit that dies, espectially while this trigger is waiting, will overwrite the variable...

Instead, forget the variable and work with "triggering unit".
Also, the "is a Hero" condition would be better on the trigger.


> Countdown Timer - Destroy (Last created timer window)

This is not necessarily the correct window...

Since setting a variable = dying unit will let the variable be overwritten any time a unit dies, I can rightfully assume that setting a variable = last created timer window would also be overwritten any time a new timer window is created, especially since I have the trigger wait for amounts of time, so how can I get the trigger to reference the proper window, even if a new window is created before the trigger is done waiting?

Here is my revised trigger, about which I am asking this question:
Code:
Hero Respawn
    Events
        Unit - A unit Dies
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Countdown Timer - Start RespawnTime[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 30.00 seconds
        Countdown Timer - Create a timer window for RespawnTime[(Player number of (Owner of (Triggering unit)))] with title ((Name of (Owner of (Triggering unit))) + 's Revival)
        Set RespawnWindow[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
        Wait 24.50 seconds
        Set TempPoint = (Center of Respawn <gen>)
        Camera - Pan camera for (Owner of (Triggering unit)) to TempPoint over 5.00 seconds
        Custom script:   call RemoveLocation(udg_TempPoint)
        Wait 5.50 seconds
        Set TempPoint = (Random point in Respawn <gen>)
        Hero - Instantly revive (Triggering unit) at TempPoint, Show revival graphics
        Countdown Timer - Destroy RespawnWindow[(Player number of (Owner of (Triggering unit)))]
        Custom script:   call RemoveLocation(udg_TempPoint)
 

WilliamPa

Active Member
Reaction score
51
I assume you want your heroes respawn in time, thou i didn't even read whole trigger... If there are multiple heroes for each player, this may be abit harder. You must store each unit in unit variable, i would create own variable for each player and then set the array to how many heroes the player has. Then add event the Hero_Var with array dies. Then create timer window variable with array. If the hero dies, create timer window, store it in Timer_Var and use the Hero_Var's variable and add event to respawn trigger, which is Timer_Var with array ends. Then revive Hero_Var and use the array of Timer_Var. It would be alot easier if each plr has only one hero, but i think u need for multiple heroes anyways...

E: Thou when i looked and u were new here :p i dno, if there are only 1 hero for each plr, use player number array.
E2: U must create timer window untill u can start it :D
 

KILLJAW

New Member
Reaction score
0
I am using a player number array, and there is only 1 hero per player. The problem is when i need to destroy the timer window, it is only after a wait for 5.5 seconds. Now if another hero were to have died before those 5.5 seconds were up, then the last created timer window would now be the owner of that hero and his window would be destroyed instead of the one that had just hit 0:00.
 

WilliamPa

Active Member
Reaction score
51
Store the window in Timer_Var variable, use array of player number and then delete Timer_Var with the player number array of owner of dying unit.
 

WilliamPa

Active Member
Reaction score
51
I am not home, but i try to handwrite :/

Code:
Events:
An unit dies.
Conditions:
((Dying unit) is a hero) equal to True
Actions:
        Countdown Timer - Create a timer window for RespawnTime[(Player number of (Owner of (Triggering unit)))] with title ((Name of (Owner of (Triggering unit))) + 's Revival)
Countdown Timer - Start RespawnTime[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 30.00 seconds
        Set RespawnWindow[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
        Set TempPoint = (Center of Respawn <gen>)
        Camera - Pan camera for (Owner of TempUnit1) to TempPoint over 5.00 seconds
        Wait 5.50 seconds
        Set TempPoint = (Random point in Respawn <gen>)
        Hero - Instantly revive (Triggering unit) at TempPoint, Show revival graphics
        Countdown Timer - Destroy RespawnWindow[(Player number of (Owner of (Triggering unit)))]
        Custom script:   call RemoveLocation(udg_TempPoint)

Oh, now when i looked closer, only thing wrong was that u created the window after u started it. I used ur actions to save time now. But if som plr gets another hero, this will start leaking propably, he might even lose other hero :p
 

KILLJAW

New Member
Reaction score
0
The players can never get more than 1 hero. The problem is, during the time the trigger is waiting, another hero might die, thus causing last created timer window to become that of the hero that just died, and since the variable for the timer window is set as the last created timer window, it will be overwritten in the variable. I also made a mistake posing the trigger in my first post (my bad). I fixed it there and I will post it here as well:

Code:
Hero Respawn
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Countdown Timer - Start RespawnTime[(Player number of (Owner of (Triggering unit)))] as a One-shot timer that will expire in 30.00 seconds
        Countdown Timer - Create a timer window for RespawnTime[(Player number of (Owner of (Triggering unit)))] with title ((Name of (Owner of (Triggering unit))) + 's Revival)
        Set RespawnWindow[(Player number of (Owner of (Triggering unit)))] = (Last created timer window)
        Wait 24.50 seconds
        Set TempPoint = (Center of Respawn <gen>)
        Camera - Pan camera for (Owner of Triggering unit) to TempPoint over 5.00 seconds
        Custom script:   call RemoveLocation(udg_TempPoint)
        Wait 5.50 seconds
        Set TempPoint = (Random point in Respawn <gen>)
        Hero - Instantly revive (Triggering unit) at TempPoint, Show revival graphics
        Countdown Timer - Destroy RespawnWindow[(Player number of (Owner of (Triggering unit)))]
        Custom script:   call RemoveLocation(udg_TempPoint)
 

WilliamPa

Active Member
Reaction score
51
Realize that you are not using "last created timer" after the wait, and it is pretty unnatural that two heroes die exactly at same time.
 

KILLJAW

New Member
Reaction score
0
They wouldn't have to die at exactly the same time. If at any time during the 24.50 second wait another hero died, then since the variable RespawnTime[(Player number of (Owner of (Triggering unit)))] was set to be equal to last created timer window, the hero that died during the wait would now have the last created timer window, and so when the trigger for the hero that died first is ordered to destroy the timer window for RespawnTime[(Player number of (Owner of (Triggering unit)))] it will destroy the last created timer window, as the variable is set to, thus destroying the timer window for the hero that died during the wait, and not the hero that died first, like i want it to.

My question is: How can i make it reference the timer window created when the first hero died, even if a hero belonging to another player died during the 24.50 or 5.50 second wait period and created another timer window in doing so?
 

WilliamPa

Active Member
Reaction score
51
When you set variable in the beginning, and the hero will never rez, it could still be same after the whole game. Also it is stored in player array and u are not running set variable action again, so it will not change! It stores that window what is last created on that time, and it will not change ever untill it's set again with the same array, which cannot be same untill plr has 2 heroes or there are 2 reds/blues etc.
 

KILLJAW

New Member
Reaction score
0
So you're saying that even if the variable is set to be last created timer window, and during the wait period, another timer window is created, since it's on it's own array, it won't be overwritten. (this is what I had hoped, but wasn't sure)
 

WilliamPa

Active Member
Reaction score
51
That is corect, as you are using game changable array, if it would be array 1 or somthin, it would be overwritten, but as it is player number array and there is only 1 hero, it won't be overwritten, now plz let this thread rest to it's grave :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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