Resource Depletion

Got an idea for a new feature in TTDPatch? Post it here.

Moderator: TTDPatch Moderators

User avatar
Dave
Moderator
Moderator
Posts: 17243
Joined: 26 Dec 2005 20:19
Location: North London

Re: Resource Depletion

Post by Dave »

Awesome stuff Pikka :D, Awesome stuff.
Official TT-Dave Fan Club

Dave's Screenshot Thread! - Albion: A fictional Britain
Flickr


Why be a song when you can be a symphony? r is a...
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Resource Depletion

Post by wallyweb »

Second round of testing results:
I like it! I like it! :D
I see what you mean about when the mine is off screen. I wonder if that happens with the original, un-grf'd, TTDX mines and other industries.
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Resource Depletion

Post by athanasios »

8o Pikka always surprises us!
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Re: Resource Depletion

Post by Csaboka »

I'm afraid the bug is in the GRF, not in TTDPatch.

(NFO technobabble follows, those who don't code GRFs can just skip the rest of this post.)

You manage your persistent variables in the beginning of the action2 chain, before reading variable 0C. This ensures that your variables get updated as soon as the chain is called, no matter what the reason is. The problem is, however, that the chain may not be called at all, for a long time. When you have the industry window open, callback 3A is called regularly, and keeps your scheme working. When you close the window, however, the only reason the chain may be called is callback 29, which happens at random intervals, so it's not suitable for your scheme.

I'd suggest enabling callback 35, and handling stockpile changes during it. You don't need to actually change the production with the callback, you can just use it to have something that's called every month. The added benefit would be that you could remove the logic that detects when a month change occurs - whenever callback 35 is called, you can be sure that exactly one month has passed since the last callback 35.

I'll wait for your feedback, and I'll close the bug in the tracker if my solution fixes your problem.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Resource Depletion

Post by PikkaBird »

I didn't need to change the action 2 chains at all; merely setting bit 5 in prop 21 seems to have fixed the bug. Thanks Csaba. :)
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Re: Resource Depletion

Post by Csaboka »

Well, yes, that is the quick and dirty way. :) You should probably do it the proper way for the official release, though, especially because it saves a persistent register and some logic for you.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Resource Depletion

Post by PikkaBird »

Okay, PBI and the brick chain have been updated with this feature. I'll go and bump that thread. :)
User avatar
George
Tycoon
Tycoon
Posts: 4362
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Re: Resource Depletion

Post by George »

With a delay of 4 months ECS beta 4 has this feature too.
Image Image Image Image
Post Reply

Return to “Suggestions”

Who is online

Users browsing this forum: No registered users and 20 guests