• Check out the results of the Techtree Contest #19!
  • 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 void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Gold

Status
Not open for further replies.
Level 11
Joined
Mar 30, 2008
Messages
650
Hey !
I need a little help with a trigger.
I need a bulding that gives you 5 gold per second.
  • Gold pe secunda 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
      • (Unit-type of (Triggering unit)) Equal to Factory
    • Actions
      • Player - Add 1 to Player 1 (Red) Current gold
This doesn't works.
 
The problem is that you dont got anything checking that the Factory is built
Make A Variable type with Unit type.
Try this
  • Events
    • A unit finishes constructing a building
  • Conditions
    • Unit TYpe (equal to Your Building)
  • Actions
    • Set Building = Random Thing you wont use later.
  • Edit the Unit type of (Building Variable or The Random Thing you choosed
 
You can make it with simple periodic trigger.

  • Gold
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Factory
            • Then - Actions
              • Player - Add 5 to (Owner of (Picked unit)) Current gold
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
 
  • Gold Income
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add (5 x (Count units of player Player 1 (Red) of type Farm and include incomplete units True and include currently upgrading buildings True)) to Player 1 (Red) Current gold


Note, You can't choose Custom Units in this trigger, so choose example farm and modify its stuff like your Factory has...
 
Status
Not open for further replies.
Back
Top