• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

why this triggers leak?

Status
Not open for further replies.
Level 11
Joined
Aug 23, 2010
Messages
663
  • Negative Clock
    • Events
  • Unit - a unit begin casting an ability
    • Conditions
  • [Ability being cast] equal to negative clock
    • Actions
  • Pause [targeted unit of ability being cat]
  • Effect -Set [targeted unit of ability being cast] animation into 0 with [150,150,150] tint and [0] vertex coloring
  • Wait - wait 3 second.
  • Unpause [targeted unit of ability being cast]
  • Effect - set [targeted unit of ability being cast] unit animation into 100% with ]250,250,250] tint and [0] vertex coloring
This trigger sometime leak and I don't know why... :( anyone help me please.
Note: I am writing this trigger on my handphone, so apologize if it was inaccurate. I'll update later in midnight, because right now I'm in school and I was busy all day, except midnight.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
how do you know that it leaks.....

also, target unit of ability being cast doesnt work after a wait
 
Level 11
Joined
Aug 23, 2010
Messages
663
"how do you know that it leaks....."

It sometime make the target freeze forever, and sometime make the animation of the target unit freeze.

"also, target unit of ability being cast doesn't work after a wait"

Really? I think it worked, because it do freeze the enemy.

"if you're using Effect and not remove it then it will leak, but I dont think its Effect but Animation - Change Unit Vertex Coloring which shouldn't leak..."
I was removing it. But sometime when AI use this ability the "freeze the target forever" leak is sometime triggered by itself.
@supergood: I'm not using ingame time, I think.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Create a unit variable called unit
  • Untitled Trigger 009
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Holy Light
    • Actions
      • Custom script: local unit u = GetSpellTargetUnit()
      • Custom script: set udg_unit = u
      • Unit - Pause unit
      • Animation - Change unit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Wait 2.00 seconds
      • Custom script: set udg_unit = u
      • Unit - Unpause unit
      • Animation - Change unit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Custom script: set u = null
 
Level 11
Joined
Aug 23, 2010
Messages
663
That has nothing to do with leaks. That is a bug.

It would only leak if you use the PolledWait instead of TriggerSleepAction as PolledWait does leak a handle index due to not nulling a local defined local timer.

How to fix the bug?


@Maker : something odd is happening. see the pic :( oh and here's the trigger... because you say that i need to create variable unit i create it.
  • Jam Negatif
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Negative Clock
    • Actions
      • Set Unit = (Target unit of ability being cast)
      • Custom script: local unit u = GetSpellTargetUnit()
      • Custom script: set udg_unit = u
      • Unit - Pause Unit
      • Animation - Change Unit's vertex coloring to (50.00%, 50.00%, 50.00%) with 24.00% transparency
      • Wait 3.00 seconds
      • Unit - Unpause Unit
      • Animation - Change Unit's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Custom script: set u = null
@Meticulous : i'm sorry, but i dont get it about what you're saying :confused:
 

Attachments

  • ErrorSyntax.PNG
    ErrorSyntax.PNG
    31.6 KB · Views: 86
Level 19
Joined
Aug 8, 2007
Messages
2,765
First, put this code into your map header

JASS:
function PolledWait2 takes real duration returns nothing
local real timeRemaining
local real st=TimerGetElapsed( bj_gameStartedTimer)
if st <= 0 then
set bj_gameStartedTimer = CreateTimer()
call TimerStart(bj_gameStartedTimer, 1000000, false, null)
endif
if (duration > 0) then
loop
set timeRemaining = duration - TimerGetElapsed( bj_gameStartedTimer) + st
exitwhen timeRemaining <= 0
if (timeRemaining > bj_POLLED_WAIT_SKIP_THRESHOLD) then
call TriggerSleepAction(0.1 * timeRemaining)
else
call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
endif
endloop
endif
endfunction

than instead of Wait (x) do

CustomScript : call PolledWait2(YourTimeToWaitFor.) (you need the . )
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
you need to put that local on top of the trigger and you didnt follow Maker's trigger btw, the idea behind it is creating a local variable coz it will be executed even if there are waits within a function, thus making your spell MUI, after the wait you need to "set udg_unit = u" to point the local to a global variable...

some spells will do an infinite loop when you pause after you casted the spell, that's why it freezes the caster forever, provided that mana is still available...
 
Level 11
Joined
Aug 23, 2010
Messages
663
@mckill : I actually follow what he say. But add variable on top the custom scripts and edit the animation thingy and wait a little bit. Are you informing that I should put those custom scripts. Atop the variable I create or I should delete it (I've try delete the variable, but my map can't be played because the WE say there's a syntax error)? Actually the caster does not get freezing forever, only the target is. But it was a really rare bug, I only get this bug twice when I test it. Maybe I am going to post the map included with the trigger and ability, if anyone willing to see it. Oh almost forgot, I don't know if this might help you guys solve my problem, but I think I should tell. I use JassNewGenPack.
@supergood and illidan : I'm so sorry, but for some reason jass that I create or copy are just being shitty sometime :( so maybe I can't use jass...
@Justify : is a variable line really make a bug? :eek:
 
Status
Not open for further replies.
Top