• 🏆 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!

Things That Leak

Level 13
Joined
Mar 4, 2009
Messages
1,156
well i do have nice computer xD

but the game is vampirism fire,its playing with 12 players,every player has about 200 units or more and they all get removed if you main human dies,but you also continue playing as a vampire

and there is no some big disconnecting or lags,only people who usually lag on other games can get disconnected too,it happens in beginning


i know more lags would happen if you kill/explode all units when you main human dies
but that is only because 200+ units dying is a lot and that makes more lags than removing them
-but off course you can kill units with triggers,no problem....

i actually don't think that computer speed has something to do with lags,(accept if it is really really slow),when i played on weaker internet than i had some lags and now on this one i don´t
(in the same game too)

same for one of my fiends carevica

im just slaying removing units should not make some memory leaks or something like that



just to know i didn't create 500 effects at once,than i would have lag (that kind of some small freezes)

i wish i could send you a some pictures but i don´t know how xD(im to l...)
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
I'd be glad to take a picture of 500 effects created at the same point in the same period of time, but I'm afraid to run such a map.

you are afraid lol...

i created effect every time my unit attacked
i didn't make it at once and you don't need to make it at once
i used this effect

Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl

here is what i got after 4 minutes createing it every 0.10 sec = 2400+ effects (set your event to 0.01 it will be fine)
i think it depends on how much units/models you have around,it will mix all around it..
BTW:that "sky" is only on one place and it makes lags when you look on that place,after about 5-7 minutes


Here is the picture
 

Attachments

  • WC3ScrnShot_071409_165240_03.tga
    3 MB · Views: 130
Last edited:
Level 11
Joined
Jun 21, 2007
Messages
505
Don't bother to find it. I meant that you could simply email at their technical support and tell them that you found a map that creates 500 thunder clap effects at the same time and all nearby objects' models get drawn to that point and start spinning around it.

There's Carlos, technical support operator. If he doesn't tell that "Due to flexibility of World Editor triggers it is possible to create maps that bla bla bla... try playing orginal Blizzard custom maps to check if bla bla... bla bla please visit this link to give me a rate.. bla bla bla bla bla... bla blaaaAAAAA!!!.. Jesus thanks you for using our blizzard bla support..." then he might somehow tell others about the bug and it could be fixed in the next patch as soon as possible.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
Don't bother to find it. I meant that you could simply email at their technical support and tell them that you found a map that creates 500 thunder clap effects at the same time and all nearby objects' models get drawn to that point and start spinning around it.

BTW,open some some WarCratf 3 map,put a lot of units on it and you will get the same effect,lets say 500+ units (blood mage),i used some other unit but i cant remember witch one
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Um.... That is not a bug that blizzard will bother with as it does not exist in normal play.

Basically welcome to a 6 year old game. The graphic engine in it is not able to handle too many objects at once and will fall appart in that case resulting in geometry floating towards the milddle of the screen or not appearing. It has existed since day one and is seen in may maps. Easy ways to reproduce it is to place 100+ tauren chieftan or deathknights within the same screen at the same time. They will eventually start to warp all over the place and mess up the graphics for that area. Graphics go back to normal if you look away however as it is purly graphical overload.

Like I said this is no problem that blizzard should consern with. It only is a problem if you leak special effects or use poor model choice, in which case it is your fault and up to you to fix.

I think it is related to a certain number of billboards or triangle geometry resulting in the engine exceeding certain arrays it has. Thus it falls appart.

If your map sufferes from it, use simpler models (deathknight and tauren chieftain are well known for causing this problem) and remove all special effect leaks.
 
Level 3
Joined
Jun 19, 2009
Messages
37
hi...some time ago someone here wrote that to prevent special effect leak i have to destroy it after making it, like:
create effect
destroy last created effect
So please tell me how to change following trigger in order to make the last effect expire after 3 seconds? And I'd like it to work even if i'll kill more than 1 guy at once.
  • Spider buum
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal Spider Mine lvl 1
    • Actions
      • Set spiderunit = (Position of (Dying unit))
      • Special Effect - Create a special effect at spiderunit using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at spiderunit using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at spiderunit using Abilities\Spells\Orc\LiquidFire\Liquidfire.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_spiderunit)
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
you need to store them into a variable

EFFECT [1] = (last created special effect)
EFFECT [2] = (last created special effect)
EFFECT [3] = (last created special effect)
wait 3.00 seconds (it should be ok to use wait here)
for each integer from 1 to 3 do actions
loop actions...
--Special Effect - Destroy EFFECT [integer A]

you need just last one?
EFFECT [1] = (last created special effect)
Special Effect - Destroy EFFECT [1] .....

anyway now you know it :D ...
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
the problem is that if that trigger runs again before these 3 seconds have past the special effects will be re-set and the old ones wont be removed
Yes that is true...,

>create
INTEGER = INTEGER + 1
set EFFECT [INTEGER] = (Last created special effect)
>create
INTEGER = INTEGER + 1
set EFFECT [INTEGER] = (Last created special effect)
>create
INTEGER = INTEGER + 1
set EFFECT [INTEGER] = (Last created special effect)
set custom value to dying unit to INTEGER

unit dies
wait 3 sec (wait works good on dying units)
---------from 1 to 3 in this case--------
for each integer from (custom value of dying unit - 2) to custom value of dying unit do actions
-destroy EFFECT [integer A]

anyway you can create unit with model file of effect,add countdown timer,make him unselectible
 
Level 3
Joined
Jun 19, 2009
Messages
37
so:
#1
I tried to do what u told me to guys:
  • map init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set metanid = 0
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set proptrig[(Integer A)] = No unit
          • Custom script: call RemoveLocation(udg_proppkt[GetForLoopIndexA()])
  • metan init
    • Events
      • Jednostka - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal Metan cylinder
    • Actions
      • Set metanid = (metanid + 1)
      • Set proptrig[metanid] = (Triggering unit)
      • Set proppkt[metanid] = (Target point of ability being cast)
      • Trigger - Run metan loop <gen> (ignoring conditions)
  • metan loop
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set proplvl[(Integer A)] = (Level of Metan cylinder for proptrig[(Integer A)])
          • Wait 1.00 seconds
          • Special Effect - Create a special effect at proppkt[(Integer A)] using Abilities\Spells\Human\CloudOfFog\CloudOfFog.mdl
          • Special Effect - Destroy (Last created special effect)
          • Wait 1.00 seconds
          • Special Effect - Create a special effect at proppkt[(Integer A)] using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • proplvl[(Integer A)] Equal 1
            • Than - Actions
              • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 100.00 at proppkt[(Integer A)], dealing 20.00 damage of attack type Chaos and damage type Fire
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • proplvl[(Integer A)] Equal 2
                • Than - Actions
                  • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 100.00 at proppkt[(Integer A)], dealing 40.00 damage of attack type Chaos and damage type Fire
                • Else - Actions
                  • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 100.00 at proppkt[(Integer A)], dealing 60.00 damage of attack type Chaos and damage type Fire
          • Wait 1.00 seconds
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 0.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 45.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 90.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 135.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 180.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 225.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 270.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect at (proppkt[(Integer A)] offset by 100.00 towards 315.00 degrees) using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
          • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • proplvl[(Integer A)] Equal 1
            • Than - Actions
              • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 200.00 at proppkt[(Integer A)], dealing 30.00 damage of attack type Chaos and damage type Fire
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • proplvl[(Integer A)] Equal 2
                • Than - Actions
                  • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 200.00 at proppkt[(Integer A)], dealing 60.00 damage of attack type Chaos and damage type Fire
                • Else - Actions
                  • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 200.00 at proppkt[(Integer A)], dealing 90.00 damage of attack type Chaos and damage type Fire
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • metanid Not equal 0
              • proptrig[(Integer A)] Not equal No unit
            • Than - Actions
              • Custom script: call RemoveLocation(udg_proppkt[udg_metanid])
              • Set metanid = (metanid - 1)
            • Else - Actions
              • Do nothing
I destroyed effects after creation. I thought that maybe sth is wrong with indexes etc but I can see no mistake. (maybe you can guys) Nevertheless when 2 guys casts this spell one after other, it happens in one place :S kinda stacks or sth like this... :(

#2
I've tried to do what u said here...
  • Spider buum
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal Spider Mine lvl 1
    • Actions
      • Set spiderunit = (Position of (Dying unit))
      • Special Effect - Create a special effect at spiderunit using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at spiderunit using Objects\Spawnmodels\Human\HCancelDeath\HCancelDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect at spiderunit using Abilities\Spells\Orc\LiquidFire\Liquidfire.mdl
      • Set spider = (spider + 1)
      • Set Spider1[spider] = (Last created special effect)
      • Wait 2.00 seconds
      • For each (Integer A) from 1 to spider, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy Spider1[(Integer A)]
      • Set spider = (spider - 1)
      • Custom script: call RemoveLocation(udg_spiderunit)
And it worked! yay...great ;) thx a lot

However i'm still stuck with a first one :S
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
don´t do all that XD Sry i should of say do it with units

create a unit with model file of your special effect
put pathing map to none or make him fly
add him locust ability so he cant be selected

create (unit with model file of your effect) at position of (your unit) for natural passive
-add countdown timer of 3 seconds to (last created unit)

remove (unit with model file of your effect) when he dies or just set his death type to Can´t raise,Does not decay

it is a lot more simple
 
Level 3
Joined
Jun 19, 2009
Messages
37
That solved some problems...I also managed to cancel delay (when you're using 10th index than you have to wait 3seconds each previous index) Everythings fine except that, when i throw it in 3 different places, then in one place damage is normal, in one place its reduced & and in one place its increased...but i dont know why, because units(dummies) are ok.

  • metan loop
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Real(metanid)) Greater or Equal 10.00
        • Then - Actions
          • Set metanid = 0
        • Else - Actions
          • Do nothing
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • proptrig[(Integer A)] Not equal No unit
            • Then - Actions
              • Set proplvl[(Integer A)] = (Level of Metan cylinder for proptrig[(Integer A)])
              • Wait 1.00 seconds
              • Unit - Create 1 metaneffect1 for Neutral - passive at proppkt[(Integer A)] facing proppkt[(Integer A)]
              • Unit - Add a 2.00 second General expiration timer to (Last created unit)
              • Wait 1.00 seconds
              • Unit - Create 1 metaneffect2 for Neutral - passive at proppkt[(Integer A)] facing proppkt[(Integer A)]
              • Unit - Add a 1.00 second General expiration timer to (Last created unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • proplvl[(Integer A)] Equal 1
                • Then - Actions
                  • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 100.00 at proppkt[(Integer A)], dealing 20.00 damage of attack type Chaos and damage type Fire
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • proplvl[(Integer A)] Equal 2
                    • Then - Actions
                      • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 100.00 at proppkt[(Integer A)], dealing 40.00 damage of attack type Chaos and damage type Fire
                    • Else - Actions
                      • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 100.00 at proppkt[(Integer A)], dealing 60.00 damage of attack type Chaos and damage type Fire
              • Wait 1.00 seconds
              • Unit - Create 1 metaneffect2 for Neutral - passive at (proppkt[(Integer A)] offset by 100.00 towards 0.00 degrees) facing (Random point in (Playable map area))
              • Unit - Add a 2.00 second General expiration timer to (Last created unit)
              • Unit - Create 1 metaneffect2 for Neutral - passive at (proppkt[(Integer A)] offset by 100.00 towards 45.00 degrees) facing (Random point in (Playable map area))
              • Unit - Add a 2.00 second General expiration timer to (Last created unit)
              • Unit - Create 1 metaneffect2 for Neutral - passive at (proppkt[(Integer A)] offset by 100.00 towards 90.00 degrees) facing (Random point in (Playable map area))
              • Unit - Add a 2.00 second General expiration timer to (Last created unit)
              • Unit - Create 1 metaneffect2 for Neutral - passive at (proppkt[(Integer A)] offset by 100.00 towards 135.00 degrees) facing (Random point in (Playable map area))
              • Unit - Add a 2.00 second General expiration timer to (Last created unit)
              • Unit - Create 1 metaneffect2 for Neutral - passive at (proppkt[(Integer A)] offset by 100.00 towards 180.00 degrees) facing (Random point in (Playable map area))
              • Unit - Add a 2.00 second General expiration timer to (Last created unit)
              • Unit - Create 1 metaneffect2 for Neutral - passive at (proppkt[(Integer A)] offset by 100.00 towards 225.00 degrees) facing (Random point in (Playable map area))
              • Unit - Add a 2.00 second General expiration timer to (Last created unit)
              • Unit - Create 1 metaneffect2 for Neutral - passive at (proppkt[(Integer A)] offset by 100.00 towards 270.00 degrees) facing (Random point in (Playable map area))
              • Unit - Add a 2.00 second General expiration timer to (Last created unit)
              • Unit - Create 1 metaneffect2 for Neutral - passive at (proppkt[(Integer A)] offset by 100.00 towards 315.00 degrees) facing (Random point in (Playable map area))
              • Unit - Add a 2.00 second General expiration timer to (Last created unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • proplvl[(Integer A)] Equal 1
                • Then - Actions
                  • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 200.00 at proppkt[(Integer A)], dealing 30.00 damage of attack type Chaos and damage type Fire
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • proplvl[(Integer A)] Equal 2
                    • Then - Actions
                      • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 200.00 at proppkt[(Integer A)], dealing 60.00 damage of attack type Chaos and damage type Fire
                    • Else - Actions
                      • Unit - Cause proptrig[(Integer A)] to damage circular area after 0.00 seconds of radius 200.00 at proppkt[(Integer A)], dealing 90.00 damage of attack type Chaos and damage type Fire
              • Set proplvl[(Integer A)] = 0
              • Set proptrig[(Integer A)] = No unit
              • Custom script: call RemoveLocation(udg_proppkt[GetForLoopIndexA()])
            • Else - Actions
              • Do nothing
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
I just got one question here. Do strings leak? Cause I'm sure that I've read at TheHelpersNet or something that they do.
Yes but there is no way to remove them,they are to small leaks anyway,but don't do actions like

set STRING = STRING + something
you can do it but maybe like 100 times or something like that (depends how big "something" is)


use this trigger to see


every 0.01 sec of game

set STRING = STRING + A

1000 "A" = 1 KB "leak"


try
set STRING = STRING + AAAAAAAAAA
if that doesn't work
 
Level 10
Joined
Jan 28, 2009
Messages
442
Does "current camera" leak?

Edit: Please ignore this post. I found the Complete List of Things that Leak. I'm sorry for my irrational laziness.

Edit: No, scrap that. It's not mentioned anywhere--it seems. I could assume that's because it doesn't leak, but I'll instead assume that the Current Camera is typically just used for conditions, rarely in actions, and is therefore not being considered by many. I do fear that it leaks... though I have no idea how to find out, or to (hypothetically) fix it, so if anybody knows for sure, please let me know :)
 
Last edited:
Level 13
Joined
Mar 16, 2008
Messages
941
Does anyone know if
JASS:
call TriggerRegisterEnterRegion(AddTrigger, re, null)
leaks? the null scares me..;p

The "null" is bad, yes ;D
But I don't think it leaks, if I remember correctly the null might desync Macs and that's "all". Just use a function to fix it:
JASS:
function ReturnTrue takes nothing returns boolean
    return true
endfunction

call TriggerRegisterEnterRegion(AddTrigger, re, Condition(function ReturnTrue))
 
Level 11
Joined
Jun 21, 2007
Messages
505
Help! I need help!

I have two triggers:
  • TMap Initialization
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Protagonist_TheActualPos = (Position of Footman 0000 <gen>)
    • Trigger - Turn on Map Initialization Copy
  • TMap Initialization Copy
  • Events
    • Time - Every 0.01 second
  • Conditions
  • Actions
    • Set temp_point[1] = (Protagonist_TheActualPos offset by 0.15 towards (Facing Angle of Footman 0000 <gen>))
    • Custom script: call RemoveLocation(udg_Protagonist_TheActualPos)
    • Set Protagonist_TheActualPos = temp_point[1]
    • Custom script: call RemoveLocation(udg_temp_point[1])
    • Unit - Move Footman 0000 <gen> instantly to Protagonist_TheActualPos
    • Special Effect - create special effect at Protagonist_TheActualPos using units\undead\acolyte\acolyte
    • Special Effect - Destroy (Last created special effect)
The trigger Map Initialization Copy simply does nothing and I'm free to move my footman!
If I remove location only the temp_point[1], not Protagonist_TheActualPos, then footman stays in the center of the map. Should I remove the leak at all, or, if I should, then how to make the trigger work?
 
Level 10
Joined
Jan 28, 2009
Messages
442
Oh my gos I'm setting a position variable to the position of current camera every one 0.01 second, if Current camera leaks, then my map might make less lags if I fix that leak.

Me too :S
That's why it's important for me to know, and same for you.

Edit: Oh, position variable. That leaks ofcourse. I was more wondering if camera object: current camera object leaks.
 
  • Spell
    • Events
    • Conditions
    • Actions
      • -------- Store the locations in temporary variables --------
      • Set TempPoint[0] = (Center of (Playable map area))
      • Set TempPoint[1] = (TempPoint[0] offset by (300.00, 300.00))
      • Set TempPoint[2] = (TempPoint[1] offset by (300.00, 300.00))
      • -------- Do stuff with the locations --------
      • -------- ... --------
      • -------- ... --------
      • -------- ... --------
      • -------- Clean the leaks --------
      • Custom script: call RemoveLocation(TempPoint[0])
      • Custom script: call RemoveLocation(TempPoint[1])
      • Custom script: call RemoveLocation(TempPoint[2])
 
Level 13
Joined
Mar 16, 2008
Messages
941
What if I'm setting a very important point variable to TempPoint[2] from your example, Element of Water? Then if I removelocation of those variables, they both will be removed, and the leak will remain still there if I don't removelocation the variables.

Thats wrong. You mean, when you remove a variable, it's offset gets destroyed too?
No, an offset is a complet new point and has no reference to the original one, if I understood you correctly.
 
Level 11
Joined
Jun 21, 2007
Messages
505
No I meant a different thing.

Is a leak in this?
  • Events
  • Conditions
  • Actions
    • Set Important_Location = Important_Loction offset by 1.20 towards Important_Angle
    • Unit - Move Important_Unit instantly to Important_Location
And then many many other triggers use Important_Location variable for their functions.
Does setting a point in that case make a leak? I already tried
  • Events
  • Conditions
  • Actions
    • Set temp_point = Important_Location offset by 1.20 towards Important_Angle
    • Custom script: call RemoveLocation(udg_Important_Location)
    • Set Important_Location = temp_point
    • Custom script: call RemoveLocation(udg_temp_point)
The last function in the above trigger removed both point variables.
How to make it right and not leak at all (because it's done every 0.01 second)?
 
Level 12
Joined
Nov 20, 2007
Messages
660
i have a problem with leaks ...
  • Move System
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer MoveSys_Index[1]) from 1 to MoveSys_Index[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MoveSys_Stop[MoveSys_Index[1]] Not equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MoveSys_Move_4_Ever[MoveSys_Index[1]] Not equal to True
                • Then - Actions
                  • Set MoveSys_Distance[MoveSys_Index[1]] = (MoveSys_Distance[MoveSys_Index[1]] - MoveSys_Speed[MoveSys_Index[1]])
                • Else - Actions
              • Set MoveSys_Targets_Temp_Group[MoveSys_Index[1]] = (Units within MoveSys_Targets_Range[MoveSys_Index[1]] of (Position of MoveSys_Unit[MoveSys_Index[1]]) matching (((((Matching unit) is in MoveSys_Targets_Group[MoveSys_Index[1]]) Not equal to True) and ((((Matching unit) is dead) Not equal to True) and (((Matc
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in MoveSys_Targets_Temp_Group[MoveSys_Index[1]]) Greater than 0
                • Then - Actions
                  • Unit Group - Pick every unit in MoveSys_Targets_Temp_Group[MoveSys_Index[1]] and do (Actions)
                    • Loop - Actions
                      • Unit Group - Add (Picked unit) to MoveSys_Targets_Group[MoveSys_Index[1]]
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • MoveSys_Die_when_touch[MoveSys_Index[1]] Equal to True
                        • Then - Actions
                          • Unit - Cause MoveSys_Unit[MoveSys_Index[1]] to damage (Random unit from MoveSys_Targets_Temp_Group[MoveSys_Index[1]]), dealing MoveSys_Damage[MoveSys_Index[1]] damage of attack type Chaos and damage type Normal
                          • Unit - Remove MoveSys_Unit[MoveSys_Index[1]] from the game
                          • Unit Group - Remove all units from MoveSys_Targets_Group[MoveSys_Index[1]]
                          • Unit Group - Remove all units from MoveSys_Targets_Temp_Group[MoveSys_Index[1]]
                          • Custom script: call DestroyGroup(udg_MoveSys_Targets_Group)
                          • Custom script: call DestroyGroup(udg_MoveSys_Targets_Temp_Group)
                          • Set MoveSys_Stop[MoveSys_Index[1]] = True
                          • Set MoveSys_Index[3] = (MoveSys_Index[3] - 1)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • MoveSys_Index[3] Less than or equal to 0
                            • Then - Actions
                              • Set MoveSys_Index[2] = 0
                              • Trigger - Turn off (This trigger)
                            • Else - Actions
                        • Else - Actions
                          • Unit - Cause MoveSys_Unit[MoveSys_Index[1]] to damage (Picked unit), dealing MoveSys_Damage[MoveSys_Index[1]] damage of attack type Chaos and damage type Normal
                • Else - Actions
              • Set MoveSys_Target_Point[MoveSys_Index[1]] = (Position of MoveSys_Unit[MoveSys_Index[1]])
              • Set MoveSys_Target_TempPoint[MoveSys_Index[1]] = (MoveSys_Target_Point[MoveSys_Index[1]] offset by MoveSys_Speed[MoveSys_Index[1]] towards MoveSys_Angle[MoveSys_Index[1]] degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Terrain pathing at MoveSys_Target_TempPoint[MoveSys_Index[1]] of type Walkability is off) Equal to True
                  • MoveSys_Bounce[MoveSys_Index[1]] Equal to True
                  • MoveSys_Stop[MoveSys_Index[1]] Not equal to True
                • Then - Actions
                  • Set MoveSys_Temp_Angle[MoveSys_Index[1]] = (Angle from MoveSys_Target_TempPoint[MoveSys_Index[1]] to MoveSys_Target_Point[MoveSys_Index[1]])
                  • Set MoveSys_Angle[MoveSys_Index[1]] = (0.00 - MoveSys_Temp_Angle[MoveSys_Index[1]])
                  • Set MoveSys_Target_TempPoint[MoveSys_Index[1]] = (MoveSys_Target_Point[MoveSys_Index[1]] offset by MoveSys_Speed[MoveSys_Index[1]] towards MoveSys_Angle[1] degrees)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Terrain pathing at MoveSys_Target_TempPoint[MoveSys_Index[1]] of type Walkability is off) Equal to True
                      • MoveSys_Bounce[MoveSys_Index[1]] Equal to True
                      • MoveSys_Stop[MoveSys_Index[1]] Not equal to True
                    • Then - Actions
                      • Set MoveSys_Angle[MoveSys_Index[1]] = (MoveSys_Angle[MoveSys_Index[1]] - 180.00)
                      • Set MoveSys_Target_TempPoint[MoveSys_Index[1]] = (MoveSys_Target_Point[MoveSys_Index[1]] offset by MoveSys_Speed[MoveSys_Index[1]] towards MoveSys_Angle[MoveSys_Index[1]] degrees)
                      • Unit - Move MoveSys_Unit[MoveSys_Index[1]] instantly to MoveSys_Target_TempPoint[MoveSys_Index[1]]
                    • Else - Actions
                      • Unit - Move MoveSys_Unit[MoveSys_Index[1]] instantly to MoveSys_Target_TempPoint[MoveSys_Index[1]]
                  • Unit - Move MoveSys_Unit[MoveSys_Index[1]] instantly to MoveSys_Target_TempPoint[MoveSys_Index[1]]
                • Else - Actions
                  • Unit - Move MoveSys_Unit[MoveSys_Index[1]] instantly to MoveSys_Target_TempPoint[MoveSys_Index[1]]
              • [COLOR=red]Custom script: call RemoveLocation(udg_MoveSys_Target_TempPoint)[/COLOR]
  • [COLOR=red] Custom script: call RemoveLocation(udg_MoveSys_Target_Point)[/COLOR]
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • MoveSys_Distance[MoveSys_Index[1]] Less than or equal to 0.00
        • MoveSys_Move_4_Ever[MoveSys_Index[1]] Not equal to True
        • MoveSys_Stop[MoveSys_Index[1]] Not equal to True
      • Then - Actions
        • Unit - Remove MoveSys_Unit[MoveSys_Index[1]] from the game
        • Unit Group - Remove all units from MoveSys_Targets_Group[MoveSys_Index[1]]
        • Unit Group - Remove all units from MoveSys_Targets_Temp_Group[MoveSys_Index[1]]
        • [COLOR=red]Custom script: call DestroyGroup(udg_MoveSys_Targets_Group)[/COLOR]
  • [COLOR=red] Custom script: call DestroyGroup(udg_MoveSys_Targets_Temp_Group)[/COLOR]
    • Set MoveSys_Stop[MoveSys_Index[1]] = True
    • Set MoveSys_Index[3] = (MoveSys_Index[3] - 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • MoveSys_Index[3] Less than or equal to 0
      • Then - Actions
        • Set MoveSys_Index[2] = 0
        • Trigger - Turn off (This trigger)
      • Else - Actions
    • Else - Actions
    • Else - Actions
 
Level 11
Joined
Jun 21, 2007
Messages
505
What do you want with your trigger to be done exactly? Could you explain more precisely?
And could you remove the [COLOR] tags from the trigger and rearrange the ifs at the bottom of it, as it's harder to read it because of that.

And could you also give all the variables different names that tell the role of a variable for it, for me to better understand what variables is needed for what?
For example, a name of a boolean should be a "yes or no" question, like "IsUnitDead". If a variabke serves as index array, name it Array. In your example trigger.

And you could also simply take a screenshot of it, paste into the paint the very bottom part, then paste the upper part of the trigger taken in a screenshot and in paint put it on top of the previous part, and then you get a long screenshot of your trigger.
 
  • Damage From Lava
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TempPoint) Equal to Dungeon - Lava Cracks
            • Then - Actions
              • Unit Group - Add (Picked unit) to Burning
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
      • Unit Group - Pick every unit in Burning and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Incinerate\IncinerateBuff.mdl
          • Special Effect - Destroy (Last created special effect)
          • Special Effect - Create a special effect attached to the head of (Picked unit) using Abilities\Spells\Other\Incinerate\IncinerateBuff.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00)
          • Unit Group - Remove (Picked unit) from Burning
Does this leak>?
 
Level 10
Joined
Jun 1, 2008
Messages
485
Just_Spectating, why you add the unit to group when you can directly damage it?
just change this
  • Unit Group - Add (Picked unit) to Burning
to this
  • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Incinerate\IncinerateBuff.mdl
  • Special Effect - Destroy (Last created special effect)
  • Special Effect - Create a special effect attached to the head of (Picked unit) using Abilities\Spells\Other\Incinerate\IncinerateBuff.mdl
  • Special Effect - Destroy (Last created special effect)
  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 1.00)
 
Top