• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Unit Build Orders?

Status
Not open for further replies.
Level 18
Joined
Mar 13, 2009
Messages
1,411
For my map I need a trigger that if a structure trains a unit, the structure is automatically ordered to train a new unit of the same type.

The only thing I can find in the Editor are Unit-specific build orders and I need to make this trigger work for multiple unit types.

The solutions I could think of are:
Making a new action for each single unit-type in my map;
Putting each unit-type and order in Array Variables and then working out something with a For each Integer kind of trigger.

Wouldn't there be an easier, more efficient way to just give a new build order? Preferably without the need to make a Custom build order for each unit (which I don't know how to do yet).
 
Last edited:
Level 18
Joined
Mar 13, 2009
Messages
1,411
There must be some way of converting from unit type to build order. Mind you, wc3 lacked something like that, so I guess they didn't think to put it in sc2 either D:

Something like this would work in Warcraft III:
  • Train Unit
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to train/upgrade to a (Unit-type of (Trained unit))
This would make it a bit more complicated:
  • Train Unit
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Trained unit)) Equal to trainUnitType[(Integer A)]
            • Then - Actions
              • Unit - Order (Triggering unit) to train/upgrade to a trainUnitType[(Integer A)]
            • Else - Actions
The only orders I see in Starcraft II though are unit-specific. In that case I would have to make a custom build order for each specific unit, put them in an array and then trigger it like I did in my second example... kinda inefficient if you ask me.

This is my inefficient way which would require a custom build order for each single unit in my map:

buildu.png


Haven't checked if it works yet though.




Edit: Saving gives me an error on my Initialization for

gv_orderBuildUnit[1] = Order(AbilityCommand("BarracksTrain", 0));

"Implicit cast not allowed"
 
Last edited:
Status
Not open for further replies.
Top