Further defining types of ore when gathering?Solved
Good afternoon. 

I was wondering if anyone knew if there is a more defined solution instead of "ResourceDispenser.GatherType.Ore" to be called when a user collects stone, metal or sulfur for example?
Clarify what exactly you want to achieve and when, in what hook, and what do you have.
As player challenges are not being updated in a while, I wanted to add some ranks that players could go hunt for. As I have never coded game plugins before, I still managed to get the most hacked crates as well for most items repaired. 

So, as its still a challenge for me, coding itself doenst work for me. I, however, see more of patterns on how it goes ( just like old games with Pacman its pathing ) 

I know, coding on other people their plugins are not allowed. Therefore I would only use it as an "as is" plugin on the server and not spreading it. 

As this is the following code ( 1 ), I changed it towards this ( 2 ) 

(1)
if (dispenser.gatherType == ResourceDispenser.GatherType.Ore && configData.ChallengeSettings[Challenges.RocksGathered].Enabled)
                AddPoints(player, Challenges.RocksGathered, item.amount);​
(2)
if (dispenser.gatherType == "metal.ore" && configData.ChallengeSettings[Challenges.RocksGathered1].Enabled)
                AddPoints(player, Challenges.RocksGathered1, item.amount); ​

i'm not sure if this would be the correct way to do so, but if it does would work like this, then the rest would speak of itself. There is still a lot to be learned.

Merged post

nothing? @misticos

Merged post

Does anyone else know what i could do best? Or is it everyone for themselves? 
You could check the prefab of the dispenser to determine what kind of rock it is, or look at what items it is dispensing.
I'm trying to find a way, but the Wikia depending on hooks here is rubbish and lacks loads and loads of decent proper information. most tryouts i do coming from youtube, even tho... it's rubbish but at least better than Umod's Wikia. 
i could do it the same way as its listed in a list when it comes to "most plants gathered", it's quite simple as long you know what you're doing. It made me possible to have people go for the rank for hackable crates or most items crafted. 
Do you have any suggestions? a website I could check out or someone you know that would probably know the answer? 

Cheers, thanks in advance! 

Merged post

I have found it out, I made it possible to work. Thank you for the tip, it helped out a lot. As because of this thing is solved, I'm even able to add more ranks because of this. I never coded before and I'm willing to learn to contribute. Sadly some people doenst see the positive side on it.

Thanks in advance again zug!
It can be difficult at first, but once you get up and running, things will be easier.  Luckily a lot of great code is shared in the free plugins, and you can also learn a lot from pointing a decompiler at the game.
Locked automatically