HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Leak Check Help!

07-29-2006, 07:30 PM#1
scmstrack06
I am creating a maze map, and using TFT editor. It's very hard to make a region on every side of every path, including all the diagonal pathing I have, which you can't make diagonal regions. I tried using "Maze Region Writer" to write a trigger for me. That did not work, and all my regions were messed up, from the diagonals and all. So I made a trigger that I hoped would work. It is as follows:



Trigger:
Fall Off Path
Collapse Events
Time - Every 0.15 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in Grunts and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Terrain type at (Position of (Picked unit))) Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True)
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has an item of type ) Equal to True
Then - Actions
Collapse Else - Actions
Unit - Kill (Picked unit)
Else - Actions






I used the program "Leak Checker," and it tells me to fix it by doing this:


(Suggested fix) Set L = (Position of (Picked unit))) Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True)
(Suggested fix) Custom Script: Call RemoveLocation(udg_L)

Where do I get (Position of (Picked unit) without using Terrain type at position of picked unit? And what is "Set L?"
07-29-2006, 07:33 PM#2
Fireeye
L is a Point variable, every time you pick a unit you create a point and that can cause massive laggs. (I know it, cause i make a escape on myself)
You set L = Position of Picked Unit and when it's checked you destroy the point again, so the leak is minimal.
07-29-2006, 07:38 PM#3
darkwulfv
Firstly, please use trigger tags so it's easier to read your trigger.
Second, I think I can help you out. Give me a minute so I can check to be sure I'm correct, and I'll give you directions.
Dammit Fireeye, you beat me ^_^.

Here's instructions anyways, in case you may need them.
1) make a Point(location) variable in the variable editor, name it L.
2) Use custom script, and type "local location udg_L"
3) After the condition that checks whether your unit is on the black marble, then put in the following action part the action:
Set Variable L = (position of (picked unit))).
4) continue your trigger, but after the Kill unit action, put in custom script saying set local L = null and you should be good to go!

P.S. thx for fixing it to trigger tags
07-29-2006, 07:48 PM#4
darkwulfv
custom script is an action. I gave you instructions in my above post.
07-29-2006, 07:50 PM#5
scmstrack06
woops you must have just done the instructions
07-29-2006, 07:53 PM#6
darkwulfv
Yea, It took a bit to type them up for you. Hope they make sense. If not, let me know and I'll make the trigger up for you.
Will I get repped for this?...^_^
07-29-2006, 07:58 PM#7
scmstrack06
Trigger:
Fall Off Path
Collapse Events
Time - Every 0.15 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in Grunts and do (Actions)
Collapse Loop - Actions
Custom script: local location udg_L
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Terrain type at (Position of (Picked unit))) Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True)
Collapse Then - Actions
Set L = (Position of (Picked unit))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has an item of type ) Equal to True
Then - Actions
Collapse Else - Actions
Unit - Kill (Picked unit)
Custom script: set local L = null
Else - Actions


Thank you so much for helping me! There is one more problem, it says after doing this, that it is expecting a Variable name on the "set local L= null" thing. What do I do to fix that?

Lol of course you will be repped for this, you've been a great help.

Also, running it again in Leak Checker, it's still asking me to do:

(Suggested fix) Set L = (Position of (Picked unit))) Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True) which I can't do in actions.

Sorry for all the trouble. :(
07-29-2006, 08:06 PM#8
darkwulfv
no problem, I more than happy to help. Looks like I made a mistake. Replace the bad script with this one, and It should work.
set udg_L = null
I made a mistake, making locals in GUI is confusing.
Once you fix that, I think the leak checker will change too. If not, I don't know what else leaks... But I don't think it's too major. Also, you may want to set your periodic timer to a slightly smaller amount, maybe .10.
I enjoy helping people whith problems, just as long as I know how to actually fix it...lol. That's why I can rarely help, becuase either I don't know how to fix it, or someone beat me to it.
07-29-2006, 08:11 PM#9
Fireeye
Same like me, btw. when you don't ask for a trigger solution i won't give it.
Well, i prefer this way. It works too.
Trigger:
Unit Group - Pick every unit in Grunts and do (Actions)
Collapse Loop - Actions
set L = Position of (Picked Unit)
<Your command>
Custom script: call RemoveLocation (udg_L)
07-29-2006, 08:14 PM#10
darkwulfv
Yea, both work fine in this case. I prefer to do it after, so I can see exactly where it comes from.
And although I try to help people, many times people beat me to it, so even though I know the answer, I don't get to share...
Also, I really dislike indirectly making locals in GUI (i mean like helping somebody) becuase then I make mistakes, like i did a minute before. Ah well, prblem solved. I'm happy I helped.
07-29-2006, 08:17 PM#11
scmstrack06
lmao ty guys so much.. but guess what? Leakage:

Trigger:
Leak!
Collapse
Total lines: 21
Collapse
(Line: 11 ) (Word: 4 ) Position Leak
((Terrain type at (Position of (Picked unit))) Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True)
((Terrain type at ^Leak
(Suggested fix) Set L = (Position of (Picked unit))) Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True)
(Suggested fix) Custom Script: Call RemoveLocation(udg_L)

Current trigger I made by your help:

Trigger:
Fall Off Path
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in Grunts and do (Actions)
Collapse Loop - Actions
Custom script: local location udg_L
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Terrain type at (Position of (Picked unit))) Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True)
Collapse Then - Actions
Set L = (Position of (Picked unit))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has an item of type ) Equal to True
Then - Actions
Collapse Else - Actions
Unit - Kill (Picked unit)
Custom script: set udg_L = null
Else - Actions
07-29-2006, 08:19 PM#12
darkwulfv
Terrain leaks? I don't think it does. I'm not quite sure what it's asking, but I'll look into it. Give me a minute or two, and I'll try to help.
EDIT: woah lol it does. There is a variable called Terrain Type, but I don't think you can set 2 locals variables in GUI. I honestly don't think it will lag that much. I don't know how to fix this one... The only way I can think of is by switching to JASS. You know what, how about I do it for you here, since I need to work on my JASS. I'll use your trigger and turn it into a non-lag trigger. :D I'll post it when I have a chance.
07-29-2006, 08:26 PM#13
Fireeye
i know what it wants, but it's not a leak (i think), he want you to use the variable L instead of Position of (picked Unit)
Trigger:
((Terrain type at L)Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True)
07-29-2006, 08:28 PM#14
Captain Griffen
Leakless trigger:

Trigger:
Fall Off Path
Collapse Events
Time - Every 0.10 seconds of game time
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in Grunts and do (Actions)
Collapse Loop - Actions
Custom script: local location udg_L
Set L = (Position of (Picked unit))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Terrain type at L Equal to Dalaran - Black Marble) and (((Picked unit) is A Hero) Equal to True)
Collapse Then - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) has an item of type ) Not equal to True
Collapse Then - Actions
Unit - Kill (Picked unit)
Else - Actions
Else - Actions
Custom script: call RemoveLocation(udg_L)
Custom script: set udg_L = null
07-29-2006, 08:30 PM#15
darkwulfv
Oh that works... Lol didn't know thats what he wanted completely forgot about setting picked unit to L. Well, that savs me from making a huge JASS trigger *hooray!*