• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Fixing Leaks. MUI spells. Need advice, guide, help, and so on.

Status
Not open for further replies.
Level 7
Joined
Dec 28, 2009
Messages
257
Hello my dears, me again.
Basically i need help with fixing leaks in my map, as ive realized they work differently than i thought, and it seems 90% of my triggers do leak. So i need help!

I know some basics about leaks, how they screw up stuff, but really only basics. So, could somebody please explain me how to properly fix leaks, what exactly causes leaks, what should i add to triggers, which integers are necesary, blah blah blah.
This thing down here is only tutorial ive got, but id still welcome moar help :D
http://www.thehelper.net/threads/triggers-memory-leaks-and-custom-scripts.20711/


Ans also- MUI Spells. I dunno whether its what i think it is, but it should mean that some spells is usable by more players, units, etc without interfering. So far, ive got few spells which might cause some trouble if more heroes, players etc. used it at same time, so together with fixing all my leaks, id like perfect every single spell! :D So, any help, guides, or so?

I guess later ill post some random spell of mine here, then try to add leak-preventing stuff to it, and ask you whether its allright or not, coz, as far as i know, i cant detect whether spell leaks or not - i know how to find out which part of trigger bugs, but detecting leaks.. i cant only rely on that, that my trigger works, who knows :D


Thanks for ya help and responding again, hope you understood me, as i said, i want to learn this stuff by myself too, so after i get some feedback and advice, ill try to turn some my trigger into not-leaking one, ask whether its perfect, and so on untill ill be confident in this enuff..

Thanks!
 
Level 7
Joined
Dec 28, 2009
Messages
257
Yayz, thanks, ive checked those tutorials out, and they seem good :D
Also, that thing about "Lag Spike" interested me, so far slways when i used most of my spells for 1st time game lagged for half a second and then it was fine.

Also, as ive said, i have to learn this by trial and error, so i tried rewriting some easy spell to leakless+ faster (i didnt finish reading MUI tutorial, ill do that after this :D), by adding sh***loads of variables and my first custom script.

So, one screenshot (i should also learn how to write those triggers here :D)
syqps4.jpg


Most of stuff ive written there, so, could i please get some feedback? Whether its leakless and whether it could be improved even further. Also, are all those variables integers neccesarY? Points and Unit Groups cause more leaks, so i wonder whether i could do something like this without all those variables.. like, you know, 4 variables for basic Holy Light, ill have 300 of them when im done with this :D

Or, could i use the same variables with Caster-Unit Position-Target-etc. with more spells, which are this easy? Ive got few spells which work only as spell with some debuff spell, 0,1second long job. Or could it interfere?

Thanks again!
 
Level 7
Joined
Dec 28, 2009
Messages
257
Why is that? :O

I remember once i had longer trigger and then i used "casting unit" in later stage, it refered to dummy which casted buff, not original caster (took me some time to figure out what went wrong :D), but i fixed that with variable at the start... Does it bug something or does something unpleasant? :D Cause sometimes that "triggering unit" confuses me, it looks like it can refer to either everything or nothing at all, i usually use it out of desperation when no other event-response thing seems appropriate :D

And also, i still wonder about that thing, whether i could use the same variables for similarly easy spells, or it might interfere together (with spells like.. Knockback or anything complex, it would bug if 2 units casted it at the same time, but if 10spells shared variables for casting unit-point-target. etc. and like 3 of them would be casted in very short succesion... the action takes like 0.1 or less seconds, would it bug, could it bug, or can i use Arrays in Arrays to avoid having 100variables for 20 very basic spells? :D)

Hope its not too long to read :D
 
Level 7
Joined
Dec 28, 2009
Messages
257
Mkay, i didnt try the spell last time, just finished rewriting and posted screenshot here, but then it gave me this error

2r2cfnc.jpg


Im no JASS skilla, what does that "expected "endif" mean? Everywhere i saw only this one line with "Call RemoveLocation/DestroyGroup (udg_xxx)", no "endif" word or line included, yet my wc3 editor gives me error with this, even though everywhere else its the same :D

PS: also, ive changed variables from "Holy_Light_Caster/Target/Point etc. to "Simple_Spell", and i guess ill use them in some similarly one-shot easy spells instead of making 4 integers for every simple spell, if it will bug ill do some MUI-like Array stuff instead, but for now.. :D
 
Level 7
Joined
Dec 28, 2009
Messages
257
The spell is the same as before, ive only changed name of Variables and changed name of variable in that custom script. But i wouldnt be surprised if my warcraft was screwed, i cant even install patch 1.26 and when i started map with.. Threat Meter or something, at least 5 custom scripts didnt work and warcraft said theres error in them :D

334kweu.jpg

+ i also added one function, when Hero has got another buff on him, healing done is increased by 50 per level. I hope that line doesnt cause any problems too :D
 
Level 7
Joined
Dec 28, 2009
Messages
257
Ow. The fact that one wrong letter can screw whole line is unpleasant enuff for me, and now even Caps Lock, ugh :D
Yep, it works now, thank you very much.

And also, while im rewriting my triggers now, could i ask one of you, Mr. DivineLight or Deathismyfriend or somebody, for some further help? I dont like using this form for help, because i could ask some petty question every single day, and i feel like abusing it here or what :)D), so instead, cause you seem skilled, if somebody could become my "personal advisor", instead of asking questions here and bothering most folks, id just write message to somebody and he would help :D Im not total noob, but JASS and writing very complex stuff is beyond my capabilities (though i can learn nicely, or i think :D), and as you see, i mostly lack some basics in some parts of editing or so :D*

So, is anybody here willing and patient enuff here to help me, now and then? Would be really nice :D

And if not, im still grateful to ya, ill try to figure out some stuff out by myself, but now and then, i guess.. :D

Ive got Unit Array variable, 1-2-3-4, with skeleton unit as each variable. Ive got another lightning variable, 1-2-3-4. And i want trigger, that when unit [1] dies, lightning [1] is also destroyed, and so with skelly [2] and lightning [2], but i cant figure out how to.. And i guess ill need hashtables for that :D (so far ive got no idea what they are, besides that they are complicated, and they save some values.. so i might save some value in one and then retrieve it? Ill look for some easy tutorial introduction to make them look less alien to me, but for now.. Or i could make it the easy way, with trigger like "unit dies - unit is equal to "skeleton[1]" - destroy lightning [1]" etc :D
Danke schon.. :D
 
Last edited:
Status
Not open for further replies.
Top