Gold Income!

cheeto515

New Member
Reaction score
1
Okay.. I'm trying to make it so that when you build a certain building, (House), you recieve 45 gold every 45 seconds.
I get that done, but I don't know how to make it stack, for example, if I make two, it still only makes 45 gold, not 90, if you can help with this PLEASE do!
 
Z

Zell

Guest
Um... *surpresses first reaction*

Okay, so you need a trigger whose event is the completion of your house. Then set an integer array to itself plus 45. The index of the array is (Owner of (Constructed Unit)). Then in a peridoic trigger just add the integer variable to the corresponding players' gold.
 

cheeto515

New Member
Reaction score
1
I'm sort of stupid if you haven't noticed : /. Could anyone make this more "Retarded-Person" Friendly please??? I sort of understand it.. but...
 

Mr Zero

Junior Regular (Got the T-shirt)
Reaction score
64
A few things you could do:

1.
Code:
Player - Limit training of <Your Unit> to 1 for <Your Player>

2.
Code:
Add Gold
    Events
        Time - Every 45.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in (Units owned by <Your Player> of type <Your Unit>)) Greater than or equal to 1
            Then - Actions
                Player - Add 45 to <Your Player> Current gold
            Else - Actions
 

ianu74

New Member
Reaction score
8
Why don't you use variables?
Create a Variable Named Gold, integer
Code:
s
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) 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 Footman
                    Then - Actions
                        Set Gold = (45 x (Number of units in (Units in (Playable map area) matching (((Unit-type of (Triggering unit)) Equal to Footman) and ((Owner of (Triggering unit)) Equal to Player 1 (Red))))))
                        Player - Add Gold to Player 1 (Red) Current gold
                    Else - Actions
 

Mr Zero

Junior Regular (Got the T-shirt)
Reaction score
64
@ianu74
Okay.. I'm trying to make it so that when you build a certain building, (House), you recieve 45 gold every 45 seconds.
I get that done, but I don't know how to make it stack, for example, if I make two, it still only makes 45 gold, not 90, if you can help with this PLEASE do!

:rolleyes:
 
Z

Zell

Guest
Make a 12 slot array called Income (or whatever, it doesn't matter), of type integer. Have a trigger with event "A unit finishes construction", condition of (Unit-type of (Constructed Unit)) is equal to House, and action "Set Income[(Owner of (Constructed Unit))] to Income[(Owner of (Constructed Unit))] + 45". Then have another trigger with "Every 45 seconds of game time" and loop from 1 to 12 "Player - Set Player[(Integer A)] gold to Player[(Integer A)] gold + Income[(Integer A)]". This is a free hand, so it isn't exact wording. And I use 12 as the max number of players. If you have only 8, use that, etc.

And Mr. Zero... read the line right before the bold...
I get that done, but I don't know how to make it stack, for example, if I make two, it still only makes 45 gold, not 90
 
Z

Zell

Guest
That didn't make sense, Zero... but you're answering his question as if he didn't want it to stack. But I'm pretty sure he does.
 

Lanboy

TH.net Regular
Reaction score
22
Events
- Every 45 game-time seconds
Conditions
Actions (you can fix leaks)
- Unit Group - Pick every unit of type House and do actions
- Loop
- Add 45 gold to (owner of picked unit)'s current gold
 
M

MIKE690

Guest
How do u do that!?

I have a question Zell you said "Set Player[(Integer A)] gold to Player[(Integer A)] gold + Income[(Integer A)]", How do you get this string??? (i need a simular trigger) :banghead: :nuts:
 

Korolen

New User (Why do I keep getting those red bars?)
Reaction score
69
I have a question Zell you said "Set Player[(Integer A)] gold to Player[(Integer A)] gold + Income[(Integer A)]", How do you get this string??? (i need a simular trigger) :banghead: :nuts:
Player - Add Property
 
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