Tiny bit more help

Got a problem with TTDPatch? Get help here.

Moderator: TTDPatch Moderators

Post Reply
cpt_jack
Engineer
Engineer
Posts: 22
Joined: 24 Feb 2006 09:08

Tiny bit more help

Post by cpt_jack »

Hi again

Got another problem with some code, i'm trying to change the name of the piggy bank house in toyland, iv'e changed the graphic and the population, and that is working fine

below are some examples of what iv'e been doing, could someone please tell me what im doing wrong.

Code: Select all

0 * 4	 04 00 00 00
    1 * 19	 08 02 "IE" 00 02 "building" 00
    2 * 5	 0A 01 01 5A 12
    3 c:\transport_tycoon_deluxe\sprites/brp.pcx 66 120 09 98 64 -31 -67
    4 * 28 00 07 03 01 6D 08 6D 15 6D 0B 64 6D 12 "new building" 00
I didn't think this one would work but i gave it a try anyway

Code: Select all

0 * 4	 04 00 00 00
    1 * 19	 08 02 "IE" 00 02 "building" 00
    2 * 5	 0A 01 01 5A 12
    3 c:\transport_tycoon_deluxe\sprites/brp.pcx 66 120 09 98 64 -31 -67
    4 * 14 00 07 03 01 6D 08 6D 15 6D 0B 64 6D 12 6C
This one i was trying to change the ID of the building to a different building

Code: Select all

0 * 4	 05 00 00 00
    1 * 19	 08 02 "IE" 00 02 "building" 00
    2 * 5	 0A 01 01 5A 12
    3 c:\transport_tycoon_deluxe\sprites/brp.pcx 66 120 09 98 64 -31 -67
    4 * 13 00 07 03 01 6D 08 6D 15 6D 0B 64
    5 * 19 04 07 03 01 6D "New building" 00
this was my attempt using action 4, i would put extra languages in later.

help me please! it's driving me mad :twisted:

thanks
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Tiny bit more help

Post by PikkaBird »

Okay, I think you're failing to understand exactly how action 0s work. There seems to be an extraneous "6D" in your second version.

Here is the original sprite,

Code: Select all

4 * 11     00 07 03 01 6D 08 6D 15 6D 0B 64
And here's the breakdown.

4 * 11 - the sprite number and number of bytes in the line.

00 07 - action 0, feature 07 (houses)

03 01 - setting three properties for one ID

6D - the ID this action sets properties for - note that this could have been anything, I just reused 6D because when I modify the inbuilt houses I usually keep the same ID.

08 6D
15 6D
0B 64 - three properties.

Now, if you want to add another property (property 12) to the action 0, you need to first increase the property count from 03 to 04, then add the property at the end of the line. Property 12 is a WORD value (two bytes), so it will look something like this:

12 xx xx

where "xx xx" is the text ID that you want to use, in little-endian order (eg, text ID 201B, "Modern office building", would be 1B 20). Finally, you need to adjust the byte count number at the start of the sprite, although hopefully you're using NFOrenum to do that for you (and to check for errors).

If you can't find an appropriate text ID and want to use an action 4, the text ID you will need to set is C96D (6D C9 in little endian). It really does pay to read the wiki carefully, and know what every byte in your pseudosprites does. And use NFOrenum to check for errors.

I expect someone will come along shortly and tell you you could have posted this in your existing thread, too. ;)
cpt_jack
Engineer
Engineer
Posts: 22
Joined: 24 Feb 2006 09:08

Thanks again

Post by cpt_jack »

It all makes sense now :!: you will pleased to know, i have now renamed my building and also my new industry, so i think i'm getting the hang of it (untill the next problem anyway)

If you ever need any help PikkaBird just let me know, i probably won't be much use, but it's the thought that counts :D

Thanks
Post Reply

Return to “Problems with TTDPatch”

Who is online

Users browsing this forum: No registered users and 15 guests