• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Trigger doesn't work right

Status
Not open for further replies.
Level 17
Joined
Apr 24, 2005
Messages
762
When my unit enters an area, it should destroy the clustered eggs in that area (Neutral Passive) and spawn an # amount of units in that area, but instead of the 4 units that it should spawn it spawns like 20. I don't understand at all why it would do that?

  • Spawn 1
    • Events
      • Unit - A unit enters Region 118 <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Unit1
          • (Unit-type of (Triggering unit)) Equal to Unit2
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit Group - Pick every unit in (Units in Region 118 <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to Neutral Passive
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
          • Unit - Create 4 Units for Player 12 (Brown) at (Center of Region 118 <gen>) facing Default building facing degrees
 
Level 9
Joined
Aug 21, 2008
Messages
533
You put the spam action into the loop, which casues the trigger to spawn 4 spiders for every unit it finds. Ou tthe action outside to loop to make it working.
maybe something like this:

  • Spawn 1
    • Events
      • Unit - A unit enters Region 118 <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Unit1
          • (Unit-type of (Triggering unit)) Equal to Unit2
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Create 4 Units for Player 12 (Brown) at (Center of Region 118 <gen>) facing Default building facing degrees
      • Unit Group - Pick every unit in (Units in Region 118 <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Equal to Neutral Passive
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
 
Status
Not open for further replies.
Top