• 🏆 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] Spawns Not Working

Status
Not open for further replies.
Level 6
Joined
Oct 18, 2008
Messages
100
The Setup for the spawns:
  • Events
    • Time - Elapsed game time is 0.01 seconds
  • Conditions
  • Actions
    • -------- Spawns --------
    • Countdown Timer - Start Spawn as a Repeating timer that will expire in 120.00 seconds
    • Countdown Timer - Create a timer window for Spawn with title Spawns:
    • Set TimerWindow = (Last created timer window)
    • Countdown Timer - Show TimerWindow
    • -------- Lordaeron --------
    • Set Tier1[2] = 3
    • Set Tier2[2] = 2
    • Set SpawnUnitBlue[0] = Lordaeron Capital 0011 <gen>
    • Set SpawnUnitBlue[1] = Hearthglen 0725 <gen>
    • Set SpawnUnitBlue[2] = Stratholme 0724 <gen>
    • Set SpawnLocBlue[0] = (Center of LordaeronSpawn <gen>)
    • Set SpawnLocBlue[1] = (Center of Hearthglen <gen>)
    • Set SpawnLocBlue[2] = (Center of Stratholme <gen>)
The Actual Spawning:
  • Events
    • Time - Spawn expires
  • Conditions
  • Actions
    • Quest - Display to (All players) the Quest Update message: Narrator: The battl...
    • For each (Integer Temp_i) from 0 to 2, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Owner of SpawnUnitBlue[Temp_i]) Equal to Player 2 (Blue)
          • Then - Actions
            • For each (Integer Temp_iA) from 0 to Tier1[2], do (Actions)
              • Loop - Actions
                • Set Temp_P = SpawnLocBlue[Temp_i]
                • Unit - Create 1 Footman for Player 2 (Blue) at Temp_P facing Default building facing degrees
                • Unit - Add |cffffd700Parry|r to (Last created unit)
                • Custom script: call RemoveLocation(udg_Temp_P)
            • For each (Integer Temp_iA) from 0 to Tier2[2], do (Actions)
              • Loop - Actions
                • Set Temp_P = SpawnLocBlue[Temp_i]
                • Unit - Create 1 Crossbowman for Player 2 (Blue) at Temp_P facing Default building facing degrees
                • Custom script: call RemoveLocation(udg_Temp_P)
            • For each (Integer Temp_iA) from 0 to Tier3[2], do (Actions)
              • Loop - Actions
                • Set Temp_P = SpawnLocBlue[Temp_i]
                • Unit - Create 1 Human Priest for Player 2 (Blue) at Temp_P facing Default building facing degrees
                • Custom script: call RemoveLocation(udg_Temp_P)
            • For each (Integer Temp_iA) from 0 to Tier4[2], do (Actions)
              • Loop - Actions
                • Set Temp_P = SpawnLocBlue[Temp_i]
                • Unit - Create 1 Royal Guard for Player 2 (Blue) at Temp_P facing Default building facing degrees
                • Custom script: call RemoveLocation(udg_Temp_P)
            • For each (Integer Temp_iA) from 0 to Tier5[2], do (Actions)
              • Loop - Actions
                • Set Temp_P = SpawnLocBlue[Temp_i]
                • Unit - Create 1 Knight for Player 2 (Blue) at Temp_P facing Default building facing degrees
                • Custom script: call RemoveLocation(udg_Temp_P)
          • Else - Actions
            • Do nothing
It only spawns one footman.
It should spawn 3 footmen & 2 crossbowmen.
Anyone can see the flaw in the system?
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Events
    • Time - Elapsed game time is 0.01 seconds
  • Conditions
  • Actions
    • -------- Spawns --------
    • Countdown Timer - Start Spawn as a Repeating timer that will expire in 120.00 seconds
    • Countdown Timer - Create a timer window for Spawn with title Spawns:
    • Set TimerWindow = (Last created timer window)
    • Countdown Timer - Show TimerWindow
    • -------- Lordaeron --------
    • Set Tier1[2] = 3
    • Set Tier2[2] = 2
    • Set SpawnUnitBlue[0] = Lordaeron Capital 0011 <gen>
    • Set SpawnUnitBlue[1] = Hearthglen 0725 <gen>
    • Set SpawnUnitBlue[2] = Stratholme 0724 <gen>
    • Set SpawnLocBlue[0] = (Center of LordaeronSpawn <gen>)
    • Set SpawnLocBlue[1] = (Center of Hearthglen <gen>)
    • Set SpawnLocBlue[2] = (Center of Stratholme <gen>)
  • Events
    • Time - Spawn expires
  • Conditions
  • Actions
    • Quest - Display to (All players) the Quest Update message: Narrator: The battl...
    • For each (Integer Temp_i) from 0 to 2, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Owner of SpawnUnitBlue[Temp_i]) Equal to Player 2 (Blue)
          • Then - Actions
            • For each (Integer Temp_iA) from 0 to Tier1[2], do (Actions)
              • Loop - Actions
                • Set Temp_P = SpawnLocBlue[Temp_i]
                • Unit - Create 1 Footman for Player 2 (Blue) at Temp_P facing Default building facing degrees
                • Unit - Add |cffffd700Parry|r to (Last created unit)
                • Custom script: call RemoveLocation(udg_Temp_P)
            • For each (Integer Temp_iA) from 0 to Tier2[2], do (Actions)
              • Loop - Actions
                • Set Temp_P = SpawnLocBlue[Temp_i]
                • Unit - Create 1 Crossbowman for Player 2 (Blue) at Temp_P facing Default building facing degrees
                • Custom script: call RemoveLocation(udg_Temp_P)
            • For each (Integer Temp_iA) from 0 to Tier3[2], do (Actions)
              • Loop - Actions
                • Set Temp_P = SpawnLocBlue[Temp_i]
                • Unit - Create 1 Human Priest for Player 2 (Blue) at Temp_P facing Default building facing degrees
                • Custom script: call RemoveLocation(udg_Temp_P)
            • For each (Integer Temp_iA) from 0 to Tier4[2], do (Actions)
              • Loop - Actions
                • Set Temp_P = SpawnLocBlue[Temp_i]
                • Unit - Create 1 Royal Guard for Player 2 (Blue) at Temp_P facing Default building facing degrees
                • Custom script: call RemoveLocation(udg_Temp_P)
            • For each (Integer Temp_iA) from 0 to Tier5[2], do (Actions)
              • Loop - Actions
                • Set Temp_P = SpawnLocBlue[Temp_i]
                • Unit - Create 1 Knight for Player 2 (Blue) at Temp_P facing Default building facing degrees
                • Custom script: call RemoveLocation(udg_Temp_P)
          • Else - Actions
            • Do nothing
Use trigger tags.

You don't need Temp_P or call RemoveLocation(udg_Temp_P), just use SpawnLocBlue[].
 
Status
Not open for further replies.
Top