• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Income {making an income system (with bought creeps)}

Status
Not open for further replies.
Level 18
Joined
Mar 7, 2005
Messages
824
make a variable "x" for example and store values in it..
for example if you sent creeps, then trigger it, if someone buys a creep you detect it and add +2 to the variable (add an array if you use it for more than 1 player -> x[1], x[2], and so on)

after that, just add property to players
Add x[1] to player 1 current gold

something like that, it's pretty simple
 
Level 2
Joined
Apr 29, 2009
Messages
11
Thanks for that.

{EDIT}
Now have I try but I don't know where I shall do that you had say. Can you tell me that more detailed?
 
Last edited by a moderator:
Level 11
Joined
Feb 14, 2009
Messages
884
  • Events
    • Time - Every x seconds of game time
  • Conditions
  • Actions
    • Player - Add y to <Player> Current gold
This trigger is a generic income system. To do what Tr!KzZ suggested, you can do something like this:

  • Events
    • Time - Every x seconds of game time
  • Conditions
  • Actions
    • Set IncomeGroup = Pick every player in (All allies of (Player One))
    • Player - Add y to IncomeGroup Current gold
    • Custom script: call DestroyForcep(udg_IncomeGroup)

This trigger works only if all human players are allies. If you have two different teams, add these lines:

  • Actions
    • Set IncomeGroupTwo = Pick every player in (All enemies of (Player One))
    • Player - Add z to IncomeGroupTwo Current gold
    • Custom script: call DestroyForce(udg_IncomeGroupTwo)
If you want to add gold to every player, replace the above actions with this one:

  • Actions
    • Player Group - Pick every player in (All players) and do (Player - Add x to (Picked player) Current gold)

If you want a player-specific amount of gold, this trigger is what you need:

Create an integer variable (I will name it "Gold" in my example) and check the "Array" checkbox.
  • Actions
    • For each (Integer A) from 1 to (Number of players in (All players)), do (Player - Add Gold[(Integer A)] to (Picked player) Current gold)
Of course, you can edit the triggers to fit your needs. Cheers!
 
Last edited:
Status
Not open for further replies.
Top