Income + spiliting between allies

set

New Member
Reaction score
2
Ok here it is , i got problem . i need help , so i have variable Income witch is Integer array 6[players]
And now , only 2 player can send units [ like in tower wars]
So for exemple yellow send units in his team there are 2 other players...
The income should go 100% to yellow and now other 50% to one player , 50% to other player is this posible and how can i menage that?
 

Sim

Forum Administrator
Staff member
Reaction score
534
I guess point-values of units are their income worth...?

Code:
Income
    Events
        Unit - A unit Sells a unit
    Conditions
        whatever
    Actions
        Set Income_Addition = (Point-value of (Sold unit))
        Set Numb = (Player number of (Owner of (Selling unit)))
        Set Player_Income[Numb] = (Player_Income[Numb] + Income_Addition)
        Player - Add Income_Addition to (Player(Numb)) Current Gold
        Set Allies = (All allies of (Player(Numb)))
        Player Group - Remove (Player(Numb)) from Allies
        Player Group - Pick every players in Allies and do (Actions)
            Loop - Actions
                Player - Add (Income_Addition / 2.00) to (Picked player) Current gold
        Custom script:    call DestroyForce(udg_Allies)

Should look like this.

Player_Income is each player's total income.
Other variables are temporary variables which have no impact on the rest of the map.
 

set

New Member
Reaction score
2
Yeah but how to base tham?
I mean like what should thay be [integer] can you tell me for each what should it be and what array to have?
 

Sim

Forum Administrator
Staff member
Reaction score
534
They're all integers. I'll edit the trigger because I thought Point-values were reals.

Only Player_Income is an array variable, of size 12.
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
12 because that's the number of players available. Just set it to 6 if you're using 6 players. Just make sure the 6 players you're using equal to Player 1, 2, 3, 4, 5 and 6, otherwise you'll need additional arrays.
 

set

New Member
Reaction score
2
Yep thay are . red\blue\teal /purple/yellow/orange..
i will try this later gtg now
and thx :p
 

Sim

Forum Administrator
Staff member
Reaction score
534
Actually, the array size doesn't matter. It's only important if you set a default value.
 

set

New Member
Reaction score
2
Sorry , for bumping again but can u just tell me all names what variable should i make?
I know i should put tham to be integer but how many and what names!!!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top