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

[Trigger] Do item groups leak? If so how to fix.

Status
Not open for further replies.
Level 17
Joined
Jun 12, 2007
Messages
1,261
My question is the title.

Do they leak? And if they do how to fix it? I can't seem to make a item-group variable to store the items I pick in. And to delete them afterwards.

I know how to delete other leaks, but it's just that there is no variable to make item groups.
Is there some BJ function that I can use to delete the group that is created while picking all items in region?
 
Last edited:
Level 17
Joined
Jun 12, 2007
Messages
1,261
No jass, i refuse to learn myself anything new that I don't need.
If I want to learn, I'll learn for my exams lol.

Custom scripts should be nice, and BlargHonk I did search.
But the thing is I could not find anything related so here I am asking.

Now anybody has an answer for me?
 
Level 13
Joined
May 11, 2008
Messages
1,198
do you realize how short it is?

EVEN KNOWING NOTHING ABOUT JASS, ALL YOU HAVE TO DO IS IMPORT HIS MAP'S TRIGGERS, AND CHANGE THE SETTINGS A LITTLE. IT'S A PIECE OF CAKE, MAN.

well, anyway i can take a look at a couple of things but i don't think i'll find what you're looking for, i'm not that much into custom text...

yeah i think i understand what you are getting at...hmm...

doesn't seem that hard, this would appear to be it:
call RemoveItem(GetEnumItem())
after you do pick items and do actions set custom text as the above call for your action. enum means picked btw.

err...you didn't want to remove the items, did you? like the pick every item in a region you think leaks? i'm thinking maybe it doesn't...hmm...

yeah man, i don't think you gotta worry about it, probably...
there is a enumitem call and a groupenumunit call but no enumunit call...that would seem to indicate that when you pick the items it doesn't put them in a group, so my initial hunch would appear to be right, there's no such thing as an item group and this is kindof nonsense... there are itempools but not itemgroups. i'm not really sure what good having a unit group is if it's going to leak but oh well. i guess units have to be commanded to do things and items don't. yeah having unit groups while playing the game is nice huh? you can select more than 1 at a time right? would be interesting if in sc2 you can select more than one item at a time...wait a second there probably won't be much items in sc2 if any, nevermind.... haha i am trying to be funny i hope i succeeded.

anyway actually this was all some food for thought. sometimes i haven't totally understood what causes leaking but think i know better now. the computer is actually selecting all those units you are selecting, it can actually select more than the user can, and so that can be quite laggy selecting so many units putting them all in one group, of course the computer can do things to those units like damage them or remove them or move them instantly or give them an order i guess we are kindof restricted to giving them orders... anyway if you select a bunch of units but don't delete that selection, that could be weird to be able to select more units and more units and that could bug out really fast. i think i understand leaks better now. haha. that's if the theory i have that items won't leak like the original poster here thought that they would holds true.

nevertheless, it wouldn't surprise me if picking a lot of items at once would lag, but i don't really know. you'd have to try it to find out. i think usually if you get some lag you probably got a leak. a crash is pretty much a give away though.

if this is one of the main reasons why unit groups leak then that would be interesting to see what things leak in sc2...i kinda think perhaps unit groups will not leak so badly but i'm not sure...they will have unlimited unit selection...it's probable that my theory sucks though and is way off lol.

but yeah man, you're leaving me in suspense, why are there so many items on the ground in your map? what kinds of items are they?
 
Last edited:
Level 17
Joined
Jun 12, 2007
Messages
1,261
Yeh but the problem is, I pick a group of items, they are stored in a group.
Player groups and unit groups leak. SO I clean those.
But it would mean that item groups also leak right?

Now I want to remove the created item group, but how do I do that? I can't set a variable to be an item group.
I'm sure people can show me two custom scripts I can use to call a group for items and then delete that group after the picked items have been removed.
 
Level 13
Joined
May 11, 2008
Messages
1,198
but i'm telling you there's no such thing as an item group. show me an item group in gui, i can't find one.

like i said, if all you're trying to do is get rid of the items, after you pick them run the custom script as:

call RemoveItem(GetEnumItem())

that's it.

if there's no such thing as an item group, how are they supposed to leak?
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
This leaks:
  • Actions
    • Unit Group - Pick every unit in Units owned by (Triggering player) and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)
This is how it's fixed.
  • Actions
    • Set DieGroup[1] = (Units owned by (Triggering player))
    • Unit Group - Pick every unit in DieGroup[1] and do (Actions)
      • Loop - Actions
        • Unit - Kill (Picked unit)
    • Custom script: call DestroyGroup(udg_DieGroup[1])
So this should leak aswell right...

  • Actions
    • Item - Pick every item in S Coguwa City <gen> and do (Actions)
      • Loop - Actions
        • Item - Remove (Picked item)
Or am I wrong and does this not create a leak? As this will happen once per second in my map for about 50 regions and if it leaks my map is dead.
 
Level 13
Joined
May 11, 2008
Messages
1,198
yeah man see your gui? it says unit group but it doesn't say item group.

you're talking about item groups but i don't see any.

does doing what you're doing lag? because if so, then something else might be wrong. but it doesn't look like you got a problem there.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
Oh sorry, missread last post (stupid me...). Anyway, there is no such thing as an item group, and thus it can not leak. The loop works based on area and the items it loops through can not be treated or grouped as a single object but have to be manipulated individually. Put in simple terms, there is no "item group" type object thus it is impossiable for one to leak due to it not existing.

If you mean itempools (item drop tables), they can leak, but can be destoryed and so will not in well made triggers.
 
Status
Not open for further replies.
Top