Help with coding which sprite to 'take over'

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

Post Reply
Birdey
Engineer
Engineer
Posts: 90
Joined: 12 Oct 2004 04:59
Location: Sydney, Australia
Contact:

Help with coding which sprite to 'take over'

Post by Birdey »

To MOD's can you please change the name of this topic to "Gray Stone (GStone) Railways, thanks

I have recoloured the normal brown coloured railways with gray looking railwas, therefore creating the look of concrete sleepers, if anyone would like an update or anything else, like different bridges, roads, etc. please post something here, thanks

Birdey

[Original Post]

I am editing some unfinished graphic and i need to know how the setup the .nfo file... i need to figure out how to

make it take over sperfic sprites that aren't bear each other

eg. from sprites 1011 - 1036 with my new graphics then from sprites 1263 - 1266 with other new graphics...

i cant really explain....

ill put my graphics and .nfo files so u can see what i am doing...hopefully

thanks in advanced

Birdey

ps i tried to look at other grf files but they confussed me more :( i also look through the wiki... but i couldn't really understand it
Attachments
Gstone_w.rar
Gstone, WIN
(37.03 KiB) Downloaded 214 times
Gstone_D.rar
Gstone, DOS
(37.03 KiB) Downloaded 131 times
Bridges, and Some different combinations, using the gstone graphics
Bridges, and Some different combinations, using the gstone graphics
SCR1.jpg (104.57 KiB) Viewed 3979 times
Last edited by Birdey on 09 May 2005 13:20, edited 1 time in total.
For every addition of knowledge u aquire, you forget something that you knew before
MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

What's so special in these graphics? I see just original rail, low detailed original road, bridges, tunnels, crossings and something navy-grey

Is it something with vehicle takeovering?
Birdey
Engineer
Engineer
Posts: 90
Joined: 12 Oct 2004 04:59
Location: Sydney, Australia
Contact:

Post by Birdey »

it is for my use... i didn't like the old brown rails so i coloured them with todays conreate coulours... i just need some one help to get them working thats all... it has nothing to do with anything regurading gameplay. also it is my first graphic 'thing and i didn't what to have this big project that i would never do... if you have any REAL help i would be grateful
For every addition of knowledge u aquire, you forget something that you knew before
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

The word you need is "replace".

Try just editing trg1[r].pcx, re-encoding, then use GRFDIFF and GRD2GRF. Then decode the GRF file and see what should be done.
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
Peter1x9
Engineer
Engineer
Posts: 58
Joined: 04 Feb 2004 22:11
Location: Chicago suburbs

Post by Peter1x9 »

Ahhh...I see. You either need to make an action A for each set of contiguous sprites that you are replacing or put multiple sets on one line. I prefer the former since I'm also coding newbie and it is easier to understand.

Also, I like this gravel color better, it matches what the railroads use around here. :)

On going through your .NFO, I've found some errors that i'll fix.

Errors so far:
1. Your first line is incorrect. The first byte(s) should be the number in front of the last line in your file. (in hex of course)

2. The suspension bridge alignments and concrete bridge alignments were slightly off. (the bridge heads are ok though)

3. Your .pcx is missing one of the railroad crossings (would replace sprite# 1337 in trgr1.grf). I've completely left that section out of the .NFO i'm working on.

4. The last sprite in your .NFO was severely misaligned. Instead of -4 in the yrel, you had a value of -44.

Not necessarily an error, but more of a convention:

In your pcx, each pseudo sprite should have a number with no image under it, so that each image matches the line number in the .NFO. For example, your first sprite should be under #3 instead of #0.



I'll post an updated .NFO and the .GRF that I created from it. The new .NFO will still work with your current .PCX file. If you need me to, i'll fix your .PCX by adding the missing crossing and making the numbers correspond with the images properly.


Edit: file removed, see below for the new version.
Last edited by Peter1x9 on 03 May 2005 04:57, edited 1 time in total.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Post by PikkaBird »

Peter1x9 wrote:In your pcx, each pseudo sprite should have a number with no image under it, so that each image matches the line number in the .NFO. For example, your first sprite should be under #3 instead of #0.
That's not a "convention" at all. The .pcx file you get when you decompile a .grf file is not the same pcx file that was used to create it (and neither is the .nfo the same .nfo file that was written).
Peter1x9
Engineer
Engineer
Posts: 58
Joined: 04 Feb 2004 22:11
Location: Chicago suburbs

Post by Peter1x9 »

Wow, thanks for the info. That will save me a few steps on some other things i'm working on.

:o
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

The first pseudosprite doesn't need to be exactly the same as the number of sprites in the file, either - it should be the same, but as long as it's greater than the number of sprites, it doesn't matter too much. I only ever change mine if it's too small or before public releases.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

If it's too large by "n" you waste "4*n" bytes of memory, that's all :P
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
Peter1x9
Engineer
Engineer
Posts: 58
Joined: 04 Feb 2004 22:11
Location: Chicago suburbs

Post by Peter1x9 »

I went ahead and added the crossings (and created a replacement for the one you were missing). Have fun :wink:


Special note: if you use the US set or anything else that overrides the crossing gates with new ones, it will revert to the old gravel color at the crossings.
Attachments
sprites_102 fixed.zip
Everything you had and the crossing you were missing.
(38.15 KiB) Downloaded 146 times
Birdey
Engineer
Engineer
Posts: 90
Joined: 12 Oct 2004 04:59
Location: Sydney, Australia
Contact:

Thanks mate

Post by Birdey »

Thanks heaps, i hope it wasn't any trouble, and also how could you tell when it was out of alignment?, and i also missed the crossings because i didn't know how to do that... thanks heaps again, and also how do u make the sprite a bit bigger? or can't you?, or is it too much trouble?

Birdey
For every addition of knowledge u aquire, you forget something that you knew before
Peter1x9
Engineer
Engineer
Posts: 58
Joined: 04 Feb 2004 22:11
Location: Chicago suburbs

Re: Thanks mate

Post by Peter1x9 »

Birdey wrote:Thanks heaps, i hope it wasn't any trouble, and also how could you tell when it was out of alignment?, and i also missed the crossings because i didn't know how to do that... thanks heaps again, and also how do u make the sprite a bit bigger? or can't you?, or is it too much trouble?

Birdey
The only way i've found to align various things is to go in the game and take a screenshot, then modify the xrel and yrel values in the .NFO and go back in the game again. It's pretty much a trial and error type of thing.

In what way do you want to make the sprite bigger? If you mean the whole PCX file, you can resize it in whatever picture editor you are using (I use the Sprite editor for my editing). http://www.tt-forums.net/viewtopic.php?t=11720
If you mean each sprite, all you need to do is make it bigger in your PCX file, then change that sprite's ysize, xsize, xrel, yrel values to adjust for the bigger size. Just make sure that your xpos and ypos is adjusted properly if you make the sprite higher and/or wider.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Baidu [Spider] and 91 guests