• 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!

Building income

Status
Not open for further replies.
Level 6
Joined
Jan 13, 2009
Messages
73
I'm making a map which with each main building you own your income increases, but i cant find the right set of triggers to get it going. I want it to be like the function in risk where with each area your income increases. Please help... its driving me INSANE :ugly:
 
Ok, if you have your income based on a time period it would look like this

Event
-Every [x] seconds
Condition
-
Actions
-For each integer [1] to [Amount of Players]
--For each [unit of type] owned by [Player [Integer A]]
---Add [x] gold to [Player Integer A]]
 
Last edited:
I Wont Say Something Different but Here goes a Trigger i Made.
  • Gold for Every Building
  • Events
    • Time - Every (Seconds) of Game-Time
  • Conditions
  • Actions
  • For Each Integer (1) to (Number of Players)
    • For Each (Building Type) owned by (Player (Number of Integer A))
      • Property - Add 30 to Current Gold of (Player (Integer A))
 
The above triggers give a proportinal income. If you'd like an improportional income (eg. 1 = 20, 2 = 30, 3 = 40, etc, you can use these actions instead:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Player - Add ((10 x (Number of units in (Units in (Playable map area) owned by (Picked player)))) + 10) to Picked player Current gold
Use this if you want an improportional income. If this trigger is applied, then having one of the buildings gives 20 income, and it increases by 10 each level. Thus, you'll get income even if you don't have any (unit-type)s.
 
ok
1.) create a timer variable label it IncomeTimer
2.) Create the timer initialization trigger
Event
- Time - Elapsed time is = to .10 seconds
Conditions
- none
Action
- Countdown Timer - Start IncomeTimer as a repeating timer that will expire in 40 seconds
- Countdown Timer - Create a timer window for last created timer labeled Income in . . .
3.)Create the income trigger
Event
- Countdown Timer - Countdown timer IncomeTimer has expired
Condition
- none
Action
- Player - add (integer variable entitled red) to player 1's current gold

Okay now the trigger to make the variable work
Event
- unit - unit enters region playable map area
Condition
- Unit Type comparision - Triggering unit is equal to the building that provides the income boost
- Player comparision - Owner of triggering unit is = to player 1 red
Action
- Variable - Set variable (integer variable entitled red) = to (integer variable entitled red) plus (amount of income gained from that building)

now when 40 seconds expires player 1 red will recive (amount of income gained from that building) multiplied by how many of those building he has.

To create this for all other players simply copy the triggers excluding the 1 for the timer and change all the player 1 to the next player and all the (integer variable entitled red) to (integer variable entitled blues) then teals then purp and so on.

Hope this helped :)
 
Status
Not open for further replies.
Back
Top