In this Snippet i will show you how to make the building generate a gold or lumber.
This snippet is simple and done using GUI.
The simplest building income trigger will be :
However, that's not all since we can have many income condition.
Thus, this thread consist of many snippet regarding income condition.
Most of the condition is supported in my map example and download it here.
View attachment BuildingIncome v1.w3x
Simplest and typical type income
Periodic income based on the building itself
Building "Gold mine" and "Gold Pot" from my demo map
Gold Mine
Every 20 seconds the owner of gold mine will receive 500 gold for each gold mine the player have. Using unit group.
Gold Pot
Count the total Gold Pot the player have (Using integer). And then evey 2 seconds it give the income.
For each Gold Pot its provide 1 gold every 2 seconds
Thus, Income = Total Gold Pot x 1
The income is summed up and then floating text display at the center of the current camera
_________________________________________________
A bit complex type of income
Periodic income based on ability level
Building "Farm" and "LumberMill" from my demo map
Farm
Just like the Gold mine, but this time the abilit level determine the income rate
Each ability level increment the income by 100
Income = Total Farm x (Ability Level x 100)
This ability level can me increase by upgrading the building (farm)
Lumber Mill
Just like the Farm but this time the ability level is determine by research.
You can incarese the level at the "Upgrade Center" building
_________________________________________________
Harvest type income
Building periodically generate an item so it can be sell
Building "Grain Farm" from my demo map
Grain Farm
Every 10 seconds, the grain farm will create an item nearby it
This item can be use by the player to sell it
But i this example, my item is a bundle of lumber that instantly give the player 10 lumber when the item is acquired
_________________________________________________
Animal farm type income
Train a unit and when the unit is kill it will give income
Building "Pig Farm" from my demo map
Pig Farm
The idea is when the player kill the Pig, they will get a gold.
Thus just make a Building that can train the Pig.
However, I made the gold get is depend on the current amount of the pig when it is killed and the Pig production is infinite
Key word :
building generate gold, building generate income, periodic income, building income
This snippet is simple and done using GUI.
The simplest building income trigger will be :
Trigger:
- Generate Gold
- Events
- Time - Every 10.00 seconds of game time
- Conditions
- Actions
- Set GoldMineIncome = (Units of type Gold Mine)
- Unit Group - Pick every unit in GoldMineIncome and do (Actions)
- Loop - Actions
- Player - Add 500 to (Owner of (Picked unit)) Current gold
- Loop - Actions
- Unit Group - Remove all units from GoldMineIncome
- Events
However, that's not all since we can have many income condition.
Thus, this thread consist of many snippet regarding income condition.
Most of the condition is supported in my map example and download it here.
View attachment BuildingIncome v1.w3x
Simplest and typical type income
Periodic income based on the building itself
Building "Gold mine" and "Gold Pot" from my demo map
Gold Mine
Every 20 seconds the owner of gold mine will receive 500 gold for each gold mine the player have. Using unit group.
Gold Pot
Count the total Gold Pot the player have (Using integer). And then evey 2 seconds it give the income.
For each Gold Pot its provide 1 gold every 2 seconds
Thus, Income = Total Gold Pot x 1
The income is summed up and then floating text display at the center of the current camera
_________________________________________________
A bit complex type of income
Periodic income based on ability level
Building "Farm" and "LumberMill" from my demo map
Farm
Just like the Gold mine, but this time the abilit level determine the income rate
Each ability level increment the income by 100
Income = Total Farm x (Ability Level x 100)
This ability level can me increase by upgrading the building (farm)
Lumber Mill
Just like the Farm but this time the ability level is determine by research.
You can incarese the level at the "Upgrade Center" building
_________________________________________________
Harvest type income
Building periodically generate an item so it can be sell
Building "Grain Farm" from my demo map
Grain Farm
Every 10 seconds, the grain farm will create an item nearby it
This item can be use by the player to sell it
But i this example, my item is a bundle of lumber that instantly give the player 10 lumber when the item is acquired
_________________________________________________
Animal farm type income
Train a unit and when the unit is kill it will give income
Building "Pig Farm" from my demo map
Pig Farm
The idea is when the player kill the Pig, they will get a gold.
Thus just make a Building that can train the Pig.
However, I made the gold get is depend on the current amount of the pig when it is killed and the Pig production is infinite
Key word :
building generate gold, building generate income, periodic income, building income