Industry variable for accepted cargoes delivered?

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
User avatar
Erato
Chief Executive
Chief Executive
Posts: 740
Joined: 25 May 2015 09:09
Location: The Netherlands

Industry variable for accepted cargoes delivered?

Post by Erato »

Hey!

I'm working on an industry set, and I want to change the sprite of the industries based on how much cargo has been delivered to a certain industry. For the primary industries I use `transported_last_month_pct_1` to change the sprites based on how much of the cargo has been delivered, which works just fine. I could make this work in another way, but I might not have to, hence why I ask.

I was wondering if there is a variable like "produced_last_month_1" but for the input cargoes.

Thanks in advance
No pics no clicks. Seriously.
ImageImageImageImageImageImage
Eddi
Tycoon
Tycoon
Posts: 8271
Joined: 17 Jan 2007 00:14

Re: Industry variable for accepted cargoes delivered?

Post by Eddi »

you can probably use the stockpile for that

like, whenever you consume from the stockpile, you increase a counter in your industry's storage registers, and on some monthly callback, you reset that counter
User avatar
jfs
Tycoon
Tycoon
Posts: 1760
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Industry variable for accepted cargoes delivered?

Post by jfs »

Yes, implement the production-on-delivery callback and store the received amount somewhere you can get it again. Then have a monthly (or whatever) callback that resets this value.
User avatar
Erato
Chief Executive
Chief Executive
Posts: 740
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: Industry variable for accepted cargoes delivered?

Post by Erato »

I see. How does storing data work in NML?
No pics no clicks. Seriously.
ImageImageImageImageImageImage
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 9 guests