Auto-cast train units.

bluedevil333

New Member
Reaction score
1
Hello. I am looking for instructions on how to auto-train units. like when you right click on a unit (an scv for example) and when one is done building it builds more.
i would rather not use a trigger, or make a new unit, because i made a new unit and have modified it already, and am just looking on how to add the ability to be able to auto train units.

thanks
 

X-maul

AKA: Demtrod
Reaction score
201
As far as I know you will have to use a trigger, but it's a rather simple trigger though:
Trigger:
  • Autotrain
    • Events
      • Unit - Any Unit training progress is Completed
    • Local Variables
    • Conditions
    • Actions
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • (Unit type of (Triggering progress unit)) == Marine
        • Then
          • Unit - Order (Triggering unit) to (Barracks - Train Marine) (After Existing Orders)
        • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • (Unit type of (Triggering progress unit)) == Marauder
        • Then
          • Unit - Order (Triggering unit) to (Barracks - Train Marauder) (After Existing Orders)
        • Else

This trigger will initiate when a unit is trained, and then it will order the training facility to train it again.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
A data solution would be to give the building a behavior with a periodic effect of the "Issue Order" type. Make it issue the "Build *Your Unit*" order to the caster.

Question: Do you want the building to always auto-build the unit or just after you right click the button?
 

bluedevil333

New Member
Reaction score
1
A data solution would be to give the building a behavior with a periodic effect of the "Issue Order" type. Make it issue the "Build *Your Unit*" order to the caster.

Question: Do you want the building to always auto-build the unit or just after you right click the button?

Only when you right click the button, sorry for the long delay between me posting.
 

Dave312

Censored for your safe viewing
Reaction score
269
Create a new ability of the type Effect - Instant and use a Issue Order effect as the effect. Then in the buildings command card, instead of having buttons to train the units via the "train" ability, tie the buttons to the Effect - Instant abilities. That way, you will be able to make them auto-cast and they will still train units when clicked. The only problem you might have is trying to tell the auto-cast when to train units...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top