Resource Depletion
Moderator: TTDPatch Moderators
Re: Resource Depletion
Awesome stuff Pikka , 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...
Dave's Screenshot Thread! - Albion: A fictional Britain
Flickr
Why be a song when you can be a symphony? r is a...
Re: Resource Depletion
Second round of testing results:
I like it! I like it!
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.
I like it! I like it!
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.
wallyweb on tt-forums: Screenshots - Wallyweb World - Projects & Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
Re: Resource Depletion
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.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Re: Resource Depletion
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.
(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
Re: Resource Depletion
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.
Re: Resource Depletion
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
Re: Resource Depletion
Okay, PBI and the brick chain have been updated with this feature. I'll go and bump that thread.
Who is online
Users browsing this forum: No registered users and 20 guests