Is AICargo.GetCargoIncome() per unit of cargo?

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Is AICargo.GetCargoIncome() per unit of cargo?

Post by Zutty »

Hi all,

Quick question. Is the result of AICargo.GetCargoIncome() calulated per unit of cargo? So to estimate the amount of income from a single trip of one bus can I do AICargo.GetCargoIncome() * AIEngine.GetCapacity()?

I'm doing this anyway, but I want to check that its valid.

Thanks very much. :)
PathZilla - A networking AI - Now with tram support.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Is AICargo.GetCargoIncome() per unit of cargo?

Post by Yexo »

Yes, it is. The documentation is correct (a piece) but not clear enough I guess.
Mchl
Director
Director
Posts: 611
Joined: 05 Jan 2007 15:50
Location: Poland
Contact:

Re: Is AICargo.GetCargoIncome() per unit of cargo?

Post by Mchl »

Given that 'a piece' might be 'a ton', 'a passenger', 'a bag' or '10000 litres' I guess that 'a unit' would be better.
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Is AICargo.GetCargoIncome() per unit of cargo?

Post by Zutty »

Thanks guys. It was just a tad unclear to me.
PathZilla - A networking AI - Now with tram support.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 20 guests