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

Auto-Spawn with food cap

Status
Not open for further replies.
Level 7
Joined
May 30, 2018
Messages
290
Hey there, I made following trigger:

  • Footman
    • Events
      • Time - SpawnTimer expires
    • Conditions
    • Actions
      • Set VariableSet SpawnUnitGroup = (Units of type Barracks)
      • Unit Group - Pick every unit in SpawnUnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) Food used) Less than or equal to ((Picked player) Food cap)
            • Then - Actions
              • Set VariableSet TempPoint = (Position of (Picked unit))
              • Unit - Create 1 Footman for Player 1 (Red) at TempPoint facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Random point in Region 001 <gen>)
            • Else - Actions
              • Do nothing
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_SpawnUnitGroup)

How do I change the trigger, that the unit spawned belongs to the owner of the building, which produces the unit? (not just specificly red like in this case)
 
Last edited:
Status
Not open for further replies.
Top