Coding Problem

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

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

Post by DaleStan »

Code: Select all

70 * 14	 02 01 10 81 10 00 FF 01 50 80 01 02 FF 80
                                   ^^
I may be way off base here , but have you tried using a number in the 74..CB range? (RV IDs, not train IDs)
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
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

AFAIA, the callback uses the NFO ids, not the global vehicle IDs. At least, that's the way stevenh had me code the hiroshima trams test grf (which is where Sir Bob has copied the code from).
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

PikkaBird wrote:(although you are calling a sound effect which doesn't exist in your grf, which will crash TTDP).
No, it won't. Specifying a sound effect that doesn't exist causes no sound to be played.
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
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

DaleStan wrote:
PikkaBird wrote:(although you are calling a sound effect which doesn't exist in your grf, which will crash TTDP).
No, it won't. Specifying a sound effect that doesn't exist causes no sound to be played.
Ok. I'm sure I've managed to code sound effect callbacks that crash TTDP before, although that may have been with an earlier build.
User avatar
Sir Bob
Traffic Manager
Traffic Manager
Posts: 214
Joined: 07 Oct 2006 09:08
Location: Melbourne, Australia

Post by Sir Bob »

Okay, I've got rid of the sound effect callback but it hasn't helped at all.
My articulated trams still don't show up but non-articulated trams do.

If anyone can find something else wrong with the code please say so.

Thanks again,
Sir Bob

EDIT: Do I need to change anything to do with what DaleStan said before?
Witty Signature!
Image
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Hmm. Not showing at all?

... your action 3 is for a different ID from your action 0.

You probably also want to change the callback return from 50 to this vehicle's ID.
Last edited by PikkaBird on 25 Dec 2006 15:16, edited 1 time in total.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7425
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Post by Redirect Left »

PikkaBird wrote: You might want to check with stevenh just where articulated RVs are at in the current build.
I checked with him a few week ago. Apparantly they do just about work, but are very buggy.
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
User avatar
Sir Bob
Traffic Manager
Traffic Manager
Posts: 214
Joined: 07 Oct 2006 09:08
Location: Melbourne, Australia

Post by Sir Bob »

I've changed everything you said (I think) but it is still causing problems. I've uploaded my latest .NFO file (The problem is with the last tram)
Another weird thing was found as well, if you have the German Tram Set activated you get the tram, but only the first vehicle.
On another note my Action 4's don't work.

Once again, any help is apprecciated

Sir Bob
Attachments
brittram.txt
(3.98 KiB) Downloaded 66 times
Witty Signature!
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Sir Bob wrote:On another note my Action 4's don't work.
the wiki wrote:language-id
The meaning of this byte depends on the GRF version of the .grf file as set in action 8.
I advise you re-read this section a couple times; you obviously missed something important in there.

And you're setting the wrong bit in prop 17.
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
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

DaleStan wrote:And you're setting the wrong bit in prop 17.
And the last action 0 is still setting properties for a different ID than the action 3 that precedes it...
(I think I said action 2 before, I meant action 0.)
User avatar
Sir Bob
Traffic Manager
Traffic Manager
Posts: 214
Joined: 07 Oct 2006 09:08
Location: Melbourne, Australia

Post by Sir Bob »

What line is the property 17 on?
Witty Signature!
Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

The line (or lines) that contain the only action that can set properties.

This should be obvious, and there shouldn't be more than a few such lines.
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 “Graphics Development”

Who is online

Users browsing this forum: Bing [Bot] and 8 guests