grf codec. make it arrange/number ?

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

grf codec. make it arrange/number ?

Post by Dante123 »

here is the problem:
in the grf that i work on now, i have lots of sprites and for testing, i do the coding parallel to the sprite drawing.
now in some cases i made stuff like this:

Station ID 40 - woodpiles (sprite lines 500-525 in nfo)
Station ID 41 - wood saw terrain (sprite lines 526-550 in nfo)
-
Station ID 45 - Grain storage (Sprite lines 551-575 in nfo)

now in this case, the grain is coded after the "wood saw terrain" in spritenumbers in the nfo. in the build menu you have them also in the list like 40 - 41 - 45
but for the ID i skipped a few numbers with the idea that when i have 1 more wood related sprite in the future, i can give it for example ID 42. and the spritecoding will be at the end of the nfo file again.
but i discovered this does not work. if at the end now station ID 42 is added, in the build menu it will be added at the end like 40 - 41 - 45 - 42.
but at a certain point the nr of lines (spritenumbers) in the nfo is over 1000.... so the big question is:
how do i get it like 40 - 41 - 42 - 45 without having to renumber hundreds of spritenumbers ? is there some way in the grf codec to sort by station ID or something like that ?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: grf codec. make it arrange/number ?

Post by planetmaker »

Dante123 wrote: how do i get it like 40 - 41 - 42 - 45 without having to renumber hundreds of spritenumbers ? is there some way in the grf codec to sort by station ID or something like that ?
Don't assign sprite numbers manually. Use nforenum. And code things in the correct tileID order within your nfo.
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: grf codec. make it arrange/number ?

Post by Dante123 »

planetmaker wrote:
Dante123 wrote: how do i get it like 40 - 41 - 42 - 45 without having to renumber hundreds of spritenumbers ? is there some way in the grf codec to sort by station ID or something like that ?
Don't assign sprite numbers manually. Use nforenum. And code things in the correct tileID order within your nfo.
nforenum ?(

i was all coding it manual ?
How does it work to it it corrected what i have now?
that readme that is included doesn't really help
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: grf codec. make it arrange/number ?

Post by michael blunck »

Dante123 wrote: [...] for the ID i skipped a few numbers with the idea that when i have 1 more wood related sprite in the future, i can give it for example ID 42. and the spritecoding will be at the end of the nfo file again.
I´m not sure if this will work. The Wiki says "Also, all station IDs must get their classes in the right order, starting from ID 00 onwards." I just don´t remember whether there are any "effects" when leaving out station IDs (temporarily).

W/r to nforenum, just let it process your file, it´ll renumber all sprite numbers automatically, and it does some valuable syntax checking.

regards
Michael
Image
Dante123
Chief Executive
Chief Executive
Posts: 671
Joined: 11 Aug 2009 16:10
Location: The Nederlands
Contact:

Re: grf codec. make it arrange/number ?

Post by Dante123 »

wouw! that tool works just fantastic !
i just cut-pasted all station ID's in the right order (yes you can skip some numbers to leave some space to insert new ones later on)
nforenum renumbered them all into the right order. thanx for this great tool!
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests