Needing some help in coding of articulated trains...
Moderator: Graphics Moderators
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Needing some help in coding of articulated trains...
@Regiovogel
Weight could be a problem, but capacity should come out right. Again: the key is to have CB 16 in the "purchase window chain" too, so all the constituent vehicles could be summed up properly.
@DaleStan
Thanks for the information.
regards
Michael
Weight could be a problem, but capacity should come out right. Again: the key is to have CB 16 in the "purchase window chain" too, so all the constituent vehicles could be summed up properly.
@DaleStan
Thanks for the information.
regards
Michael
- Regiovogel
- Engineer
- Posts: 48
- Joined: 03 Feb 2008 23:25
- Location: Nürnberg, Germany
Re: Needing some help in coding of articulated trains...
Hi there,
well, here I am again. I've had some things to do in my real life, i. e. finishing school, but now there will be a bit more time for important things like... TTD.
By now, I'm struggling with this vehicle once more. Nearly everything now works as intended, but the unpowered driving trailer keeps fuming around.
Setting property 22 has no effect on this which should be obvious, I think, because the second part is only an articulated part of the vehicle without power.
The powered wagons callback also does not work for that.
Every tested combination of this did not solve the problem.
Any help is appreciated
Greetz,
Regiovogel
well, here I am again. I've had some things to do in my real life, i. e. finishing school, but now there will be a bit more time for important things like... TTD.
By now, I'm struggling with this vehicle once more. Nearly everything now works as intended, but the unpowered driving trailer keeps fuming around.
Setting property 22 has no effect on this which should be obvious, I think, because the second part is only an articulated part of the vehicle without power.
The powered wagons callback also does not work for that.
Every tested combination of this did not solve the problem.
Any help is appreciated

Greetz,
Regiovogel
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Needing some help in coding of articulated trains...
Ah! I had nearly forgotten about this, hehe.
HTH
regards
Michael

Well, it should work. Just add something like this into the .nfo shown at the first page of this thread:Regiovogel wrote:[...] the unpowered driving trailer keeps fuming around.
Setting property 22 has no effect on this which should be obvious, I think,
because the second part is only an articulated part of the vehicle without
power.
The powered wagons callback also does not work for that.
Code: Select all
// callbacks power & fume
-1 * 16 02 00 05 81 40 80 FF 00 02 01 // MOD 2 wg. evtl Vielfachsteuerung (?)
40 FF 01 01 // coach: no fume
24 FF // engine: diesel fume
// callbacks Lok
-1 * 26 02 00 06 81 0C 00 FF 04
05 00 10 10 // power & fume
.... // more CBs go here
regards
Michael
- Regiovogel
- Engineer
- Posts: 48
- Joined: 03 Feb 2008 23:25
- Location: Nürnberg, Germany
Re: Needing some help in coding of articulated trains...
Hi Michael,
thank you for your answer. I'm afraid it still doesn't work as it should.
The flag for this callback is set, so it should be called. Somehow I got the impression that the driving trailer emits less fumes, but they are still present
It also doesn't matter whether I set the power for added wagons to 0 or any other value.
Well, thanks for your help!
Regiovogel
thank you for your answer. I'm afraid it still doesn't work as it should.
The flag for this callback is set, so it should be called. Somehow I got the impression that the driving trailer emits less fumes, but they are still present

It also doesn't matter whether I set the power for added wagons to 0 or any other value.
Well, thanks for your help!
Regiovogel
Re: Needing some help in coding of articulated trains...
If it's still not working, post the GRF, grfdebug.log (generated by Cht:Grfdebug), and grfdebug.txt (generated by the log parser in my signature), and identify the lines that are either incorrect or not present.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Needing some help in coding of articulated trains...
@Regiovogel
For a first attempt, the .nfo listing would be sufficient.
regards
Michael
For a first attempt, the .nfo listing would be sufficient.
regards
Michael
- Regiovogel
- Engineer
- Posts: 48
- Joined: 03 Feb 2008 23:25
- Location: Nürnberg, Germany
Re: Needing some help in coding of articulated trains...
Well, I attached the .grf and the .nfo.
As I'm working with OTTD, I'm not able to generate grfdebug.log (or at least, I don't know how). Enabling the debug level for newgrfs didn't do anything.
My installation of TTDPatch got somehow corrupted ("Registry-Fehler 4" when trying to start it), and I have no idea how to bring it back to life...
Hopefully this two files are sufficient.
Clueless
,
Regiovogel
p.s.: If you are missing some comments in the .nfo, this is because it's created with GRFMaker...
As I'm working with OTTD, I'm not able to generate grfdebug.log (or at least, I don't know how). Enabling the debug level for newgrfs didn't do anything.
My installation of TTDPatch got somehow corrupted ("Registry-Fehler 4" when trying to start it), and I have no idea how to bring it back to life...
Hopefully this two files are sufficient.
Clueless

Regiovogel
p.s.: If you are missing some comments in the .nfo, this is because it's created with GRFMaker...
- Attachments
-
- 627_628.nfo
- (4.11 KiB) Downloaded 106 times
-
- 627_628w.grf
- (8.71 KiB) Downloaded 126 times
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Needing some help in coding of articulated trains...
Don´t you have a commented and more structured .nfo?? This would make things much easier, well not for me, but for you.
regards
Michael
regards
Michael
- Regiovogel
- Engineer
- Posts: 48
- Joined: 03 Feb 2008 23:25
- Location: Nürnberg, Germany
Re: Needing some help in coding of articulated trains...
To be honestly - no. As I said, I'm working with GRFMaker. It's well structured and commented in there 

Re: Needing some help in coding of articulated trains...
You can mark all your GRFMaker comments to be retained in the .nfo - that makes it much more readable.Regiovogel wrote:I'm working with GRFMaker. It's well structured and commented in there
Re: Needing some help in coding of articulated trains...
Oh. GRFMaker. That, unfortunately, makes helping you much harder.
Remove the registry key "HKLM\Software\Fish Technology Group\Transport Tycoon Deluxe", or add "debugswitches n+" to ttdpatch.cfg.Regiovogel wrote:("Registry-Fehler 4" when trying to start it)
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Needing some help in coding of articulated trains...
As Dale said.Regiovogel wrote: [...] As I'm working with OTTD [...] My installation of TTDPatch got somehow corrupted ("Registry-Fehler 4" when trying to start it) [...]
BTW, your .grf seems to work OK in TTDPatch. Please be aware that OTTD still doesn´t comply to the full newgrf standard.
regards
Michael
- Regiovogel
- Engineer
- Posts: 48
- Joined: 03 Feb 2008 23:25
- Location: Nürnberg, Germany
Re: Needing some help in coding of articulated trains...
Ah, just tried it out. Thanks.AndersI wrote:You can mark all your GRFMaker comments to be retained in the .nfo - that makes it much more readable.
I'm sorry about that, but IMO it makes coding a lot easierDaleStan wrote:Oh. GRFMaker. That, unfortunately, makes helping you much harder.

TTDPatch is now working again.
Since I'm able to check it myself now, I also found it working correctly.michael blunck wrote:BTW, your .grf seems to work OK in TTDPatch.
Well, that's right. I created a bug report for that...michael blunck wrote:Please be aware that OTTD still doesn´t comply to the full newgrf standard.
BTW, is callback 36 (change vehicle properties) not thought to be called in the purchase list? In OTTD it works, in TTDPatch the value of action 0 is used instead. The specs don't tell anything about that...
Thank you all for your help!
Regiovogel
Re: Needing some help in coding of articulated trains...
Which property of callback 36 is malfunctioning?
Also if you use Cargo Type FF (Buy Menu) for sprites and such you'll need to give callback returns there for them to affect the buy menu values.
~ Lakie
Also if you use Cargo Type FF (Buy Menu) for sprites and such you'll need to give callback returns there for them to affect the buy menu values.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
- Regiovogel
- Engineer
- Posts: 48
- Joined: 03 Feb 2008 23:25
- Location: Nürnberg, Germany
Re: Needing some help in coding of articulated trains...
The used code for the purchase list (and only there) is the following:
It should set property 14, the displayed cargo capacity, to 146 (and in OTTD, it does). TTDPatch shows a capacity of 73 passengers which is only correct for one of the parts of the train. Since it keeps the code a bit easier to read, I'd like to use this callback instead of an articulated callback there.
Code: Select all
54 * 14 02 00 0F 81 10 00 FF 01 92 80 14 14 00 00
Re: Needing some help in coding of articulated trains...
Works fine here with my test grf and the latest nightly, so I assume you are using the wrong version of TTDpatch, or something isn't quite right with the grf?
~ Lakie
~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
- Regiovogel
- Engineer
- Posts: 48
- Joined: 03 Feb 2008 23:25
- Location: Nürnberg, Germany
Re: Needing some help in coding of articulated trains...
OK, with the latest nightly, it works. It only didn't work in 2.5 beta 9. I'll check the date of the version next time 
Sorry for the confusion then!

Sorry for the confusion then!
Re: Needing some help in coding of articulated trains...
As its a feature, it will not be in the 2.5 stable branch, it is however in the nightlies (2.6 branch).
~ Lakie
~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
-
- Tycoon
- Posts: 5954
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Needing some help in coding of articulated trains...
I don´t think so. For reasons of consistency, I´d prefer to achieve the same results using CB 16.Regiovogel wrote: [setting CB36 in the purchase window]
Since it keeps the code a bit easier to read, I'd like to use this callback instead of an articulated callback there.
@Lakie
How´s the current status with capacity and weight of articulated vehicles and CB16? Will we dependant on the above workaround forever?

regards
Michael
Re: Needing some help in coding of articulated trains...
[Edit] Of course it doesn't because I had to hook them and aRV's doesn't work like that either...
I can have a look at it although its likely to break people using callback 36 to trick it.
~ Lakie
I can have a look at it although its likely to break people using callback 36 to trick it.
~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
Who is online
Users browsing this forum: No registered users and 11 guests