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

Need some help with leaks...

Status
Not open for further replies.
Level 2
Joined
Aug 6, 2016
Messages
16
Hey everyone!

So this is my first time posting and I'll start off by saying I'm far from seasoned in the art of map creation. I used to play as a kid and always spent more time on the editor than I did actually playing. Just learning kill footswitches and open gates was mindblowing and I loved that the cause-effect relationship existed because I made it so. Over the years I've had a stint of playing WC3 every so often and always got just a bit better at it (thought never doing anything I would call even remotely complicated). That brings us to the map I'm working on now. I saw the WC movie and it made me think of the old editor for some reason. So I came up with an idea for a fun little mini-game type map about two weeks ago. I made a few fairly simple heroes, then came up with a slightly more complicated spell and got to work. I did it. I was pretty proud of myself and it inspired me to keep going. I designed a decent maze-esque map, slowly filling in areas differently as ideas came to me. I've tested it many times alone, and twice with a group. The group tests are a blast. Even with the glitches that pop up, we have tons of fun and I come out with a list of things I couldn't have seen alone to fix. I add new characters, improve the hero selection system, create unique and appealing spells, and have crafted a game mode that's totally my own. I'm really proud of myself and aside from a few speedbumps that forced me onto the Google machine, I've figured it out alone!

Here's the punchline. I just started looking for help with testing it, and as I search I see more and more about "leaks". I think I've gained somewhat of an understanding of what they are and why they are bad news, but I've spent a lot of time on this map in the past two weeks and I'm worried about breaking down some of the more complicated triggers and not being able to put them back together properly. It may turn out that I've closed a lot of them myself, or maybe my map is the Titanic. So far though, we've had half hour games with four people that don't lag it out or cause us issues. Basically I'm wondering if someone would take a look at my map and send me some notes.


TLDR; I taught myself to make a map over the past two weeks and it turned out awesome. Tons of unique spells and gameplay elements. I mostly learned by experimenting and am just now learning about leaks. So far no lag from tests. My map likely has some leaks though and I was hoping a veteran to give me some advice or some notes.

EDIT: Even if you just feel like playing it, it's quite functional so far and a lot of fun with friends! I'd also be grateful for any other notes (character ideas, spell ideas, gameplay changes).
 

Attachments

  • DemonDungeonMazeEscape v100b.w3x
    4.4 MB · Views: 35
Level 2
Joined
Aug 6, 2016
Messages
16
Thanks for the quick responses! As I read more about leaks (which I'm doing at the moment), I realize I've got a LOT of things that aren't accounted for after the trigger ends. I've never really used custom script so figuring out how that works is going to be a bit of work.

It looks like I need to set the things I "refer to" as a variable, then use custom script to remove them, correct?
 
Level 2
Joined
Aug 6, 2016
Messages
16
^ Correct but youll only need to do a custom script on a unit group and point variables and etc. to remove them ( units can be nulled too but its not necessary anyway )

Ok so if my trigger wants to create a unit at a point, I don't need to worry about the unit at all, but I DO need to worry about the point where he was created?


EDIT: Also when you say "nulled"... I've seen that term in jASS coding but not in the Custom Script. Are those one and the same? And if not, can I go about this without using JASS? My friends who've played my map think I'm a hero, but I know I'm an amateur and learning two coding languages seems like it's above my paygrade at the moment.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Exactly

So you must store first that location or point into a global variable and use it.

After using it you can remove the garbage ( leak ) its created by:
  • Custom Script: call RemoveLocation( udg_YourPointVariableName )
Note that global variables have a prefix on a custom script: udg_YourPointVariableName

After adding that line it will automatically remove that location garbage ( leak ).

Goodluck ^^

Edit: udg_ stands for "User defined globals" in case you are curious

Edit2: about the nulling, you dont actually need to null global variables unless if it is unit groups or timers. Local variables ( agents ) are only needs to null.
 
Last edited:
Level 2
Joined
Aug 6, 2016
Messages
16
So it looks like it's just a matter of going through each trigger and making sure that I create my desired point/region/group, immediately set it as a variable, use that variable (instead of using things like "every unit with 512 of blah blah blah) to reference the point/region/group from that point on. Then when the variable is no longer in use, I remove it with a custom script line. Awesome... sort of. Looks like learning this before I started would have been a time-saver but I'm too far down the rabbit-hole now.

So I have an ability that basically creates a goblin land mine that blows up and stuns those around it. It uses "pick every unit in (units within 300 of (dying unit)) and do "actions"". So he can have three of these out at once and it works fine at the moment. But part of the trigger is to pause the enemy, wait a few seconds, then unpause them. If one goes off, then another while the trigger is still going on the first one, wont the first one finish its orders at the location of the second mine? You know, since it became the new reference point for the variable after it was hit? I see it working for instant triggers, but I think I have a few that are capable of going off again before the first one finished and it seems like that could be a problem.
 
Level 11
Joined
Oct 16, 2013
Messages
246
Also when you say "nulled"...

You can null your unit variable by setting it to No unit, but I don't think it's really necesary while working with global variables.

So I have an ability that basically creates a goblin land mine that...

If I understand your problem correctly, you could use a dummy unit (or even the land mine) to cast war stomp to avoid using waits.
 
Level 2
Joined
Aug 6, 2016
Messages
16
You can null your unit variable by setting it to No unit, but I don't think it's really necesary while working with global variables.



If I understand your problem correctly, you could use a dummy unit (or even the land mine) to cast war stomp to avoid using waits.

Yes I thought about that. The Hero using the spell is a "Time Mage" and the idea is that it pauses and sets animation speed to 0 so it looks like they're "frozen" in time. So I need a trigger to do that, wait, then reset. Which means each mine will need to reference different unit groups so they dont get mixed up... I... think...
 
Status
Not open for further replies.
Top