• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

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