• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Gold

Status
Not open for further replies.
Level 11
Joined
Mar 30, 2008
Messages
666
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.
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
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
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
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)
 
Level 10
Joined
Aug 15, 2008
Messages
720
  • 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.
Top