Page 19 of 22
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 16 Jan 2020 17:46
by TheNewTeddy
do you guys need help with any of it? I might not understand much (yet) but I have oodles and oodles of free time.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 17 Jan 2020 05:58
by Voyager One
Thank you for offering assistance but there's no need at this moment. Arnoud is recoding the whole set so he'll surely deal with this as well.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 19 Jan 2020 11:30
by Arnoud
First of all, sorry for the lack of recent updates, I have been busy with other RL stuff.
I havent spent much time on the passenger trams at all, because atm the still uncoded trams in the cargo set have priority for me.
The values that have been reported as indicating 0 are in fact set correctly in the source code, and the game is allso using these values, they are just not displayin g correctly in the purchase menu.
If I remember correctly this bug is only present in non articulated vehicles, the error message (undefined string) implies that a piece of coding is missing from these vehicles.
I havent actually tested wether this causes the bug, but this line of text appears to be missing from the graphics block of these vehicles:
purchase_cargo_capacity: return 45;
This sets the cargo capacity in the purchase menu to 45 (passengers).
If this is indeed what is causing the bug, it would not be that difficult to fix, just a lot of work because there are a lot of vehicles in the set.
I am currently not working on the passenger set, so if someone wants to have a go at trying to fix the issue be my guest.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 19 Jan 2020 13:08
by kamnet
Arnoud wrote: 19 Jan 2020 11:30
I am currently not working on the passenger set, so if someone wants to have a go at trying to fix the issue be my guest.
That should be an easy enough task for me to take on. Only took me a few minutes to fix.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 19 Jan 2020 14:27
by Arnoud
I made a little build of that, was getting curious wether it would work allso.
I got an error while compiling;
return ; 138 is incorrect, this needs to be
return 138 ;
After correcting this, this is the build, did not test it ingame:
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 19 Jan 2020 15:16
by kamnet
Arnoud wrote: 19 Jan 2020 14:27
I made a little build of that, was getting curious wether it would work allso.
After correcting this, this is the build, did not test it ingame:
This did not fix the issue of missing stats. Yes, it is only happening to the non-articulated vehicles.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 19 Jan 2020 16:15
by Arnoud
I tried a number of other fixes and in my last test the graphics block was basically the same as the cargotrams, in all but the reference to the coding for the side views, it didnt work.
The code related to the sideviews seems to be using nfo commands and that is something I dont understand.
The coding for the sideviews seems to be working like a master switch that allso effects other things and may very well be causing this.
I have noticed while coding the cargotrams that if you set certain switches belonging to articulated vehicles for non articulated vehicles this can cause bugs in the purchase menu, in those cases though I understood the code and could fix it.
In theory we could rewrite it to be completely nml like my cargotrams (who dont have this bug), but that would mean a loss of the sideviews for the affected trams, so that is not an ideal solution.
Edit: for those that didnt know, the passenger set has special side views that make them look extra good from a side angle.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 20 Jan 2020 09:39
by ajee
Hi 2cc developers,
I am using 2cc in my latest game, and I think this is a bug for the tram, as shown below:

- 2cc issue.JPG (35.09 KiB) Viewed 8542 times
As you can see, there is "undefined string" and the power is 0hp, tractive effort is 0kN, and running cost is $0/year.
Is this a bug or is there anything I miss to do before using the newGRF?
Regards,
AJ
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 20 Jan 2020 17:54
by kamnet
ajee wrote: 20 Jan 2020 09:39
Is this a bug or is there anything I miss to do before using the newGRF?
Kindly refer to the prior posts on the previous page.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 21 Jan 2020 13:22
by Arnoud
I think I may have found what is causing the bug, unfortunately that does not bring a proper fix any closer.
The script is making use of what looks like a trick in the position in consist variable to assign the normal sprites to position 0 (first part of the tram), leaving certain parts blank, which it then tells to fill in by using the sideview sprites 'for all undefined/blank positions'.
The problem here seems to be that in non articulated vehicles the number of positions (parts) that a tram has is not defined.
In articlulated vehicles you would add a piece of code that in plain english would look something like this:
Create positions 0 until 2 (this would create 3 parts; part 0, part 1 and part 2)
In non articulated vehicles this piece of code is missing because It is (normally) not needed and not possible to create 0 until 0 parts (=1 part).
if I recall correctly you get a compile error if you attempt it.
In other words the script doesnt understand what position 0 means because it hasnt been told that is has positions.
If this theory is correct it would imply that it is not possible to use multiple spritesets for a vehicle that has only 1 part, so I think this bug cannot be solved without removing the extra sideviews.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 22 Jan 2020 16:38
by Voyager One
Arnoud wrote: 21 Jan 2020 13:22
without removing the extra sideviews.
I think we could survive without these...

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 23 Jan 2020 04:15
by kamnet
Voyager One wrote: 22 Jan 2020 16:38
Arnoud wrote: 21 Jan 2020 13:22
without removing the extra sideviews.
I think we could survive without these...
I'll be honest, I don't even know what these are! LOL...

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 23 Jan 2020 16:33
by Voyager One
Neither do I, hahahahaha!!!
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 24 Jan 2020 11:29
by Arnoud
lol ok then.
This is a test file where I recoded the Melbourne class A, this seems to fix the bug.
In the source code the coding for this tram starts at line 5365.
What I did was remove everything above the item block, except the loading of the 2 needed spritesets (default and pre-purchase).
On the graphics block I allso removed the link to the master switch (because I removed that switch), which was at the bottom of the block.
And then the only thing needed was to add a link in the graphics block to the loading of the default graphics ( a link to the purchase sprites was allready present).
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 24 Jan 2020 14:00
by kamnet
Arnoud, if you can please look at the stats in 2CC Cargo for the Oradea Freight Service tram. It's a 4-car tram that says it can carry 400 mail bags.
But when you go to refit it says it can carry:
1600 mail
800 crates of goods
400t of bulk cargo
2132 heads of livestock
3200 bags of valuables
Way too much cargo for this one tram, and at a cost of $2800 no player will ever need to buy a train.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 24 Jan 2020 21:15
by LaChupacabra
The same problem with incorrect loading concerns four trams:
-Amsterdam...
-Dresden ...
-The Hague ...
-Oradea ...
Prices and costs are completely eyecandy in all cases.
And of course the sound - the same problem as in the case of regular 2cc trams: there is no sound / only splash. It sounds very poor.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 25 Jan 2020 05:27
by kamnet
The good news is that I got a server that's now running 2CC Trams under JGRPP, and they're loving it. They feel that the trams, while sometimes slower, are competitive with trains due to price and ability to get them into places where trains can't easily go. Which is exactly what I envisioned for 2CC Trams.

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 29 Jan 2020 11:59
by Arnoud
I have a fix for the Oradea tram that needs testing.
Changes are to the Oradea tram only, other trams will be fixed once we decide that this is a correct cargo capacity, particularly I want to know if the capacity is not too low now.
- capacity now calculated on unit weight.
- purchase and refit capacities now match eachother.
- capacity downscaled by factor of 10 (from 400t to 40t).
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 29 Jan 2020 13:55
by kamnet
Arnoud wrote: 29 Jan 2020 11:59
I have a fix for the Oradea tram that needs testing.
Changes are to the Oradea tram only, other trams will be fixed once we decide that this is a correct cargo capacity, particularly I want to know if the capacity is not too low now.
- capacity now calculated on unit weight.
- purchase and refit capacities now match eachother.
- capacity downscaled by factor of 10 (from 400t to 40t).
It's still slightly off. Info screen says:
Weight: 19t (27t)
Speed: 40 km/h
Power: 122 hp
T/E: 93 kN
Capacity: 175 bags of mail (refittable)
What refit menu says:
Mail: 160 bags
Goods: 80 crates
Valuables: 320 bags
Livestock: 212 head
Bulk cargo: 40 tons
As for performance, I think this feels about right. Running head-to-head with a Kirby (faster speed, higher TE, more power) pulling 30t coal, the train makes more money than the tram (nearly 2:1) but the trams make the company value go higher by nearly the same ratio.
The only thing I'd adjust is the livestock. Cattle runs around 1000 pounds (or 0.45 metric ton), 212 of them would be 96 metric tons. Adjusting it to 88 heads would put it right near 40 tons.
Re: [OTTD] 2CC|Trams - Nightly Betas Now Released
Posted: 29 Jan 2020 14:28
by Arnoud
hmm interesting, I tested it in Firs and in that set I had no difference between purchase and refit capacity.
I changed the default cargo from post to steel when playing with the default industries, this seems to fix the problem, I guess the default cargo needs to be in tons as unit weight.
The cargo capacities for different cargoes are all calculated centrally, I dont think it is possible to change the outcome of just 1 specific cargo (livestock).