does anything here leak??

INCINERATE

New Member
Reaction score
12
i got a couple of quick questions, as i am going threw every code i have to make map perform better.

does this leak ?

Trigger:
  • Abominationslowaura
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Abomination
    • Actions
      • If ((Issued order) Equal to (Order(immolation))) then do (Unit - Add Rot (Slow) to (Triggering unit)) else do (Do nothing)
      • If ((Issued order) Equal to (Order(unimmolation))) then do (Unit - Remove Rot (Slow) from (Triggering unit)) else do (Do nothing)



and this ?

Trigger:
  • AHHFRESHMEAT
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Dismember
    • Actions
      • Sound - Play BUTCHER_ENG <gen>



and lastly , a jass one , does this jass spell leak? , i did not make this jass spell , only imported it . Credit the owner if your going to use it please.

JASS:
/*
    water vortex v1.02b by scorpion182
    requires:
    timer utils, bound sentinel, xedamage, xefx by Vexorian
    grouputils by Rising_Dusk
*/

library WaterVortex requires TimerUtils, GroupUtils, xefx, xedamage, BoundSentinel
    private keyword data //don't touch this
//---------------------------------------------------------------------------------------------
//--------------CALIBRATION SECTION------------------------------------------------------------
    globals
        private constant integer SPELL_ID='pety' //ability rawcode
        private constant string ORDER_ID="starfall" //ability order string
        private constant integer MAXMISSCOUNT=50 // keep this value higher than number of GetMissileCount*GetLayerCount
        private constant string PATH="Abilities\\Weapons\\WaterElementalMissile\\WaterElementalMissile.mdl" //missile fx path
        private constant string CRUSH_FX="Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl" //on-death effect
        private constant string CRUSH_ATTCH="origin" //on-death effect attachment point
        private constant string DAMAGE_FX="" //on-damage effect
        private constant string DAMAGE_ATTCH="origin" //on-damage effect attachment point
        private constant real SCALE=1. //missile scale
        private constant integer RED=255 //vertex coloring in RGB , 
        private constant integer GREEN=255 // alpha is the opacity value
        private constant integer BLUE=255  
        private constant integer ALPHA=255 
        private constant real HEIGHT_INC=50. //missile height increment
        private constant real ANGLE_SPEED=.15 //missile angle speed, it's in radians
        private constant boolean INSTANTKILL=false //instant kill the sucked unit wandering too close if true
        private constant boolean DISABLEPATHING=false // If this is true, the spell will look better but can make units stop in weird places if the channeling is stopped.
                                                     // If it is false, the spell will look a bit worse, but shouldn't be able to create those problems.
    endglobals
    
    private constant function GetTargetCount takes integer lvl returns integer
        return 20+lvl*0 // how many units the maximum can suck into it at the same time
    endfunction
    
    private constant function GetAoE takes integer lvl returns real
        return 600.+lvl*0. // area of effect of the spell
    endfunction
    
    private constant function GetAngleSpeed takes integer lvl returns real
        return 1.309+lvl*0. // how much the targets turn while being sucked in per interval, it's in radians
    endfunction
    
    private constant function GetSpeed takes integer lvl returns real
        return 50.00+lvl*0. // how fast the units are sucked in
    endfunction
    
    private constant function DistanceToAbsorb takes integer lvl returns real
        return 80.00+lvl*0. // how close a sucked unit must be to the center to disappear.
    endfunction
    
    private constant function GetDamage takes integer lvl returns real
        return 30.*lvl //deal damage per interval
    endfunction
    
    private constant function GetMissileCount takes integer lvl returns integer 
        return 0*lvl+4 //number of missiles each layer
    endfunction
    
    private constant function GetLayerCount takes integer lvl returns integer
        return 1*lvl+0 //number of layers
    endfunction
    
    //damage filter
    private function DamageOptions takes xedamage spellDamage returns nothing
        set spellDamage.dtype=DAMAGE_TYPE_UNIVERSAL
        set spellDamage.atype=ATTACK_TYPE_NORMAL
        set spellDamage.exception=UNIT_TYPE_STRUCTURE
        set spellDamage.visibleOnly=true 
        set spellDamage.damageAllies=false //damage allies if true
    endfunction
    
    //filter the targets, should match the value from DamageOptions
    private function IsValidTarget takes unit u, data s returns boolean
        
        return not IsUnitType(u, UNIT_TYPE_DEAD) and GetUnitTypeId(u) != 0 and IsUnitType(u,UNIT_TYPE_STRUCTURE)==false and IsUnitEnemy(u,GetOwningPlayer(s.caster))==true and IsUnitInGroup(u,s.victim)==false and IsUnitVisible(u,GetOwningPlayer(s.caster))==true
        
    endfunction
//------------END OF CALIBRATION----------------------------------------------------------------
    globals
        private group casters=CreateGroup()
        private xedamage xed
    endglobals
    
    private struct data
        unit caster
        timer t
        real x
        real y
        integer lvl
        integer count=0
        group victim
        xefx array fx[MAXMISSCOUNT]
        real array angle[MAXMISSCOUNT]
        private static thistype temp
        
        static method create takes unit c, real x, real y returns data
            local data this=data.allocate()
            local integer i=0
            local integer j=0
            local integer k=0
            local real height=HEIGHT_INC
            local real a=2*bj_PI
            
            call GroupAddUnit(casters,c)
            set .caster=c
            set .x=x
            set .y=y
            set .lvl=GetUnitAbilityLevel(c,SPELL_ID)
            set .victim=NewGroup()
            set .t=NewTimer()
            
            loop
            exitwhen i==GetLayerCount(.lvl)
            
                loop
                exitwhen j==GetMissileCount(.lvl)*(i+1)
                    
                    set .fx[j]=xefx.create(x,y,k*a/GetMissileCount(.lvl))
                    set .fx[j].fxpath=PATH
                    set .fx[j].scale=SCALE
                    set .fx[j].z=height
                    set .angle[j]=k*a/GetMissileCount(.lvl)
                    set height=height+HEIGHT_INC
                    
                    set k=k+1
                    set j=j+1
                endloop
                
                set height=HEIGHT_INC //to synchronize each layer missile' height
                set k=0
                set i=i+1
            endloop
            
            return this
        
        endmethod
        
        static method movecallback takes nothing returns nothing
            local unit f=GetEnumUnit()
            local real x
            local real y
            local real dist
            local real a
            local real d
            
            //move the target unit
            set x=temp.x-GetUnitX(f)
            set y=temp.y-GetUnitY(f)
            set dist=SquareRoot(x*x+y*y)
            
            set a=Atan2(GetUnitY(f)-temp.y, GetUnitX(f)-temp.x)+GetAngleSpeed(temp.lvl)*XE_ANIMATION_PERIOD
            set d=dist-GetSpeed(temp.lvl)*XE_ANIMATION_PERIOD
            set x = temp.x+d*Cos(a)
            set y = temp.y+d*Sin(a)
            
            if DISABLEPATHING==true then
                call SetUnitX(f, x)
                call SetUnitY(f, y)
            else
                //SetUnitPosition will check the pathability
                call SetUnitPosition(f,x,y)
            endif
            
            if dist<=DistanceToAbsorb(temp.lvl) and INSTANTKILL==true then
                call xed.useSpecialEffect(CRUSH_FX,CRUSH_ATTCH)
                //instant kill the unit
                call xed.damageTarget(temp.caster,f,99999.)
            endif
            //kick the dead units from the victim group
            if (IsUnitType(f, UNIT_TYPE_DEAD) or GetUnitTypeId(f) == 0) then
                call GroupRemoveUnit(temp.victim,f)
                set temp.count=temp.count-1
            endif
            
            set f=null
        endmethod
        //moving the missiles and the targets
        static method move takes nothing returns nothing
            local real a
            local integer i=0
            local integer j=0
            
            loop
            exitwhen i==GetLayerCount(temp.lvl)
                
                loop
                exitwhen j==GetMissileCount(temp.lvl)*(i+1)
                    
                    set a=temp.angle[j]+ANGLE_SPEED
                    
                    set temp.fx[j].x=temp.x+GetAoE(temp.lvl)/(i+1)*Cos(a)
                    set temp.fx[j].y=temp.y+GetAoE(temp.lvl)/(i+1)*Sin(a)
                    
                    set temp.angle[j]=a
                    
                    set j=j+1
                
                endloop
                
                set i=i+1
            endloop
            
            
            call ForGroup(temp.victim,function data.movecallback)
            
        endmethod
        
        private method onDestroy takes nothing returns nothing
            local unit f 
            local integer i=0
            
            call ReleaseTimer(.t)
            call GroupRemoveUnit(casters,.caster)
            //i just hate using ForGroup here <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile    :)" loading="lazy" data-shortname=":)" />
            loop
            set f=FirstOfGroup(.victim)
            exitwhen f==null
                call PauseUnit(f,false)
                call GroupRemoveUnit(.victim,f)
            endloop
            //destroy fx
            loop
            exitwhen i==GetLayerCount(.lvl)*GetMissileCount(.lvl)
                call .fx<i>.destroy()
                set i=i+1
            endloop
            
            call ReleaseGroup(.victim)
            //unit f will already be null by the end of the FirstOfGroup loop
        endmethod
        //filter the targets
        static method VictimFilter takes nothing returns boolean
            local unit u=GetFilterUnit()
            local integer a=GetTargetCount(temp.lvl)
            
            if temp.count==a then
                set u=null
                return false
            endif
            
            if IsValidTarget(u,temp)==true then
                call GroupAddUnit(temp.victim,u)
                call PauseUnit(u,true)
                set temp.count=temp.count+1
            endif
            
            set u=null
            return false
        endmethod
        
        static method Loop takes nothing returns nothing
            local data this=data(GetTimerData(GetExpiredTimer()))
            local integer a=GetTargetCount(.lvl)
            local unit f
            local boolexpr be
            
            if (GetUnitCurrentOrder(.caster)==OrderId(ORDER_ID)) then
                set .temp=this
                //damage nearby units, include the targets
                call GroupEnumUnitsInArea(ENUM_GROUP,.x,.y,GetAoE(.lvl),BOOLEXPR_TRUE)
                call xed.useSpecialEffect(DAMAGE_FX,DAMAGE_ATTCH)
                call xed.damageGroup(.caster,ENUM_GROUP,GetDamage(.lvl)*XE_ANIMATION_PERIOD)
                //search targets
                if .count&lt;a then
                    set be=Condition(function data.VictimFilter)
                    call GroupEnumUnitsInArea(ENUM_GROUP,.x,.y,GetAoE(.lvl),be)
                    call DestroyBoolExpr(be)
                endif
            
                call data.move()
            
                else
                    call .destroy()
            endif
            
            set be=null
            set f=null
        endmethod
    
        //trigger conditions are faster than trigger actions <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />
        static method SpellEffect takes nothing returns boolean
            local data this
            local unit caster=GetSpellAbilityUnit()
        
            if GetSpellAbilityId() == SPELL_ID and IsUnitInGroup(caster,casters)==false then
                set this=data.create(caster,GetUnitX(caster),GetUnitY(caster))
                call SetTimerData(.t,this)
                call TimerStart(.t,XE_ANIMATION_PERIOD,true,function data.Loop)
            endif
            set caster=null
            return false
        endmethod
        //spell trigger actions
        static method onInit takes nothing returns nothing
            local trigger t=CreateTrigger()
            call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
            call TriggerAddCondition(t,Condition(function data.SpellEffect))
        
            //init xedamage
            set xed=xedamage.create()
            call DamageOptions(xed)
        endmethod
    
    endstruct
    
endlibrary</i>
 

Komaqtion

You can change this now in User CP.
Reaction score
469
First one doesn't leak...
Second one leaks a sound, and don't have time to look through the last one :S
(Though, I wouldn't think it leaks if it has been approved somewhere ;))
 

INCINERATE

New Member
Reaction score
12
the jass spell hasnt been approved, and the 2nd one? should i destroy the sound? but it stops playing the sound when i do that :p .. i was curious cuz i see the destroy of it . so sounds do infact leak?
 

Laiev

Hey Listen!!
Reaction score
188
About the jass, I don't check everything but part of spell don't leak.. also i don't understand it too... sound LEAK? this is new for me :eek:
 

jomik

New Member
Reaction score
17
Yeah, sounds leak, just figure how long you want to play it and destroy it after that time? :O
 

Azlier

Old World Ghost
Reaction score
461
Those triggers don't leak. I would know, I'm a doctor.
 

INCINERATE

New Member
Reaction score
12
lol okay thanks , so everything is fine.. ill post here later with some more leak questions when i get back to work on my map :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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
  • 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 Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top