| 10-01-2005, 05:18 PM | #1 | |
I made a trigger to kill everything on map besides some key units. It crashes the game for some reason after all the cinematics. Can anyone see something that might be causing it or even a better way to write this trigger. I also figure it must have something to do with the unit group action or the conditions because I tried making another trigger to do the same thing except that it just selects every unit type individually in a group without conditions then kills. Here is the one that crashes. --wish [code] was working =/ Quote:
|
| 10-01-2005, 06:41 PM | #2 |
That's a bit confused. I don't know what exactly might cause the crash, but with all the wierd things you do, it could be anything. Let's start with the conditions. Except for the first one, they're all irrelevant, since they all reference a "picked unit" which only gives a value in "pick every unit" loops. You should put these conditions in an if-then-else inside the loop where you kill the units. What is this supposed to do? "Unit Group - Remove all units from (Last created unit group)" What else... I'm not sure about changing game speed, that could be doing something wierd, is it really neccessary? |
| 10-01-2005, 09:54 PM | #3 | |
The game speed I did to add to the effect, maybe not necessary. I'll try changing to if,then,else. I was also under the impressing that I was supposed to remove units from a group to clear the memory. If I don't need it then great, I'll take it out. Is there anything else though that I would need to put in there as to avoid memory leaks? edit- I did fix it to work finally by changing the unit group to this Quote:
I do realise that I didn't need to do loop actions and I will change that, but could you answer my question above about memory leaks? |
| 10-02-2005, 06:00 PM | #4 |
Just removing units from a group doesn't fix a leak, the group object is still in memory, you need to destroy that to fix the leak. To do this properly, you need a temp unit group variable. Code:
Set tempGroup = (Units in (Playable map area) matching ((((Matching unit) is A structure) Not equal to True) and (((Unit-type of (Matching unit)) Not equal to Spirit of a Fallen Hero) and (((Unit-type of (Matching unit)) Not equal to Rising Champion)...
Unit Group - Pick every unit in tempGroup and do (Actions)
Loop - Actions
Unit - Kill (Picked Unit)
Custom Script: call DestroyGroup( udg_tempGroup ) |
| 10-02-2005, 06:17 PM | #5 |
Thanks for the help, I'll try setting it up that way. |
| 10-04-2005, 08:19 AM | #6 |
you can use warstomp, transfer it to an item ability, with 999999 radius and damage, then check all its targets allowed except those you don't want it to hit. |
| 10-04-2005, 03:25 PM | #7 |
I got mine working great, but I might try that anyway for kicks. |
