Does NML have callbacks to Cargodist?

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

Moderator: Graphics Moderators

Post Reply
User avatar
BermudaTri
Engineer
Engineer
Posts: 12
Joined: 14 Sep 2015 04:50

Does NML have callbacks to Cargodist?

Post by BermudaTri »

I'm fiddling around with the cargo station_rating callback, and I thought it might be a good mechanic to have station rating dependent on the number of networked accepting stations. For example: a coal mine is happier and more trusting of your company if they can choose from multiple steel mills/power plants to sell coal to.
I can see the stations getting this information from Cargodist somehow, because cargo is generated in the station with destinations in mind. So shouldn't there be some way in NML to get the total number of possible destinations and feed that back into the station_rating callback?
Eddi
Tycoon
Tycoon
Posts: 7718
Joined: 17 Jan 2007 00:14

Re: Does NML have callbacks to Cargodist?

Post by Eddi »

no. because that is an incredibly hard number to calculate.
You might not exactly be interested in Ferion, but if you are, have fun :)
User avatar
BermudaTri
Engineer
Engineer
Posts: 12
Joined: 14 Sep 2015 04:50

Re: Does NML have callbacks to Cargodist?

Post by BermudaTri »

Eddi wrote: 17 Jun 2021 21:42 no. because that is an incredibly hard number to calculate.
That's...interesting.
So if I connect grain & beef farm "A" to mills "B" and "C" and meat packer "D", cargodist will split grain into "B" and "C" destinations, but I can't get the number "2" out of it? And I can't get the number "1" from beef being only distributed to "1" location?

I'm not trying to find "Total possible destinations across the entire map", I'm trying to find "How many destinations does cargodist pick from when assigning destinations?"
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9426
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Does NML have callbacks to Cargodist?

Post by planetmaker »

BermudaTri wrote: 18 Jun 2021 01:57
Eddi wrote: 17 Jun 2021 21:42 no. because that is an incredibly hard number to calculate.
That's...interesting.
So if I connect grain & beef farm "A" to mills "B" and "C" and meat packer "D", cargodist will split grain into "B" and "C" destinations, but I can't get the number "2" out of it? And I can't get the number "1" from beef being only distributed to "1" location?

I'm not trying to find "Total possible destinations across the entire map", I'm trying to find "How many destinations does cargodist pick from when assigning destinations?"
All serviced ones (including those which have been serviced until reasonably recent, iirc 2 years).
Eddi
Tycoon
Tycoon
Posts: 7718
Joined: 17 Jan 2007 00:14

Re: Does NML have callbacks to Cargodist?

Post by Eddi »

BermudaTri wrote: 18 Jun 2021 01:57 I'm not trying to find "Total possible destinations across the entire map", I'm trying to find "How many destinations does cargodist pick from when assigning destinations?"
that's the thing. cargodist does not assign destinations. each cargo package only knows its "next hop", and the station itself doesn't care. and whatever the station window displays is just statistical mumbojumbo.
You might not exactly be interested in Ferion, but if you are, have fun :)
McZapkie
Tycoon
Tycoon
Posts: 1352
Joined: 18 Jan 2014 18:10

Re: Does NML have callbacks to Cargodist?

Post by McZapkie »

Eddi wrote: 18 Jun 2021 16:43 cargodist does not assign destinations. each cargo package only knows its "next hop", and the station itself doesn't care. and whatever the station window displays is just statistical mumbojumbo.
Interesting, I was pretty sure that each existing packet has its final destination assigned...
User avatar
Gwyd
Chief Executive
Chief Executive
Posts: 718
Joined: 17 Apr 2017 16:52
Location: Western Ile-de-France Region

Re: Does NML have callbacks to Cargodist?

Post by Gwyd »

What about the cargo linkgraph? I can see how passengers going to x via y would be statistical magic, but for industries it's often direct links, so could it be possible to use the number of direct links from a station for a given cargo?
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 1 guest