• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Loop restarts!

Status
Not open for further replies.
Level 6
Joined
Jun 20, 2005
Messages
108
I have this loop at map init. and it seems to restart at some point (i get hundreds of units). It seems to have something to do with the 6th item on the unit's inv. When I delete that row it works properly.

Any help?

Thanks in advance

  • For each (Integer i) from 1 to 4, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player(i)) slot status) Equal to Is playing
          • ((Player(i)) controller) Equal to User
        • Then - Actions
          • Set FLAG_Playing[1] = True
          • Player Group - Add (Player(i)) to GROUP_CurrentPlayers[1]
          • Player Group - Add (Player(i)) to GROUP_InitialPlayers[1]
          • Player Group - Add (Player(i)) to GROUP_InitialPlayers[3]
          • Unit - Create 1 Spellbringer for (Player(i)) at ((Center of (Entire map)) offset by (6400.00, (2816.00 + (512.00 x (Real(i)))))) facing Default building facing degrees
          • Set UNIT_Spellbringer[i] = (Last created unit)
          • Trigger - Add to RemoveHavroth <gen> the event (Unit - A unit owned by (Player(i)) Dies)
          • Trigger - Add to RemoveSidhlot <gen> the event (Unit - A unit owned by (Player(i)) Dies)
          • Trigger - Add to RemoveUthmor <gen> the event (Unit - A unit owned by (Player(i)) Dies)
          • Trigger - Add to TK <gen> the event (Unit - A unit owned by (Player(i)) Is attacked)
          • Trigger - Add to Spellbringer mana <gen> the event (Unit - UNIT_Spellbringer[i]'s mana becomes Greater than 1000.00)
          • Trigger - Add to Spellbringer mana full <gen> the event (Unit - UNIT_Spellbringer[i]'s mana becomes Greater than 1900.00)
          • Hero - Create Summon Uthmor and give it to UNIT_Spellbringer[i]
          • Hero - Create Summon Arhat and give it to UNIT_Spellbringer[i]
          • Hero - Create Summon Sidhlot and give it to UNIT_Spellbringer[i]
          • Hero - Create Summon Hav'roth and give it to UNIT_Spellbringer[i]
          • Hero - Create Mana Recharge and give it to UNIT_Spellbringer[i]
          • Hero - Create Chain Heal and give it to UNIT_Spellbringer[i]
          • Item - Create Chain Heal at (Center of (Playable map area))
          • Hero - Give (Last created item) to UNIT_Spellbringer[i]
          • Player - Set (Player(i)) Food max to 9999999
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(i)) is in GROUP_CurrentPlayers[1]) Equal to True
            • Then - Actions
              • Player - Add 250 to (Player(i)) Current gold
            • Else - Actions
          • Wait 0.05 seconds
        • Else - Actions
 
Level 6
Joined
Jun 20, 2005
Messages
108
I don't know why, but the last "give item to unit" should be disabled, when I pasted here it got enabled again.. weird.

but anyway, when i tested it wasn't there, and even if it were, shouldn't the item be placed on the ground instead?
 
Remove the wait anyway. (And because the text is the same whether its disabled or not, the
  • tags don't pick up whether it's disabled or not :P)
  • But yeah, delete the [trigger]Item - Create Chain Heal at (Center of (Playable map area))
  • Hero - Give (Last created item) to UNIT_Spellbringer[i]
stuff because the unit's already got a Chain Heal anyway.
 
Status
Not open for further replies.
Top