Fluffball
Well-Known Member
- Reaction score
- 35
This is a (hopefully) fairly simple GUI, MPI income system
Difficulty: [1.5 / 5] In my opinion, it should be pretty simple. Why did I do this? Because, I'm doing a Hero Line War/AOS map and I need an income system.
All it needs is 2 variables (If you don't want a gold stash [1 Lumber = 100000 gold], then you only need one variable. Both are Integer Arrays, with the size being the total amount of playing players.
After this, you just repeat the process, copy and pasting and changing the "+600" values to whatever you want. Be sure to delete any excess CnP's though, as they will multiply, giving you many times more than you wanted.
Here is the IncomeAdd trigger:
Again, no need for credit in your map, though comments, suggestions and +rep is greatly appreciated.
EDIT: Added income report in the spoiler (You have gained xx income.)
View attachment Fluffball's Income System.zip
Difficulty: [1.5 / 5] In my opinion, it should be pretty simple. Why did I do this? Because, I'm doing a Hero Line War/AOS map and I need an income system.
All it needs is 2 variables (If you don't want a gold stash [1 Lumber = 100000 gold], then you only need one variable. Both are Integer Arrays, with the size being the total amount of playing players.
Code:
Income
Events
Unit - A unit enters (Playable map area)
Conditions
((Triggering unit) is A structure) Equal to False
Actions
If ((Unit-type of (Entering unit)) Equal to Footman) then do (Set Income[(Player number of (Owner of (Entering unit)))] = (Income[(Player number of (Owner of (Entering unit)))] + 1)) else do (Do nothing)
If ((Unit-type of (Entering unit)) Equal to Rifleman) then do (Set Income[(Player number of (Owner of (Entering unit)))] = (Income[(Player number of (Owner of (Entering unit)))] + 2)) else do (Do nothing)
If ((Unit-type of (Entering unit)) Equal to Sorceress) then do (Set Income[(Player number of (Owner of (Entering unit)))] = (Income[(Player number of (Owner of (Entering unit)))] + 3)) else do (Do nothing)
Skip remaining actions
Set Income[(Player number of (Owner of (Entering unit)))] = (Income[(Player number of (Owner of (Entering unit)))] + (Point-value of (Entering unit)))
After this, you just repeat the process, copy and pasting and changing the "+600" values to whatever you want. Be sure to delete any excess CnP's though, as they will multiply, giving you many times more than you wanted.
Here is the IncomeAdd trigger:
Code:
Incomeadd
Events
Time - Every 20.00 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
Player - Add Income[(Integer A)] to (Player((Integer A))) Current gold
Player - Add IncomeLumber[(Integer A)] to (Player((Integer A))) Current lumber
Code:
IncomeReport
Events
Time - Every 20.00 seconds of game time
Player - Player 1 (Red) types a chat message containing -income as An exact match
Player - Player 2 (Blue) types a chat message containing -income as An exact match
Player - Player 3 (Teal) types a chat message containing -income as An exact match
Player - Player 4 (Purple) types a chat message containing -income as An exact match
Player - Player 5 (Yellow) types a chat message containing -income as An exact match
Player - Player 6 (Orange) types a chat message containing -income as An exact match
Player - Player 7 (Green) types a chat message containing -income as An exact match
Player - Player 8 (Pink) types a chat message containing -income as An exact match
Player - Player 9 (Gray) types a chat message containing -income as An exact match
Player - Player 10 (Light Blue) types a chat message containing -income as An exact match
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering player) Equal to (Triggering player)
Then - Actions
Game - Display to (Player group((Triggering player))) the text: (Income: + (String(Income[(Player number of (Triggering player))])))
Game - Display to (Player group((Triggering player))) the text: (Lumber Income: + (String(IncomeLumber[(Player number of (Triggering player))])))
Else - Actions
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
Game - Display to (Player group((Player((Integer A))))) the text: (Income: + (String(Income[(Integer A)])))
Game - Display to (Player group((Player((Integer A))))) the text: (Lumber Income: + (String(IncomeLumber[(Integer A)])))
Again, no need for credit in your map, though comments, suggestions and +rep is greatly appreciated.
EDIT: Added income report in the spoiler (You have gained xx income.)
View attachment Fluffball's Income System.zip