• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Leaderboard Income

Status
Not open for further replies.
Level 2
Joined
Mar 28, 2009
Messages
18
I alrdy have a leaderboard set up. Now i want points to increase on the board as gold increases.

Also, lets say I have 2 values of gold coming in.

One value being 100, the other value being 1. Is there a way that every time value 1 gold is collected, I get 100 points on the leaderboard. And when value 100 gold comes in, nothing happens.

Here's what I have:

Events
Player - Player 1 (Red)'s Current gold becomes Equal to 1.00
Conditions
Actions
Leaderboard - Change the value for (Matching player) in (Last created leaderboard) to 100
Leaderboard - Sort (Last created leaderboard) by Value in Descending order


however, points aren't added to the board when 1 gold. So I figure the event has got to be diff right? What should it be?
 
Level 2
Joined
Mar 28, 2009
Messages
18
well I did change to triggering player and it still doesn't work. I just want to make it so that when i receive 1 gold I get X amount of point, and when I get 100 gold I get no points.
 
Level 4
Joined
Dec 9, 2008
Messages
52
  • Player - Player 1 (Red)'s Current gold becomes Equal to 1.00
is different from
  • Player - Player 1 (Red)'s Current gold increases by 1.00
My suggestion is to use a global variable, not gold, to keep track of a player's score. Whenever you want to increase a player's score you just increase his global variable. You can also use the global variable when updating the leaderboard.
 
Level 4
Joined
Dec 9, 2008
Messages
52
No I it's not a real event, I was just showing the difference between the two ideas.

In order to help you out more, I think I need to know more generally what you're trying to do. Why are you using gold to keep track of a player's score?
 
Level 2
Joined
Mar 28, 2009
Messages
18
I want to make an oil resource for my game. Since there is no oil resource in the game, I'm trying new ways to make one.

One way I have my mind set is making a custom gold mine with the name oil patch. A boat/worker will go to the "oil patch" and bring back 1 gold to wherever it needs to return it to.

What I want to do is that every time I receive one 1 gold, I gain 100 points (oil resource). Also once I earn that 1 gold, the 1 gold will be reduced from my total gold to make it seem like I didn't really receive any gold.
 
Level 4
Joined
Dec 9, 2008
Messages
52
So you have 3 resources: gold, lumber, and oil. Units can mine both oil and gold from "gold mines" so you use the amount returned to determine which resource they've mined?

If you just have two resources, oil and lumber, then you can just replace the icon of "gold" and the name "gold" with oil and you don't have to worry about any of this.

How, by the way, are you going to make buildings and units require three types of resources?
 
Level 2
Joined
Mar 28, 2009
Messages
18
So you have 3 resources: gold, lumber, and oil. Units can mine both oil and gold from "gold mines" so you use the amount returned to determine which resource they've mined?

If you just have two resources, oil and lumber, then you can just replace the icon of "gold" and the name "gold" with oil and you don't have to worry about any of this.

How, by the way, are you going to make buildings and units require three types of resources?

I figured I'd just make it so once a unit is created, X amount of oil is subtracted from the score board.

But is there any other way to make a 3rd resource?
 
Last edited:
Level 4
Joined
Dec 9, 2008
Messages
52
No easy way to make a 3rd resource that I know of.

I have two suggestions:

1) Replace gold completely with oil. This way you can keep the boat-harvesting-oil mechanic and the resource system will stay simple for you and the players.


2) Make an oil rig building. And then every 1 second, for each oil rig, you add 1 oil to the player who owns it.

The detailed way to do this would be everytime a building is created, if it's an oil rig, add it to a global unit group. Then have a repeating timer that picks every unit in the global unit group and gives +1 oil to the owning player. If a unit dies and it's an oil rig, remove it from the unit group. Using a leaderboard to keep track of this is still a good idea and your method for spending oil is as good as any.
 
Level 3
Joined
Aug 6, 2009
Messages
45
Leaderboard - Change the value for (Matching player) in (Last created leaderboard) to 100

i haven't read through the other posts but i think this is the problem you aren't getting points, you need to set it to arithmetic, so it's + 100 not just, set it to 100
 
Level 9
Joined
Jul 20, 2009
Messages
427
I have tried making a 3rd resource for my own map using triggers involving custom items and item charges, but for sure it has leaks though. Idea was, in my map whenever a grain warehouse was built it would have a custom item grain set to 0 charges initially, then you have to build farms around it(the farms, when created would have the custom item grain set to 100 charges) then I used timers(thanks to krigekongen for this idea), whenever it expires the grain warehouse would pick 1 farm around it,reducing the item charge grain it has by 1 while adding 1 charge to the grainwarehouse. Well that's what I thought of..
 
Status
Not open for further replies.
Top