• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Return All

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,220
  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set train_Type[1] = Peasant
      • Set gold_cost[1] = 100
      • Set lumber_cost[1] = 0
      • Set train_Type[2] = Rifleman
      • Set gold_cost[2] = 150
      • Set lumber_cost[2] = 25
      • Set train_Type[3] = Knight
      • Set gold_cost[3] = 200
      • Set lumber_cost[3] = 55
      • Set count = 3
  • cancel
    • Events
      • Unit - A unit Cancels training a unit
    • Conditions
    • Actions
      • Custom script: local unit udg_u
      • For each (Integer A) from 1 to count, do (Actions)
        • Loop - Actions
          • Custom script: set udg_u = GetResearchedUnit()
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of u) Equal to train_Type[(Integer A)]
            • Then - Actions
              • Player - Add gold_cost[(Integer A)] to (Owner of (Triggering unit)) Current gold
              • Player - Add lumber_cost[(Integer A)] to (Owner of (Triggering unit)) Current lumber
            • Else - Actions
The custom script needs you to have a unit variable called u. I am pretty sure you can't replace it with a pure GUI action, however, I am uncertain and might be wrong here.

edit: edit or use this; http://www.hiveworkshop.com/forums/...245280/?prev=t=65&r=20&d=list&status=a&page=2
 
Last edited:
Status
Not open for further replies.
Top