Income when building completed

zedak

New Member
Reaction score
0
I need help with some income stuff.

I've made the lumber to income, every 10 seconds all players gets as much gold as the lumber you got.

I want this: If a player builds the building -Factory-, his lumber(income) will increase by 5.

I want the players to be able to use more than 1 factory too, anyone knows how I should do this? =)
 

Exide

I am amazingly focused right now!
Reaction score
448
You could either use an Integer variable to remember the amount of gold each player should get, and increase it. (Simple.)
Or simply add more lumber to the player that completes the building.
 

zedak

New Member
Reaction score
0
hehe

I've tried to make an intreger for my income, but I failed hard.

And is there an event that is "player completes a building"?
 

Admit

New Member
Reaction score
25
(Interger Income)

More income. (You could also pick every living unit of the type "Factory" and give 5 for every one alive)
Trigger:
  • Events
    • Unit - A unit Finished construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Factory
    • Actions
      • Set Income[(Player number of (Owner of (Triggering unit)))] = (Income[(Player number of (Owner of (Triggering unit)))] + 5)


Adding the Income:
Trigger:
  • Events
    • Time - Every X seconds of game time
    • Conditions
    • Actions
      • For each (Interger A) from 1 to Y, do (Actions)
        • loop - Actions
          • Player - Add Income[(Interger A)] Current gold

Where Y is the number of players
 

Komaqtion

You can change this now in User CP.
Reaction score
469
These two triggers should work ;)
Trigger:
  • Another Income
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_PGroup = (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing)))
      • Player Group - Pick every player in Temp_PGroup and do (Actions)
        • Loop - Actions
          • Player - Add ((Picked player) Current lumber) to (Picked player) Current gold
      • Custom script: call DestroyForce(udg_Temp_PGroup)


Trigger:
  • Update Income
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Factory
    • Actions
      • Player - Add 5 to (Owner of (Constructed structure)) Current lumber


@Admit: He wanted to use lumber as the source of the income, so changed that ;)
 
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