System Income System

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.

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
 

dannyboydude

Ultra Cool Member
Reaction score
33
hey i sorted your report problem here ...

Code:
IncomeReport
    Events
        Time - Every 20.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                Game - Display to (Player group((Player((Integer A))))) the text: (You have just recieved  + ((String(Income_Gold[(Integer A)])) +  gold from your income.))
 

Fluffball

Well-Known Member
Reaction score
35
Ahh ok thank you very much, but I don't think that will work... because the Player Number of Player 1 isnt 1 i think... Because last time i added income to Player 1 Red with the number 1, it didn't work
 

Don

Rise with the Fallens!
Reaction score
52
Pretty good tutorial overall but there is a GIGANTIC waste of time here!

You only need 1 trigger for every units:

Code:
E:
- A unit enter region:
C:
- Entering nit not equal to peasant
A:
- Add (point value of triggering unit) to owner of triggering unit current gold.
- Display to owner of entering unit the text for X seconds: U recieved + point value of triggering unit + income.
- change value in leaderbaord..
- ++

If you do that, it saves atleast an half of an hour of coding fopr the same result!

that mean, point value of creeps must be the income they give, simple isnt it?
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Ok here is a real simple income trigger and a short one to.

Code:
Untitled Trigger 002
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Triggering unit) is An Ancient) Equal to True
    Actions
        Set Count[(Player number of (Owner of (Triggering unit)))] = (Count[(Player number of (Owner of (Triggering unit)))] + (Point-value of (Triggering unit)))

Code:
Untitled Trigger 002
    Events
        Time - Every 30.00 seconds of game time
    Conditions
    Actions
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Player - Add Count[(Player number of (Picked player))] to (Picked player) Current gold

You just make the creeps into anchents (which helps out with some other things to) and set it's point value when you make it in the object editor.
 

Fluffball

Well-Known Member
Reaction score
35
Ahh ok, but I hate object editor... so i'll just stick with my own method. Thanks.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Ahh ok, but I hate object editor... so i'll just stick with my own method. Thanks.

no problim, yours is almost like the very first one I made, but then I had over 100 creeps and atleast 25 of them earned income in both gold and lumber, it became a pain so I made the first version of the one I posted before onlu useing the unit's max mana instead of the point value, it wasn't till after i posted it here that i learned about the point value lol.

Ps. I wanted to give you +rep for this to but I can't add to you again today. lol
 

Fluffball

Well-Known Member
Reaction score
35
Wow, thanks, I'll have a look at some other things I have, that could be of use to some people.

By the way... would anyone want me to post a Unit Commander System? It's basically a Unit spell, which targets everyone in a 500 + Level of Upgrade x100 radius and sends them to the target point.
 

dannyboydude

Ultra Cool Member
Reaction score
33
sure create a new thread though dont Kill this thread

that would be nice that unit command

EDIT : Even though no help to my map :(

My map is UNO lol my friend gave me the idea its coming along good

but a unit command system wouldnt make it easier lol
 

Don

Rise with the Fallens!
Reaction score
52
I think DG meant to post a map with the system at the end of the posty so we see what ir really does!
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
a map with the system in it would be nice

I think DG meant to post a map with the system at the end of the posty so we see what ir really does!

People normaly prefer Demo Maps with the systems they check out, that way they can see exacly how they work and if they like them just copy and paste.
 

Don

Rise with the Fallens!
Reaction score
52
err... yes!

(sorry i can't really say something else and i'm making this to have a ''more then 2 words post'')
 

WolSHaman

knowledgeably ignorant
Reaction score
51
Seems interesting, but just as a challenge, would you want to make a house system to, where houses gain population and then add money based on the population? I could help you make it if you wanted.
 
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