• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

My unit spawn wont work

Status
Not open for further replies.
Level 2
Joined
Feb 12, 2008
Messages
7
Im making a map and the other day i tested it. The spawning i put in it only works for red and teal. I made the same triggers for each player and im really not sure whats wrong. If someone could help me that would be AWESOME.
 
Level 2
Joined
Feb 12, 2008
Messages
7
Here is the trigger to control number spawned
Human Spawn number
Events
Unit - A unit Finishes construction
Conditions
(Unit-type of (Constructed structure)) Equal to Farm
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Then - Actions
Unit Group - Add (Constructed structure) to farm[1]
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 2 (Blue)
Then - Actions
Unit Group - Add (Constructed structure) to farm[2]
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 3 (Teal)
Then - Actions
Unit Group - Add (Constructed structure) to farm[3]
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 4 (Purple)
Then - Actions
Unit Group - Add (Constructed structure) to farm[4]
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 5 (Yellow)
Then - Actions
Unit Group - Add (Constructed structure) to farm[5]
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Owner of (Triggering unit)) Equal to Player 6 (Orange)
Then - Actions
Unit Group - Add (Constructed structure) to farm[6]
Else - Actions
Do nothing




Here is the trigger that spawns the units
Human
Events
Time - Every 5.00 seconds of game time
Conditions
Actions
Unit - Create (Number of units in farm[1]) Peasant for Player 1 (Red) at (Center of Red Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[1]) Peasant for Player 1 (Red) at (Center of Red Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[2]) Peasant for Player 2 (Blue) at (Center of Blue Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[2]) Peasant for Player 2 (Blue) at (Center of Blue Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[3]) Peasant for Player 3 (Teal) at (Center of Teal Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[3]) Peasant for Player 3 (Teal) at (Center of Teal Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[4]) Peasant for Player 4 (Purple) at (Center of Purple Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[4]) Peasant for Player 4 (Purple) at (Center of Purple Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[5]) Peasant for Player 5 (Yellow) at (Center of Yellow Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[5]) Peasant for Player 5 (Yellow) at (Center of Yellow Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[6]) Peasant for Player 6 (Orange) at (Center of Orange Spawn <gen>) facing (Center of (Playable map area))
Unit - Create (Number of units in farm[6]) Peasant for Player 6 (Orange) at (Center of Orange Spawn <gen>) facing (Center of (Playable map area))
 
Here is the trigger to control number spawned
  • Human Spawn number
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Farm
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Unit Group - Add (Constructed structure) to farm[1]
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
        • Then - Actions
          • Unit Group - Add (Constructed structure) to farm[2]
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
        • Then - Actions
          • Unit Group - Add (Constructed structure) to farm[3]
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
        • Then - Actions
          • Unit Group - Add (Constructed structure) to farm[4]
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
        • Then - Actions
          • Unit Group - Add (Constructed structure) to farm[5]
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
        • Then - Actions
          • Unit Group - Add (Constructed structure) to farm[6]
        • Else - Actions
          • Do nothing



Here is the trigger that spawns the units
  • Human
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create (Number of units in farm[1]) Peasant for Player 1 (Red) at (Center of Red Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[1]) Peasant for Player 1 (Red) at (Center of Red Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[2]) Peasant for Player 2 (Blue) at (Center of Blue Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[2]) Peasant for Player 2 (Blue) at (Center of Blue Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[3]) Peasant for Player 3 (Teal) at (Center of Teal Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[3]) Peasant for Player 3 (Teal) at (Center of Teal Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[4]) Peasant for Player 4 (Purple) at (Center of Purple Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[4]) Peasant for Player 4 (Purple) at (Center of Purple Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[5]) Peasant for Player 5 (Yellow) at (Center of Yellow Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[5]) Peasant for Player 5 (Yellow) at (Center of Yellow Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[6]) Peasant for Player 6 (Orange) at (Center of Orange Spawn <gen>) facing (Center of (Playable map area))
      • Unit - Create (Number of units in farm[6]) Peasant for Player 6 (Orange) at (Center of Orange Spawn <gen>) facing (Center of (Playable map area))

Next time use [ TRIGGER] [/ TRIGGER] tags, like I did in quote, please, it looks better that way.. :p

You set all the spawn points, and you made each player build a farm? Becuase it looks like it would have to, in order to work..
 
Level 2
Joined
Feb 12, 2008
Messages
7
ya you get units based on how many farms you have. in the test only reds and teals units would spawn after everyone built a farm
 
Status
Not open for further replies.
Top