NFORenum v3.4.6 released (NFO renumberer and linter)

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

Moderator: Graphics Moderators

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

Post by DaleStan »

1) Fixed
2) Fixed -- This actually happened for all values of num-sprites 20..DF ("label&0xE0"!="(label&0xE0)==0xE0")
3) Added
Hangs: Fixed (It's probably a good idea to go on to the next byte after deciding to ignore the current one.)

Changelog:
v2.6.1 to v2.6.2
- (bugfix) No warnings about backwards gotos when skipping 20..DF sprites.
- (bugfix) Fixed hangs when using control characters where they are ignored.
- Added checks for generic textIDs.
- Checks for setting out-of-range texts using too-large <num-ent>.
- Up to date with 2.0.1 alpha 69:
- - (hotfix) Action D variable 9F.
- - (hotfix) Action 0 feature 08 props 0A..0F.
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
OzTrans
Tycoon
Tycoon
Posts: 1714
Joined: 04 Mar 2005 01:07

Post by OzTrans »

NFORenum v2.6.2 works fine, thanks for the prompt updates.

Although there are some more messages turning up with those F8xx text strings.

Code: Select all

// Part 2 : Text strings F864 .. F8DC
//!!Error (161): Offset 1435: Text ID FF C7 is not a valid text ID.
//!!Error (161): Offset 1452: Text ID FF C7 is not a valid text ID.
//!!Warning (143): Offset 2599: Using unspecified control character 1E.
    6 * 2627	 04 48 9F 79 64 F8
...

// F8A8 stationnumdefault 
   "Stasjon " 81 FF C7 00
// F8A9 stationclassdefault 
   "Stasjonstype " 81 FF C7 00
...

// F8DB hotkeylistdos 
   "xqwe!@#$t%1234567890-=" 1E 5C 00
// F8DC hotkeylistwin
   "xqwe!@#$t%1234567890-=`" 5C 00
and here is the equivalent out ot 'ttdpttxt.txt'

Code: Select all

...

stationnumdefault="Station \81ÿÇ\00"  <<<  ÿÇ = FF C7
stationclassdefault="Station class \81ÿÇ\00"   <<<    ÿÇ = FF C7

...

hotkeylistdos="xqwe!@#$t%1234567890-=\1e\\\00"   <<<   1E
hotkeylistwin="xqwe!@#$t%1234567890-=`\\\00"
I can do without the 'hotkeylists', there's nothing to translate. But the 'FF C7' is a bit of a problem.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

As an interm fix, until I hear the full details from Patchman, this TextIDs.dat will supress the C7FF warning (all C7xx IDs, actually), and add IDs F8DD..F901 to the list of permissible IDs.

WARNING: This file is not backed up by anything more official than my personal interpretation of ttdpttxt.txt.

(69 bytes -> 70 bytes)

Mistake when creating; new files posted.
Last edited by DaleStan on 12 Jan 2006 03:21, edited 1 time in total.
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
Joyrider
Engineer
Engineer
Posts: 3
Joined: 24 Aug 2005 14:26
Location: St.-Petersburg, Russia

Post by Joyrider »

George wrote:This nfo hangs NFOrenum
I've noticed that too ;) It happens because of the five sprites from #4 to #8 where actions 4 are used. If these lines are deleted everything becomes OK.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

DaleStan wrote:Hangs: Fixed
DaleStan wrote:- (bugfix) Fixed hangs when using control characters where they are ignored.
I just checked again, and it definitely works here.
If it's not fixed for you, then I need to know about it, in very explicit detail.
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
OzTrans
Tycoon
Tycoon
Posts: 1714
Joined: 04 Mar 2005 01:07

Post by OzTrans »

v2.6.2 works fine; it no longer hangs; and all those F8xx (except F8E3 and F8E4, nothing to translate there anyway) are ok, too. But now textIDs in the D3xx range are no longer accepted.

Code: Select all

//!!Error (161): Offset 2469: Text ID 01 D3 is not a valid text ID.
//!!Error (161): Offset 2559: Text ID 02 D3 is not a valid text ID.
//!!Error (161): Offset 2588: Text ID 03 D3 is not a valid text ID.
//!!Error (161): Offset 2872: Text ID 06 D3 is not a valid text ID.
//!!Error (161): Offset 2955: Text ID 02 D3 is not a valid text ID.
//!!Error (161): Offset 3247: Text ID 02 D3 is not a valid text ID.
//!!Error (161): Offset 3368: Text ID 02 D3 is not a valid text ID.
 1127 * 6886	 04 00 9F 52 80 D0 55 73 61 67 65 3A 20 8A 75 6E 69 76 65 72 73 61 6C 20 73 ...

                 ... 61 74 65 73 29 81 01 D3 00 55 73 61 67 65 3A 20 ...
                                    ^^^^^^^^
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

The wiki says that that's not valid:
The wiki wrote:D000 Miscellaneous GRF texts

The table has up to 1024 entries. To use entry X in an include text (code 81), use ID D400+X.
IOW, to include text D301, you need to type "81 01 D7".

I assumed the same was true of the D800 IDs, but that may not be the case; I'll update if necessary once I check with Csaba.

EDIT: I see this has already been discussed elsewhere.
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
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

DaleStan wrote:[New TextIDs.dat]
We're going to try this again. I'm getting more and more tempted to just give up. Fortunately for you and unfortunately for me, I'm not yet willing to give up while there are known bugs, and if there aren't known bugs, there's no reason to give up.

I duplicated some the ttdpttxt entries when counting them, resulting in a few too many IDs.

Changelog:
- Remove IDs F8FB..F901
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
OzTrans
Tycoon
Tycoon
Posts: 1714
Joined: 04 Mar 2005 01:07

Post by OzTrans »

DaleStan wrote: ... to include text D301, you need to type "81 01 D7".
Yes, now, I do know that and understand it, thanks. Further, I'll go and try those DCxx may be that is the same problem I had with the currency display names.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

DaleStan wrote:I assumed the same was true of the D800 IDs, but that may not be the case; I'll update if necessary once I check with Csaba.
It turns out that I didn't do that after all. Of the D800 class, NFORenum complains if anything outside of DC00..DCFF is either read or written.

Lots of little things that came up while coding SilentNews.
For one: //!!Error(141): ID 3C is out of valid range (00..49)

v2.6.2 to v2.6.3
- (hotfix) Add new class F8 TextIDs.
- (bugfix) Allow including TextID C7FF (81 FF C7).
- (bugfix) Format/argument agreement for some instances of INVALID_ID (141).
- (bugfix) No longer die on (non-Text)IDs above FF.
- Added format/argument agreement checks. (non-fatal)
- (bugfix) Re-write import sprites in canon format.
- (bugfix) Allow setting properties for sound ID 49.
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
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

According to wiki you can change text IDs in the 0xE000 range. However, nforenum (2.6.3) complains:

Code: Select all

//!!Error (161): Offset 4: Text ID 00 E0 is not a valid text ID.
  173 * 12	 04 48 9F 01 00 E0
	 "Leden" 00
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Grr... I didn't want to release a new version here, but my square wheel went rectangular. Hopefully, I can get out of this bugfix-rut and back to new features soon.

v2.6.3 to v2.6.4
- (bugfix) Complain when DCxx IDs are included.
- (bugfix) Allow changing class E0 TextIDs.
- Revert format/argument agreement checks. Instead:
- (bugfix) Make argument supercede format for width determination.
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
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

DaleStan, would it be possible to pass the path to a .renum directory as a parameter? I keep all the tools in a separate "bin" directory, but can't figure out a way how to prevent .renum being created in everywhere i check a nfo with it.
It's not a problem to delete it, that's just a minor inconvenience, but for some reason it takes a noticeable (a few seconds) time to recreate it the next time.

Also, since the program automatically calculates the size of pseudosprites, could there be a modified version of the @@DIFF command that leaves the sizes as -1 as well? Like:

Code: Select all

   -1 * -1      0C 01 02 03 ....
Anyway, I have to say that your program is priceless. Thanks a ton! It saves a lot of the drudge work.

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

Post by DaleStan »

minime wrote:DaleStan, would it be possible to pass the path to a .renum directory as a parameter?
Sure. I've got lots of things in that department I'd like to do, but that's not one that had occurred to me. I should probably change the default to ~/.renum on Unixy systems too.
There's a sleep(5); call after all data-directory related messages, to ensure they appear for those who don't run NFORenum from a command-line. I can replace it with a press-any-key-to-continue message, like TTDPatch when it finds an invalid switch in ttdpatch.cfg. Would that be better? I don't like the idea of removing it entirely, though.
minime wrote:could there be a modified version of the @@DIFF command that leaves the sizes as -1 as well? Like:

Code: Select all

   -1 * -1      0C 01 02 03 ....
:oops: In all honesty, I have often thought "It sure is annoying to have the sizes change when diffing. Too bad there isn't anything I can do about that."[0]
I'll try both 0 and -1, and use whichever causes grfcodec to die more gracefully. I don't really see the point in having both commands, but if anyone is particularly attached to the output of @@DIFF being strictly valid, I'll add a parameter.

[0] I wanted the output to always be valid as input to grfcodec.
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
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

DaleStan wrote:
minime wrote:DaleStan, would it be possible to pass the path to a .renum directory as a parameter?
Sure. I've got lots of things in that department I'd like to do, but that's not one that had occurred to me. I should probably change the default to ~/.renum on Unixy systems too.
There's a sleep(5); call after all data-directory related messages, to ensure they appear for those who don't run NFORenum from a command-line. I can replace it with a press-any-key-to-continue message, like TTDPatch when it finds an invalid switch in ttdpatch.cfg. Would that be better? I don't like the idea of removing it entirely, though.
Hmm, to be honest a keypress would be even worse than the delay :). I use renum as a part of a larger build script, so keypresses there are undesireable.
How about another parameter/switch to disable it? Or possibly, have that as a side effect of the parameter that specifies the path to the data directory. And just to clarify, i'm talking about command line parameters. It would be really nice to have an option to specify things like @@DIFF etc. through them as well.
Check out boost::program_options - that could help ya out.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

minime wrote:Or possibly, have [disabling the delay] as a side effect of the parameter that specifies the path to the data directory.
That's logical. Will be done. If I can figure out a way to do it, I'll make the data-dir option with no argument mean "Use default dir, but eliminate the sleep() call." My excuse for putting it in was that it would only happen once or twice. This is true for me, but, obviously, not true for everyone else.
minime wrote:It would be really nice to have an option to specify things like @@DIFF etc. through them as well.
Yes it would. That's been on my list of things to make the command line do. I only see @@LINT, @@WARNING [ENABLE|DISABLE], and @@DIFF as potentially command-line useful, though. Command-line options would probably apply to all files listed.
minime wrote:Check out boost::program_options - that could help ya out.
Thanks, but I am planning to use GNU getopt, and I think I have it figured out. Any particular advantages/disadvantages of boost vs getopt?
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
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

DaleStan wrote:
minime wrote:It would be really nice to have an option to specify things like @@DIFF etc. through them as well.
Yes it would. That's been on my list of things to make the command line do. I only see @@LINT, @@WARNING [ENABLE|DISABLE], and @@DIFF as potentially command-line useful, though. Command-line options would probably apply to all files listed.
Maybe @@PRESERVEMESSAGES too? And when you think about it, a limited variant of the @@LET (only to define constants, no point for calculations there) could be useful too in some situations.
DaleStan wrote:
minime wrote:Check out boost::program_options - that could help ya out.
Thanks, but I am planning to use GNU getopt, and I think I have it figured out. Any particular advantages/disadvantages of boost vs getopt?
Can't really say. I only looked at the source and noticed you didn't use anything atm.
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

No one said anything about validity of @@DIFF output, so it's no longer valid. Since the output isn't valid anyway, @@DIFF also causes sprite 0 to report 0 sprites.

Here are the new command-line options. Full details are hiding behind (surprise, surprise) renum -? or renum --help.
--help -?
--data[=<dir>] -D[<dir>]
--no-replace --keep-old -k
--comments=<type> -c <type>
--diff -d
--let=<expr> -L <expr>
--lint=<level> -l <level>
--preserve-messages -p
--warning-disable=<num> -w <num>
--warning-enable=<num> -W <num>

Changelog:
v2.6.4 to v2.7.0
- Change @@DIFF to set sprite lengths to 0 and sprite 0 to "00 00 00 00".
- Add several command-line arguments (see renum -?).
- Look for .renum directory in HOME too, if defined.
- (bugfix) Crash when directory could not be created.

(Thanks, minime, for prodding me to add commandline args.)
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
minime
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 18 Jan 2004 10:02
Skype: dan.masek
Location: Prague, Czech Republic
Contact:

Post by minime »

Wonderful, thanks a ton! As soon as I have some time, I'll give it a good testing. I didn't at all expect you to go about it this fast :)
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. --Albert Einstein
Image Image Image
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Rather than correct Lakie when he thought NFORenum was smarter than it really was, I made NFORenum smarter.
I'm not sure if that second item is useful, or entirely a good idea, but it wasn't hard to add, and I ignored the sprite numbers anyway. They're now optional except on realsprites where the filename starts with a digit.

v2.7.0 to v2.8.0
- Added @@REALSPRITES/--real-sprites/-r.
- Made sprite numbers optional most of the time.
- Up to date with a70's action 7/9/10 handling.
- Add checks for valid usage of variable 0C. (messages 163..165)
- Made "-1 * 1 00" only parse as a real sprite when looking for real sprites.
- (bugfix) Report proper ID range on invalid non-text 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
Locked

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 8 guests