| 07-26-2008, 08:39 PM | #2 |
I don't know if I'm stupid or something, but this: Trigger: ![]() For each (Integer creepNum) from 0 to creepNum, do (Unit Group - Pick every unit in (Units in Player1Zone <gen> owned by Player 2 (Blue)) and do (Set Lives = (Lives - 1)))![]() For each (Integer creepNum) from 0 to creepNum, do (Unit Group - Pick every unit in (Units in Player1Zone <gen> owned by Player 2 (Blue)) and do (Unit - Kill (Random unit from CreepsUnitGroup)))are REALLY confusing, wtf is Integer creepNum?? I thought there were only Integer A and Integer B, how did you do that? Another thing, what you're doing is for each creep you're picking the whole group and killing them and whatnot. If you, for example, had 50 creeps, you would pick that group and kill each of them 50 times (maybe that was causing the crash). So instead of those integer loops, use "Pick every unit in unit group" action, I hope you understand why. Btw, I don't see why you needed that condition (in the second trigger) that checks if the triggering unit is in that region, if the trigger fires when the unit enters the region, I think it's logical that the unit is in it. Also, in the last trigger you will probably have major lags, because you have a pretty serious leak here: Trigger: Set CreepsUnitGroup = (Units in Player1Zone <gen> owned by Player 2 (Blue))No good, man, destroy the bastard: Trigger: ![]() Custom script: call DestroyGroup(udg_CreepUnitGroup)![]() Set CreepsUnitGroup = (Units in Player1Zone <gen> owned by Player 2 (Blue))I think that's the right way to do it. |
| 07-26-2008, 09:05 PM | #3 | |||
Quote:
However, when I use "Pick every unit in unit group" the action I use is "Unit - Kill (triggering unit)" BUT like I stated before, it doesn't do it fast enough. I need to be able to kill ALL the creeps when isLevel = false (which is about 10 seconds). Quote:
Quote:
The question still remains...how do I kill all the remaining creeps (creepNum, the number of creeps, can only be a max of 20.) in the 10 seconds that isLevel = False? |
| 07-26-2008, 11:54 PM | #4 |
Trigger: For each (Integer creepNum) from 0 to creepNum...converts to: JASS:set udg_creepNum = 0 loop exitwhen udg_creepNum > udg_creepNum call Do stuff() set udg_creepNum = udg_creepNum + 1 endloop The problem is creepNum will never be greater than itself, so you will hit an infinite loop. To fix this, use another variable for your loop variable (like tempint) or use Integer A/ Integer B If you are using The Frozen Throne World Editor, I would use the "and do multiple actions" as it's more efficient than using 2 loops. |
