• 🏆 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!

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