Idea was to have first part of consist with capacity 0, and second with capacity 20 passengers (I set capacity of 20 passengers in Action0 prop. 0F). But vehicle shows capacity of 20 passengers only in purchase list, but in game has capacity 40 passengers. (With OTTD all works correct.) I even made other Callback 36, which sets capacity to 20 passengers, and applied it to second part before consist forming, but still same error appears. What I am doing wrong?
It's showing the wrong capacity in the buy menu because you're not building the articulated vehicle there. With trains, you can use callback 15 to show the correct capacity for artics in the buy menu, I don't know if that works for RVs.
Callback 36 for capacity is not supported in TTDP yet, so that's why it won't work there.
Yes, I haven't noticed that CB 36 is supported for OTTD only. So that's another thing (other is CB 1D) that I am waiting for. (Suggestion for DaleStan: NFO Renum haven't said that CB 36 isn't supported, but for CB 1D it says.)
And actually it's showed wrong capacity in game, I intended to be 0+20, but in game shows 40 passengers.
Wile E. Coyote wrote:Yes, I haven't noticed that CB 36 is supported for OTTD only. So that's another thing (other is CB 1D) that I am waiting for. (Suggestion for DaleStan: NFO Renum haven't said that CB 36 isn't supported, but for CB 1D it says.)
And actually it's showed wrong capacity in game, I intended to be 0+20, but in game shows 40 passengers.
Callback 36 is supported, though... just not setting that particular property.
In the buy menu it appears that articulated road vehicles do not show the correct capacity, this is something I've also noticed.
They tend to show the capacity of the first unit of the articulated road vehicle's type capacity.
In that case I have very strange behaviour with my code: first unit has capacity 0, second has 20, in buy menu it's shown 20, but in game capacity is 40 (Action 0 prop. 0F is set to 20).
But I suppose it's consequence of using non-available callback.
Unless I'm missing something, callback 15 is used for refitting, and the buy menu uses the action0 property value, hence 20 would be the expected result...
Lakie wrote:Unless I'm missing something, callback 15 is used for refitting, and the buy menu uses the action0 property value, hence 20 would be the expected result...
That confused me too.
PikkaBird wrote:
Wile E. Coyote wrote:In that case I have very strange behaviour with my code: first unit has capacity 0
Only after it's run the callback, which it hasn't.
Hm... I missed something... isn't callback ran in sprites 78 and 79?
BTW, in OTTD in buy list there is showed capacity 20, and in vehicle info window first unit has capacity 0, and second 20 (that is just what I intended).
I wondered because I haven't knew that callback isn't supported (my mistake ). Now all is clear, I couldn't do this in Patch, only in OTTD. But now I wonder why it shows doubled capacity, due to thing Lakie said that because there is no callback support it should be used property from Action 0. Nevertheless, with OTTD which supports this callback all is working in way I wanted.
Just one question for OTTD: is it possible to make unit which has no capacity not to show "Empty" in vehicle info window, but to show nothing (like locomotive in train consist)?
Because in TTDpatch it goes through the consist and adds all the cargo capacities together and shows the total cargo and capacity of the articulated road vehicle.
Not sure how OpenTTD shows this information though.
(Also remember an articulated road vehicle is not a train and making it look like one would be confusing to users as you cannot do the same things to them)...
Lakie wrote:Because in TTDpatch it goes through the consist and adds all the cargo capacities together and shows the total cargo and capacity of the articulated road vehicle.
Is there any way to avoid that adding?
PikkaBird wrote:No callback there...
Whoops, you're right... My mistake.
EDIT: I did that, but capacity in buy menu is still not equal as capacity in game:
Not currently, and because its the way train articulated units work I am very reluctant to remove it.
As I've said they are not trains and they work quite differently from trains in both OpenTTD and TTDpatch.
Currently neither show articulated road vehicles like trains thus not having the totals would just be confusing (You must remember that the total can include up to 2/3 different cargo types).
[Edit] I don't think using a variable 41 in the buy menu would work as there is no consist at that point in time...
You should just return the final total capacity of the articulated road vehicle instead for the buy menu?
And as previously said for TTDpatch it requires a fix minor alterations to work better, such as trying to loop the consist in a theoretical sense.
Lakie wrote:Not currently, and because its the way train articulated units work I am very reluctant to remove it.
As I've said they are not trains and they work quite differently from trains in both OpenTTD and TTDpatch.
Of course, you're absolutely right about that, I'm also against that removing (and probably others too).
Lakie wrote:I don't think using a variable 41 in the buy menu would work as there is no consist at that point in time...
It worked for articulated train wagons so I supposed it should work here too.
Lakie wrote:You should just return the final total capacity of the articulated road vehicle instead for the buy menu?
As previously said, I recognise its a bug in TTDpatch, however I will not be adding cargo support through callback 36, I will merely fix TTDpatch's cargo consist calculations for the buy menu when I feel like doing any TTDpatch developing.