• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Is this trigger leakless? done well?

Status
Not open for further replies.
The following trigger will allow cleave attack to hit destructable such as trees.

  • Destructible - Pick every destructible within 300.00 of (Point(R1, R2)) and do (Actions)
    • Loop - Actions
      • Set R3 = ((Damage taken) x (0.01 x (Real((Level of Cleaving Attack (100 levels) for (Damage source))))))
      • Destructible - Set life of (Picked destructible) to ((Current life of (Picked destructible)) - R3)
Did I do it right?
 
It is pointless to use coordinates like this. It doesn't save anything, as it still creates(and leaks) a point.
Can't find any other problems.

There is a
"set p = trigger unit location"
set r1 = x of p
set r2 = y of p
call destroylocation (udgP)

So this is a protiate way to damage a destructable? I was not sure
since I can't directly "unit - damage destructable"

Well, since you said you can't find problams it means I did it right
Thanks!
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
There is a
"set p = trigger unit location"
set r1 = x of p
set r2 = y of p
call destroylocation (udgP)

So this is a protiate way to damage a destructable? I was not sure
since I can't directly "unit - damage destructable"

Well, since you said you can't find problams it means I did it right
Thanks!


The thing is that when you use the "Point(x,y)" function, then it creates a point and doesn't remove it. Also, there's no reason to use coordinates when it still creates a point. The only way to use coordinates seems to be JASS.
So I would just suggest saving a point, instead of coordinates and then removing it with "call RemoveLocation(udg_TempPoint)" That way the memory leak is also cleared.
 
The thing is that when you use the "Point(x,y)" function, then it creates a point and doesn't remove it. Also, there's no reason to use coordinates when it still creates a point. The only way to use coordinates seems to be JASS.
So I would just suggest saving a point, instead of coordinates and then removing it with "call RemoveLocation(udg_TempPoint)" That way the memory leak is also cleared.

set real= x of point
^
LEAK?
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
set real= x of point
^
LEAK?


No not that. Reals don't leak. The thing is that the GUI function creates a point.
For the game it is like this:
set x = something, set y = somethingelse, set point = (x,y), pick every destructible within 300 of point ...
So basically when you give it coordinates, then it uses them to create a point, which leaks. It's dumb, but that's how it works in GUI.
 
No not that. Reals don't leak. The thing is that the GUI function creates a point.
For the game it is like this:
set x = something, set y = somethingelse, set point = (x,y), pick every destructible within 300 of point ...
So basically when you give it coordinates, then it uses them to create a point, which leaks. It's dumb, but that's how it works in GUI.

Leakchecker said its ok 0_0
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
set unitGrouP = units in 400 area arround REAL1,REAL2
^
the official leak checker program says this won't leak

JASS:
native Location takes real x, real y returns location

This is what you're using. This thing creates a location every time you use it. If you wish to use it, then you have to put the return value in a variable, elseway it leaks. But that would make using coordinates pointless.

I don't know about leak checker, but anything that creates a point and doesn't remove it is leaky.

So, I suggest that instead of coordinates you use a point and later remove it with "RemoveLocation(udg_SomeLocationThatYouUse)"
Because the way it currently does things is just nonsense.
 
JASS:
native Location takes real x, real y returns location

This is what you're using. This thing creates a location every time you use it. If you wish to use it, then you have to put the return value in a variable, elseway it leaks. But that would make using coordinates pointless.

I don't know about leak checker, but anything that creates a point and doesn't remove it is leaky.

So, I suggest that instead of coordinates you use a point and later remove it with "RemoveLocation(udg_SomeLocationThatYouUse)"
Because the way it currently does things is just nonsense.

This thing should be published, this is the first time on this forum someone I talk with mantioned it, I mean, I got an approved map using those, and to think I create new leak variable any 0.1 seconds and still get approved. wow this was not in any of leakchecker notes. If this is true, then this is crazy that this isnt well known all over the forum.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
This thing should be published, this is the first time on this forum someone I talk with mantioned it, I mean, I got an approved map using those, and to think I create new leak variable any 0.1 seconds and still get approved. wow this was not in any of leakchecker notes. If this is true, then this is crazy that this isnt well known all over the forum.

Map mods might not check the triggers that closely.

You should do the set R3 part outside the loop so you only calculate it once.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
This thing should be published, this is the first time on this forum someone I talk with mantioned it, I mean, I got an approved map using those, and to think I create new leak variable any 0.1 seconds and still get approved. wow this was not in any of leakchecker notes. If this is true, then this is crazy that this isnt well known all over the forum.

I guess people make mistakes. The people that make tools for checking errors, or the people that approve maps...
 
You should do the set R3 part outside the loop so you only calculate it once.
Wow you noticed a very important detail, thanks.
I guess people make mistakes. The people that make tools for checking errors, or the people that approve maps...
My map has 38 Heroes that each has up to 4 triggers using real instead of point, that together with dota spawns and effects, it will take forever to fix that!, I also lost intrest in the map so there is no way I am going to waste 3 weeks on fixing it, probably best to un-approve it for being leakfull map. (I pm the one who approve it, requested to un-apporve)

http://www.hiveworkshop.com/forums/maps-564/4th-ninja-world-war-v1-12-a-226277/?prev=search%3Dbest_player_88%26d%3Dlist%26r%3D20
It is a shame, this map was 4th rank in top downloaded on the site on Desember, ghess I have no choise but to fix it, but considering how nobody is commenting anymore I ghess its best to lose it... I will post other maps in the future, I dislike dota maps. After I proven to myself that I can make dota milions of times better than the original, I no longer need to make pvp maps. :thumbs_up: :ogre_haosis: :thumbs_up:
I AM THE BEST.

yea, and, Naruto is not cool. Inl0ve with sasuke and pass out from thinking about him. I hope I never get to make naruto based maps ever again.
 
Last edited:
Level 21
Joined
Mar 27, 2012
Messages
3,232
Wow you noticed a very important detail, thanks.

My map has 38 Heroes that each has up to 4 triggers using real instead of point, that together with dota spawns and effects, it will take forever to fix that!, I also lost intrest in the map so there is no way I am going to waste 3 weeks on fixing it, probably best to un-approve it for being leakfull map. (I pm the one who approve it, requested to un-apporve)

http://www.hiveworkshop.com/forums/maps-564/4th-ninja-world-war-v1-12-a-226277/?prev=search%3Dbest_player_88%26d%3Dlist%26r%3D20
It is a shame, this map was 4th rank in top downloaded on the site on Desember, ghess I have no choise but to fix it, but considering how nobody is commenting anymore I ghess its best to lose it... I will post other maps in the future, I dislike dota maps. After I proven to myself that I can make dota milions of times better than the original, I no longer need to make pvp maps. :thumbs_up: :ogre_haosis: :thumbs_up:
I AM THE BEST.

yea, and, Naruto is not cool. Inl0ve with sasuke and pass out from thinking about him. I hope I never get to make naruto based maps ever again.

I could look over the triggers and maybe condense and fix them.
 
I could look over the triggers and maybe condense and fix them.

Its the editable map, if you get tired, put the half remade version here, and I will contine... it will probaby take long untill we manage...

Edit: and another thing, start from below and climb toward the top, when you see loop inside loop (For Loop A 1 to 5, etc) don't forget to add P2 instead Point.
I do it from the top into the bottom.
Edit: I finish check + make sure that the top 27 are fixed, now just 314-(27) more triggers to go xD.
 

Attachments

  • 4th Ninja World War V1.12.w3x
    5.3 MB · Views: 47
  • 4th Ninja World War V1.12.27.w3x
    5.3 MB · Views: 57
Last edited:
Well, the good news are that if I keep on going 41 triggers fix per day, I will end fixing it in only one week :D

Ok I done 60 Triggers for today, right now above the trigger file " ".
Im going to sleep, I have 314-(41) triggers left.
I had to add a point so that a tripple loop won't bug, with all these changes its a high risk for a game crush and bugged, very high chance for that. I sure hope I could make it bugless in the end. 273 more!!
 

Attachments

  • 4th Ninja World War V1.12.41.w3x
    5.3 MB · Views: 31
Last edited:
Alright, I got tired :D

I saw plenty of understanding errors there. When you make a next map you can ask me for help, I am sure I can make shorter triggers.

Sure why not, but right now we both are totaly tired, lets talk about this tommorow, damn this was hard.
Tell me when you get tommorw to where you reached, I will add all triggers on same file and copy them, and delete the original to combine the triggers.
 
Status
Not open for further replies.
Top