| 08-01-2008, 07:12 AM | #2 |
You're killing the rifleman twice, for one thing. That might be crashing your thread. (Killing all riflemen). You're also removing a single picked unit, (dunno if that would even work since it's outside of an enum call), "Kill (Triggering Unit)" is not needed since the triggering unit must be a rifleman and you already kill all of them. Also, why not shift those conditions for the If/Then directly into the conditions section? |
| 08-01-2008, 07:20 AM | #3 | |||
Quote:
Quote:
Quote:
|
| 08-01-2008, 07:26 AM | #4 | |
Quote:
Unit type HAS to be a rifleman, right? So: The triggering unit (the unit who entered) is now in P1Upgrade, right? So, that would be 9 riflemen, since your trigger checks for 9. Otherwise, it wouldn't work (9 + 1 = 10, no?) You then pick every unit in P1Upgrade which INCLUDES the triggering unit, because he has to be in P1Upgrade for the trigger to fire. You then kill all the riflemen. And for the record, I really don't think Remove (Picked Unit) works, since it's outside of a Unit-Group loop. Afterwards, you proceed to kill the triggering unit who already should've been killed because he was in P1Upgrade when all the riflemen were picked and killed. Make sense? Another way to put it: There's 8 riflemen in P1Upgrade. The ninth enters, triggering the actions. So now there are 9 riflemen. You kill all the riflemen in P1Upgrade, which is 9. 9 - 9 = 0. You then remove the picked unit. Which doesn't work. But if it did somehow, that'd be 0 - 1. -1. You can't have -1 units. If that doesn't work, you till have 0 units. You then proceed to kill the trigger unit. Which is 0 - 1 = -1. You can't kill a unit that's already dead. And if you were trying to remove all those riflemen, killing one could cause problems since the "Triggering Unit" would be an empty handle. |
| 08-01-2008, 07:33 AM | #5 | ||||
Quote:
Quote:
Quote:
Quote:
|
| 08-01-2008, 07:39 AM | #6 | |||
Quote:
Quote:
Quote:
|
| 08-01-2008, 07:47 AM | #7 |
I can't explain why its doing what its doing. Maybe I can explain what I want the trigger to do. if 9 units enter p1upgrade if all of those 9 units are riflemen kill all riflemen create 1 marine at Player 1 USpawn Then I want to repeat if for as many times as I need. The trigger that I used above is copy/pasted so there are no typo's. What actually happens is this. I bring 9 riflemen to p1upgrade (nothing happens) I bring 1 more riflemen to p1upgrade (9 riflemen die and the 10th is left there and the marine is created at Player 1 USpawn) And to top it off, it only works once. |
| 08-01-2008, 10:21 AM | #8 |
There is a bug, that sometimes the unit which triggers the "Unit-Enters Region" Event isn't really inside the region: http://www.wc3campaigns.net/showthread.php?t=61918 And as darkwulfvsaid: The Remove Picked Unit-thing doesn't work outside a pick every unit-loop, just replace Kill Picked Unit with Remove Picked Unit. Trigger: Then - Actions
![]() Unit Group - Pick every unit in (Units in P1Upgrade <gen> matching ((Unit-type of (Matching unit)) Equal to Rifleman)) and do (Unit - Remove (Picked unit) from the game)
![]() Unit - Create 1 Marine for Player 1 (Red) at (Center of Player 1 USpawn <gen>) facing Default building facing degrees |
| 08-01-2008, 04:19 PM | #9 | |
Quote:
I think you just have to remove all the units from the unit group to prevent leaks, you don't have to remove that unit from the game. |
| 08-01-2008, 04:31 PM | #11 | |
Quote:
I think I am just going to try to set them all in a temp group then destroy the group. This may be the reason why the triggering unit doesn't get picked. Using Unit Group - Pick every unit does in fact cause leaks if you do not set them to a unit group. |
