2CC Trams 0.9c & 2CC Cargo Trams v0.8r

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

TheNewTeddy
Engineer
Engineer
Posts: 10
Joined: 07 Aug 2011 11:58

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
User avatar
Voyager One
Tycoon
Tycoon
Posts: 11204
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield
Arnoud
Engineer
Engineer
Posts: 78
Joined: 29 Sep 2008 05:02
Location: Amsterdam

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
Coder for the 2cc trams (passenger) and the 2cc cargo trams
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
Attachments
trams-2cc.nml
(489.65 KiB) Downloaded 115 times
Arnoud
Engineer
Engineer
Posts: 78
Joined: 29 Sep 2008 05:02
Location: Amsterdam

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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:
Attachments
2cctramstest.grf
test file
(455.7 KiB) Downloaded 117 times
Coder for the 2cc trams (passenger) and the 2cc cargo trams
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
Arnoud
Engineer
Engineer
Posts: 78
Joined: 29 Sep 2008 05:02
Location: Amsterdam

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
Coder for the 2cc trams (passenger) and the 2cc cargo trams
ajee
Engineer
Engineer
Posts: 8
Joined: 09 Dec 2019 11:55

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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
2cc issue.JPG (35.09 KiB) Viewed 7072 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
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
Arnoud
Engineer
Engineer
Posts: 78
Joined: 29 Sep 2008 05:02
Location: Amsterdam

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
Coder for the 2cc trams (passenger) and the 2cc cargo trams
User avatar
Voyager One
Tycoon
Tycoon
Posts: 11204
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post by Voyager One »

Arnoud wrote: 21 Jan 2020 13:22 without removing the extra sideviews.
I think we could survive without these... :D
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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... :D
I'll be honest, I don't even know what these are! LOL... :P
User avatar
Voyager One
Tycoon
Tycoon
Posts: 11204
Joined: 28 Dec 2009 09:47
Location: Rijeka, Croatia

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post by Voyager One »

Neither do I, hahahahaha!!!
Leon

Image Image Image Image
"... all I ask is a tall ship and a star to steer her by..." - John Masefield
Arnoud
Engineer
Engineer
Posts: 78
Joined: 29 Sep 2008 05:02
Location: Amsterdam

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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).
Attachments
2ccpassengertest1.grf
test file
(455.09 KiB) Downloaded 155 times
trams-2cc.nml
source code
(488.23 KiB) Downloaded 136 times
Coder for the 2cc trams (passenger) and the 2cc cargo trams
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
LaChupacabra
Transport Coordinator
Transport Coordinator
Posts: 379
Joined: 08 Nov 2019 23:54

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
I am sorry for may English. I know is bed.
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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. :)
Arnoud
Engineer
Engineer
Posts: 78
Joined: 29 Sep 2008 05:02
Location: Amsterdam

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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).
Attachments
cargotramstest2.grf
cargotrams test file
(85.76 KiB) Downloaded 131 times
cargotrams.nml
source code
(73.7 KiB) Downloaded 115 times
Coder for the 2cc trams (passenger) and the 2cc cargo trams
User avatar
kamnet
Moderator
Moderator
Posts: 8532
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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.
Arnoud
Engineer
Engineer
Posts: 78
Joined: 29 Sep 2008 05:02
Location: Amsterdam

Re: [OTTD] 2CC|Trams - Nightly Betas Now Released

Post 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).
Attachments
cargotramstest4.grf
cargotrams test file 2nd version
(85.76 KiB) Downloaded 113 times
cargotrams.nml
source code
(73.7 KiB) Downloaded 117 times
Coder for the 2cc trams (passenger) and the 2cc cargo trams
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Google [Bot] and 5 guests