trigger malfunctions after waiting over 60 seconds

seansucks

New Member
Reaction score
0
for some reason, on my creep revive system.
i have it set to 60 seconds, all units appear like they're supposed to after death. but when i make it more than 60 seconds, (i.e. 120, 150, etc) they don't come back after the timer is up. and i checked all my other triggers, i just sat there waiting at the respawn point and nothing. nothing is interfering with the wait trigger. and i searched the forums but i didn't find anything about this really. is there a maximum time to the wait trigger? can i double the wait trigger? so it's like wait 60 seconds, and when the timer runs out, wait another 60 seconds?

what do i do!
 

Tom Jones

N/A
Reaction score
437
Post your trigger by right clicking the trigger name in the trigger functions window, then chose copy as text, and then paste the text inside either a [noparse]
Trigger:
[/noparse] or [noparse]
Code:
[/noparse] tag.

Trigger:
  • This is a wc3 tag.


Code:
This is a code tag.
 

seansucks

New Member
Reaction score
0
i don't think that will solve anything since the trigger already functions, it just stops working after 60 secons. but i'll post it anyways.

here's the getting point trigger. which gets the position of the creep and stores its custom value.

Trigger:
  • Get Respawn Position
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Set Integer_R = (Integer_R + 1)
          • Unit - Set the custom value of (Picked unit) to Integer_R
          • Set Point_CR[Integer_R] = (Position of (Picked unit))


here is the trigger that spawns the creep

Trigger:
  • Creep Respawn Trigger
    • Events
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
      • (Triggering unit) Not equal to (Summoned unit)
    • Actions
      • Wait 60.00 seconds
      • Unit - Create 1 (Unit-type of (Triggering unit)) for Player 12 (Brown) at Point_CR[(Custom value of (Triggering unit))] facing Default building facing degrees
      • Unit - Set the custom value of (Last created unit) to (Custom value of (Triggering unit))
 

svenski

New Member
Reaction score
1
Your creep revive trigger isn't multi-instancable. This is the revive trigger ripped straight from the downloadable DotA Template map (which you should DL and check out if you wanna see more usefull easy map-setup triggers):

JASS:
function Trig_Revive_Creeps_Actions takes nothing returns nothing
    local integer CUSTOM
    set CUSTOM = GetUnitUserData(GetDyingUnit())
    call TriggerSleepAction( udg_Hostile_Revive_Time )
    call CreateNUnitsAtLoc( 1, udg_Creep_Types[CUSTOM], Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Creep_Positions[CUSTOM], bj_UNIT_FACING )
    call SetUnitUserData( GetLastCreatedUnit(), CUSTOM )
endfunction

//===========================================================================
function InitTrig_Revive_Creeps takes nothing returns nothing
    set gg_trg_Revive_Creeps = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Creeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_Revive_Creeps, function Trig_Revive_Creeps_Actions )
endfunction


See the local integer variable? That is being stored each time a unit from player 12 (...neutral hostile in this case) dies. Then the trigger waits the revive time, and respawns the unit using that locally stored custom value (which is being overwritten each time a trigger unit dies in your trigger). I'm shocked you noticed your trigger working at all.

At least i think that's the problem....
 

Tom Jones

N/A
Reaction score
437
Have you messed with the gameplay constants? In particular the ones concerning decay time, and specifically the Bone one.
 

seansucks

New Member
Reaction score
0
Have you messed with the gameplay constants? In particular the ones concerning decay time, and specifically the Bone one.

no, i haven't messed with any of those in specific, some gameplay constants yes, but it didn't give me a problem until i extended it past 60 seconds, when i reset it back to 60 seconds it works fine.

and svenski i don't understand anything when it comes to jass, i need that broken down a little bit more.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
Ummm, isn't "Triggering Unit" lost after long waits?
 

svenski

New Member
Reaction score
1
no, i haven't messed with any of those in specific, some gameplay constants yes, but it didn't give me a problem until i extended it past 60 seconds, when i reset it back to 60 seconds it works fine.

and svenski i don't understand anything when it comes to jass, i need that broken down a little bit more.

weird... Well you get that "JASS" trigger if you simply select your trigger, right click it, and do CONVERT TO CUSTOM TEXT. Your trigger would then look very similar to the one I posted there.

Basically the best way to fix your problem (and the leaks you're creating by picking all the units in the map area) is to replace your current triggers with these:

Trigger:
  • Actions
    • Set LoopCreep = 0
    • Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
      • Loop - Actions
        • Set Creep_Types[LoopCreep] = (Unit-type of (Picked unit))
        • Set Creep_Positions[LoopCreep] = (Position of (Picked unit))
        • Unit - Set the custom value of (Picked unit) to LoopCreep
        • Set LoopCreep = (LoopCreep + 1)
    • Custom script: call DestroyGroup(bj_lastCreatedGroup)


These actions can be triggered to run at map initialization if all your neutrals are there, or, whenever you have your neutrals spawn, run these actions to save all their type and locations. You can see this is much like your trigger, but it doesn't have a "group leak" (a memory leak created when you don't destroy the unit group created by the Pick every unit in (units owned by neutral hostile...) and do actions....). Have the respawn trigger be the same as the one i pasted earlier, namely:

JASS:
function Trig_Revive_Creeps_Actions takes nothing returns nothing
    local integer CUSTOM
    set CUSTOM = GetUnitUserData(GetDyingUnit())
    call TriggerSleepAction( udg_Hostile_Revive_Time )
    call CreateNUnitsAtLoc( 1, udg_Creep_Types[CUSTOM], Player(PLAYER_NEUTRAL_AGGRESSIVE), udg_Creep_Positions[CUSTOM], bj_UNIT_FACING )
    call SetUnitUserData( GetLastCreatedUnit(), CUSTOM )
endfunction

//===========================================================================
function InitTrig_Revive_Creeps takes nothing returns nothing
    set gg_trg_Revive_Creeps = CreateTrigger(  )
    call TriggerRegisterPlayerUnitEventSimple( gg_trg_Revive_Creeps, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddAction( gg_trg_Revive_Creeps, function Trig_Revive_Creeps_Actions )
endfunction


If you can't see the resemblance between this trigger and a GUI trigger, try converting this trigger to custom text...

Trigger:
  • Revive Creeps GUI
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
    • Actions
      • Set CUSTOM = (Custom value of (Dying unit))
      • Wait Hostile_Revive_Time seconds
      • Unit - Create 1 Creep_Types[CUSTOM] for Neutral Hostile at Creep_Positions[CUSTOM] facing Default building facing degrees
      • Unit - Set the custom value of (Last created unit) to CUSTOM



That above trigger is EXACTLY the same as the JASS trigger, except the integer CUSTOM is being stored as a local variable, which is allowed in multiple instances.

EDIT: Note that this trigger uses "Hostile_Revive_Time" as your concerning wait time, and i'm pretty sure there is no wait cap in the game. Again, this method of using custom script works because it stores the unit's index at the moment it dies, then does the wait action. Your trigger doesn't do that because you're waiting without setting a reference to which unit died.. I think Bob is right when he says that gets lost when the wait action is called in your trigger.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
no, i haven't messed with any of those in specific, some gameplay constants yes, but it didn't give me a problem until i extended it past 60 seconds, when i reset it back to 60 seconds it works fine.

and svenski i don't understand anything when it comes to jass, i need that broken down a little bit more.

That's because there are gameplay constants telling the editor how long after a unit dies to remove it (heroes are ignored). If the units are removed before your Wait expires, the unit will no longer exist, and so your trigger will malfunction.

You can either increase the decay time (make it more than the revive time), use local variables, or use an array stack to store the information of the unit when it dies.
 

seansucks

New Member
Reaction score
0
That's because there are gameplay constants telling the editor how long after a unit dies to remove it (heroes are ignored). If the units are removed before your Wait expires, the unit will no longer exist, and so your trigger will malfunction.

You can either increase the decay time (make it more than the revive time), use local variables, or use an array stack to store the information of the unit when it dies.

that's it. thank you very much. the decay time on the bones was 88 seconds, which is why when i'd set it to 120 it wouldn't work but it'd work at 60 seconds.

problem solved in a simple fashion +rep
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 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

      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