GetHarvestDifficulty

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
Yukiko
Distro Developer
Posts: 2728
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

GetHarvestDifficulty

Post by Yukiko » Sun Aug 30, 2009 12:09 am

I have never gotten a good answer to this one. How exactly is the harvest difficulty determined when the GetHarvestDifficulty function is called? There appears to be no explanation in the documentation.
Explanation
Determines the difficulty of harvesting a resource from location (x,y).
Notes: tiletype will typically be .objtype from TargetCoordinates() Checks the location for an object of type 'tiletype'. This tiletype may be a landtile or an object tile.
"resource" is something like "ore" "wood" "fish", etc. see regions/resource.cfg, regions/ore.cfg, etc.
I cannot find anyplace to enter a difficulty value for a particular resource.

I need a bit of help here.

Thanks.

Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: GetHarvestDifficulty

Post by Pierce » Sun Aug 30, 2009 4:39 am

I tested that a long time ago and if i remember it right, the
difficulty is simply calculated from the currently existing amount
of the ressource against the initial amount of the ressource.
So the difficulty increases when the amount of the ressource
decreases.

E.g. there is an initial 10 iron ore on a landtile (ore.cfg UnitsPerArea)
and noone has mined there yet. The difficulty will raise with each
ore you get on this spot (9/10, 8/10 ....).
I surely don't know the exact formula. Did you mean that?

Yukiko
Distro Developer
Posts: 2728
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: GetHarvestDifficulty

Post by Yukiko » Sun Aug 30, 2009 3:41 pm

It would be nice to know the formula but I wasn't specifically asking for that. I was working on the fishing skill and was getting some strange, or what I thought were strange, harvest difficulty results. I just wondered where the function eas getting those results. It's curious that there isn't any documentation explaining this.

Anyway, thanks Pierce for the info. Maybe Austin or one of the developers can offer some clarification on how it's calculated.

MuadDib
Former Developer
Posts: 1090
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Re: GetHarvestDifficulty

Post by MuadDib » Sun Aug 30, 2009 5:43 pm

Code: Select all

	unsigned long base_difficulty = 90 - (units * 80 / units_per_area_);
	unsigned long this_difficulty = random_int( base_difficulty * 2 );
	return new BLong( this_difficulty );
Now bug turley to update the docs for that, lol

Yukiko
Distro Developer
Posts: 2728
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: GetHarvestDifficulty

Post by Yukiko » Sun Aug 30, 2009 6:08 pm

Thanks MaudDib.

*shouts*
HEY TURLEY!

Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: GetHarvestDifficulty

Post by Turley » Mon Aug 31, 2009 4:39 am

pol98 & 99 updated

Yukiko
Distro Developer
Posts: 2728
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: GetHarvestDifficulty

Post by Yukiko » Mon Aug 31, 2009 5:07 am

Thanks again Turley!

Post Reply