Articulated Road Vehicles

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Articulated Road Vehicles

Post by DaleStan »

If you don't get the correct capacity, try adding a CB 15 check in the depot-sprite chain; something like

Code: Select all

*0 02 01 7F 81 0C 00 FF 01 <cbresult> 15 15 <gfxID>
*0 03 01 01 <ID> 01 FF 7F 00 <gfxID>
I don't know if that will work, but it seems like 15 must be called in the purchase window too.

And which sprite is not supported? Cargo type FF has been supported for all vehicles for as long as I've been coding.
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
Uwe
Transport Coordinator
Transport Coordinator
Posts: 353
Joined: 09 Jul 2004 14:05
Location: Germany

Re: Articulated Road Vehicles

Post by Uwe »

Thank you both for the information, I'll try CB 15. I use cargo type FF and that works, I get a special sprite in the purchase window, I just do not get the correct capacity shown for my aRV. Sorry for the confusion.
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Articulated Road Vehicles

Post by Lakie »

DaleStan wrote:And which sprite is not supported? Cargo type FF has been supported for all vehicles for as long as I've been coding.
I know the special cargo FF sprite has been around for a long time, I was referring to the fact it is possible to use a callback to expand the area for it, as MB showed with some of his development work, basically the text was 'offset' from where it would normally be, but I could be wrong...

~ 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."
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Articulated Road Vehicles

Post by DaleStan »

That's a simple case of using string codes \20 and\or \01 appropriately. Possibly \1F too, but that's less likely.
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
Uwe
Transport Coordinator
Transport Coordinator
Posts: 353
Joined: 09 Jul 2004 14:05
Location: Germany

Re: Articulated Road Vehicles

Post by Uwe »

OK, I tried CB 15, but it did not work. I only get the cargo capacity for the first vehicle part shown in the purchase window. Thanks for the help anyway, it was worth a try.

Concerning the crash I get whenever selling an articulated vehicle, I made a ollydbg screenshot of the crash, hopefully some patch dev can use the information. The crash happens directly when I move the vehicle onto the trash bin in the depot. I currently use nightly r1793.
Attachments
crash.zip
Ollydbg-screenshot, ttdpatch.cfg, newgrf.cfg
(95.07 KiB) Downloaded 132 times
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Articulated Road Vehicles

Post by JGR »

I'm going to assume that you meant r1693 and not a revision from the future...

I will have a look at the crash info.

JGR
Ex TTDPatch Coder
Patch Pack, Github
Uwe
Transport Coordinator
Transport Coordinator
Posts: 353
Joined: 09 Jul 2004 14:05
Location: Germany

Re: Articulated Road Vehicles

Post by Uwe »

Err, yes, typo, it should have been 1719, but the crash also occured in earlier versions.
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Articulated Road Vehicles

Post by JGR »

Are you using the German version of TTD?
If so you could try again with the American version, and if it still crashes repost the same info as before.

(This also makes it much easier to find the code from the IDA listings).

Thanks

JGR
Ex TTDPatch Coder
Patch Pack, Github
Uwe
Transport Coordinator
Transport Coordinator
Posts: 353
Joined: 09 Jul 2004 14:05
Location: Germany

Re: Articulated Road Vehicles

Post by Uwe »

I use the German version, yes. Just tried the American one and it crashes as well, ollydbg screenshot is attached.
Attachments
ollydbg.zip
(86.1 KiB) Downloaded 140 times
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: Articulated Road Vehicles

Post by JGR »

The function in which the code dies is DeleteVehicleSchedule (_CS:00138460,5614A7).
The schedule pointer field of the vehicle in question is obviously invalid/undefined at -1.

I would imagine that the trailer vehicles would not have a schedule pointer...
Hence the delete vehicle schedule pointer function should not be called for those...

As more info arises I will edit this post...

JGR
Ex TTDPatch Coder
Patch Pack, Github
User avatar
Carlo Ghega
Engineer
Engineer
Posts: 92
Joined: 07 Jan 2007 19:37
Location: Vienna

Re: Articulated Road Vehicles

Post by Carlo Ghega »

Hello!

Still got the same problem as Uwe, dare to ask if you think that there might be a chance to get this fixed some day soon?

No offence meant,
best regards,

Carlo
E pur si muove!
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

This question has popped up elsewhere without a response that I could find with the forum search function, so I thought as this seems to be the general articulated RV thread, I'd repeat the question here on behalf of myself and the others who have asked it. Perhaps this way it will be addressed.

The issue is with refitting articulated RV's ... the trailer does not get the refit.
For buses and trams where the refit would be merely passenger/tourist this is probably not so critical as two sets of IDs could be used ... one for passengers and one for tourists ... and the whole refit issue bypassed.
Where this becomes a real issue is with articulated trucks. To begin, there are several configurations for trucks: box, hopper, flatbed, etc. .Next, each configuration can have several cargoes available as refits. This makes multiple ID's highly impractical. A refit function would seem to be the only practical approach.

This all begs several questions:

How important is it to players to have refitable articulated RVs?
Is anybody aware that refitting the trailers of articulated RVs is an issue?
If yes, is anybody addressing this issue?

Articulated RVs work. Articulated trucks work. It would be a shame to have to pass on using them because they don't support trailer refits. :(
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: Articulated Road Vehicles

Post by athanasios »

And I am dreaming of the day George's LVs get articulated. Hope it will not remain a dream. :(
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7249
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: Articulated Road Vehicles

Post by Redirect Left »

athanasios wrote:And I am dreaming of the day George's LVs get articulated. Hope it will not remain a dream. :(
Same here :mrgreen:
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

With reference to a discussion in the Generic Road Vehicle Set thread, the trailer refit problem also existed in OTTD and apparently was resolved. Perhaps their solution could work in the patch too. Is this possible?
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Articulated Road Vehicles

Post by Lakie »

Quite possibly, however upon asking the devs responsible for that patch for 'guidance' on implement it, I got no reply as of yet.
Also my understanding of C / C++ is very limited, so I won't be able to look at the code and follow the method...

~ 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."
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

Thanks Lakie.
Perhaps a Patch dev who is familiar with C/C++ could lend you a hand. Unfortunately the last time I did any work with C, C++ hadn't been developed yet. :(
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Articulated Road Vehicles

Post by DaleStan »

I think most of Open is still C compiled with a C++ compiler. I know there's some C++ (YAPF in particular), but I suspect the majority is still C. BICBW.

That aside, it seems like, once you find the hooks to patch the refit button, it should be a relatively simple matter to just cycle through the entire consist, possibly simply calling [esp] for each vehicle.
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
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Articulated Road Vehicles

Post by wallyweb »

I thought I'd post a png to better describe the issue. (see below)
Then I saw DaleStan's comment mentioning cycling.
Then I had an inspiration ... Maybe this could be developed into a feature. If there was someway to optionally* cycle through the consist, refitting each part independently so as to achieve a mixed consist.

optionally* - For the quick and dirty crowd, the "refit all at once" method should be retained as default.
Attachments
Sequence of events
Sequence of events
SCR9.png (52.37 KiB) Viewed 3974 times
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Articulated Road Vehicles

Post by DaleStan »

DaleStan wrote:That aside, it seems like, once you find the hooks to patch the refit button, it should be a relatively simple matter to just cycle through the entire consist, possibly simply calling [esp] for each vehicle.
Looking at the diff, that's almost exactly what Open does, except for the call [esp] part. Starting with the engine, it tests:
Can the vehicle be refitted to this cargo?
Does the vehicle have capacity?
If yes twice, determine the capacity, from the callback if available or from the old capacity.
If yes twice, and DC_EXEC [ebx bit 0 set, IIRC.] change the vehicle slot appropriately.
Proceed to the next vehicle. (cvivpjv esi, [esi+veh.nextunitid], <Can the vehicle be refitted to this cargo?>)
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
Post Reply

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 8 guests