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
Route Supervisor
Route Supervisor
Posts: 419
Joined: 25 May 2015 09:09
Location: The Netherlands

Industry variable for accepted cargoes delivered?

Post by Erato » 20 Aug 2019 16:28

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. Also stop using Modern Maglev Trains. Use RIMS instead.
ImageImageImageImageImageImage

Eddi
Tycoon
Tycoon
Posts: 7414
Joined: 17 Jan 2007 00:14

Re: Industry variable for accepted cargoes delivered?

Post by Eddi » 20 Aug 2019 21:35

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
You might not exactly be interested in Ferion, but if you are, have fun :)

User avatar
jfs
Director
Director
Posts: 562
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Industry variable for accepted cargoes delivered?

Post by jfs » 21 Aug 2019 15:08

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
Route Supervisor
Route Supervisor
Posts: 419
Joined: 25 May 2015 09:09
Location: The Netherlands

Re: Industry variable for accepted cargoes delivered?

Post by Erato » 23 Aug 2019 01:21

I see. How does storing data work in NML?
No pics no clicks. Seriously. Also stop using Modern Maglev Trains. Use RIMS instead.
ImageImageImageImageImageImage

Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 6 guests