• 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.

Automatic unit creation triggers

Status
Not open for further replies.
Level 2
Joined
May 18, 2019
Messages
20
i know this thread is here somewhere, but search doesn't want to cooperate in finding it (it doesn't work for me somehow, idk if it works for you guys) can someone provide link for that thread please?
 
Level 2
Joined
May 18, 2019
Messages
20
I want a building to produce units automaticaly for the player (for example red) that captures them under his control but only if they are in the ownership of that player when they are neutral i want them to do nothing
Also if possible set rally point without player's command and if the different player captures them (for example blue captures red's building) so the rally point switches to blue's preference of rally points
I hope it's understandable
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
You can try (Assuming you have your system to capture that barracks)
  • Events
    • Unit - A unit changes owner
  • Conditions
    • Unit-type of (Triggering Unit) Equal to "Your barracks"
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Owner of (Triggering unit) is not equal to Neutral Passive
      • Then - Actions
        • Unit - Order (Triggering Unit) Training "Your unit"
        • Set Temp_Loc = "Your rally point"
        • Unit - Set Rally Point of (Triggering Unit) to Temp_Loc
        • Custom script: RemoveLocation(udg_Temp_Loc)
      • Else - Actions
        • Unit - Replace (Triggering Unit) to with a (Unit-Type of (Triggering unit)) (This is the unique way to cancel training)
To loop the training
  • Events
    • Unit - A unit finishes the training of a unit
  • Conditions
  • Actions
    • Unit - Order (Triggering unit) train (Unit-type of (Trained unit))
 
Status
Not open for further replies.
Top