Gold income for building?

YezItsMe

New Member
Reaction score
0
It would be so much simpler to just do this:
Trigger:
  • Add Gold
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set TempUnitGroup = (Units owned by (Picked player) of type Tent)
          • For each (Integer A) from 1 to (Number of units in TempUnitGroup), do (Actions)
            • Loop - Actions
              • Player - Add 1 to (Picked player) Current gold
          • Custom script: call DestroyGroup(udg_TempUnitGroup)

Triggerr.png
Why doesn't this work for me?
This generates 10 gold per second (Because I put Integer A from 1 to 10, I'll fix this to1)
BUT it adds 10 gold even though the player doesn't have a tent.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Wow, you really didn't understand my reply. Oh well.

Basically, what my trigger does is add 1 gold for every tent the player has. Yours, on the other hand, just picks every player and adds 10 gold.

Now I understand your problem, use this instead.

Trigger:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Set TempUnitGroup = (Units owned by (Picked player) of type Tent)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempUnitGroup) Greater than 0
        • Then - Actions
          • Player - Add 1 to (Picked player) Current gold
        • Else - Actions
      • Custom script: call DestroyGroup(udg_TempUnitGroup)


Basically it checks whether the player has at least 1 tent, and if so adds 1 gold to that player.
 

NeuroToxin

New Member
Reaction score
46
Kaerf, why not just use the trick - bj_wantDestroyGroup = true?
Trigger:
  • Custom Script: set bj_wantDestroyGroup = true
    • Unit Group - Pick all units matching Unit Type of (Matching unit) equal to Tent and Matching Unit is dead equal to false
    • Loop - Actions
    • Player - Add 1 gold to (Owner of(Picked Unit))
 
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