| 01-25-2009, 01:40 AM | #1 |
Trigger: Seems like a simple enough loop, but it closes wc3 when it fires. It's handling 25 units, which doesn't seem like it should be too much, so why is this crashing? |
| 01-25-2009, 01:53 AM | #2 |
dont destroy GUI globals, never. |
| 01-25-2009, 02:15 AM | #3 | |
Quote:
How do you expect GUI'ers remove leaks. |
| 01-25-2009, 06:17 AM | #4 |
It's a global variable, not a local. Clear the group, don't destoy it. EDIT: After reading the proceeding posts, I'd like to add that I'm wrong and am an idiot for not remembering that those group functions create groups. |
| 01-25-2009, 07:31 AM | #5 |
It still crashes the game, it's not the cause. :/ |
| 01-25-2009, 08:40 AM | #6 |
You destroy global group and leak rect...clean up fail. Post map, if you destroy group anywhere or attack nothing game may run unstable. |
| 01-25-2009, 09:36 AM | #7 | ||
Quote:
Quote:
Code:
Set G = (Units of type Footman) JASS:function GetUnitsOfTypeIdAll takes integer unitid returns group local group result = CreateGroup() local group g = CreateGroup() local integer index set index = 0 loop set bj_groupEnumTypeId = unitid call GroupClear(g) call GroupEnumUnitsOfPlayer(g, Player(index), filterGetUnitsOfTypeIdAll) call GroupAddGroup(g, result) set index = index + 1 exitwhen index == bj_MAX_PLAYER_SLOTS endloop call DestroyGroup(g) return result endfunction As for the question, do you have any trigger like |
| 01-25-2009, 10:56 AM | #8 |
He does need to destroy the group. Don't confuse the need to null locals with the object leak... Anyway, could be setting off some other trigger that detects orders? |
| 01-25-2009, 12:33 PM | #9 |
The crash could be caused by something like an infinite loop, but it's definitely not caused by this trigger alone. |
| 01-25-2009, 12:38 PM | #10 |
How do you get the value for the int_LevelNumber? Did you remember to "close" it? |
| 01-25-2009, 02:00 PM | #11 |
Captain Griffen There is MANY BJ functions that linked to global and destruction of such object cause "bug cascade", if you code GUI only, dont destroy anything. OFC if you able to check every function you using you can destroy\clean what you want, but in this case you dont need GUI... |
| 01-25-2009, 02:56 PM | #12 |
In this case, the destroy group should be at the very start of the trigger. |
| 01-25-2009, 09:49 PM | #13 |
Holy shit, every tutorial says to destroy the group when using GUI and you guys just said about 3 different things, all contradicting each other. Which is it? Anyways, it shouldn't be connected to int_LevelNumber, that is only changed when a countdown timer expires. I don't want to post the entire map, it's a finished product. If you want to take a look at it, post and I might PM it to you. I'm currently running through every trigger that interacts with that one and trying to debug it. I'm starting to think that Griffen is right. I think I have some order functions in here to keep units from getting stuck, I'll play around with them see if that fixes things. |
| 01-25-2009, 09:58 PM | #14 |
War3 crash with a box message or without it ? But i'm agree it can't be this trigger, at least not by itself |
