HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

removing unwanted units

07-22-2006, 06:16 PM#1
evilmapcreater
Trigger:
remove
Collapse Events
Time - Every 1.00 seconds of game time
Conditions
Collapse Actions
Collapse Player Group - Pick every player in (All players matching (((Matching player) slot status) Not equal to Is playing)) and do (Actions)
Collapse Loop - Actions
Collapse Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
Collapse Loop - Actions
Unit - Remove (Picked unit) from the game

dosent do any thing, tested it in bnet to. maybe i have my condition wroung?
07-22-2006, 06:28 PM#2
Captain Griffen
If no player is in the slot, then there is no player, only a slot, and thus the player is not in 'All players'.

Thus using for each integer is far superior.
07-22-2006, 07:06 PM#3
evilmapcreater
so ummm.... how do i fix it?
07-22-2006, 07:17 PM#4
The)TideHunter(
What i would do is this:

Trigger:
Remove Unwanted Units
Collapse Events
Time - Every 1.00 seconds of game time
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 12, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Player((Integer A))) slot status) Not equal to Is playing
Collapse Then - Actions
Set TempGroup = (Units owned by (Player((Integer A))))
Unit Group - Pick every unit in TempGroup and do (Unit - Remove (Picked unit) from the game)
Custom script: call DestroyGroup(udg_TempGroup)
Else - Actions
07-22-2006, 09:21 PM#5
James1654
I recomend you go to this tutorial, evilmapcreator:

http://www.wc3campaigns.net/showthread.php?t=55022

It shows you how to reduce memory leaks in gui. The trigger you used will create delays for your map. The)TideHunter('s version is correct, use that. But I really recomend that you try out the tutorial, or your map will have major delays if all your triggers have memory leaks.