• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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:
 
Level 5
Joined
Sep 13, 2008
Messages
165
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:
Level 3
Joined
Feb 20, 2009
Messages
28
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))
 
Level 8
Joined
Mar 12, 2008
Messages
437
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.
 
Level 10
Joined
Mar 16, 2009
Messages
354
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.
Top