Page 10 of 22
Posted: 05 Mar 2006 23:03
by OzTrans
DaleStan wrote: ... You seem to be suggesting that the error message be changed to "An and-mask would suffice here"? ...
Yes, but after some thoughts, I think the whole issue, of whether a more efficient code should be used, belongs in the wiki. This boils down to experience and knowing how to do these things; I have never considered whether an 'and-mask' or something else would be more appropriate. Had I read about it in the wiki, this would be a different story. I would say a simple message that this sprite can be coded more efficiently and being pointed to the wiki would suffice. Of course I don't know all the various functionalities of var act-2's you are considering when suggesting a simpler solution and most importantly how more CPU-efficient this could be done.
Now, to this random business, this I coded weeks ago and everything seems to work ...
Code: Select all
//!!Warning (174): Using an undefined trigger.
1555 * 15 02 00 AE 80 E0 01 04 ED 00 EE 00 ED 00 EF 00
^^
Here, I am actually using vehicle trigger 5+6 (which do not exist); this sprite should only be randomized at the time of purchase. That 'E0 01' was deliberate and it does work.
The other one ...
Code: Select all
//!!Error (129): Offset 5: Only 8 random bits are available.
1520 * 39 02 00 ED 80 01 05 10 ...
^^ ^^
I do actually start at bit 4 (I do remember, that at the time of coding, counting had to start at 1 (for bit 0); this I found by trial and error. It took me a fair while to figure out how not to distroy/alter those other 2 random bits used in the case just above. I may be wrong, but I'll investigate this further.
Posted: 06 Mar 2006 20:34
by DaleStan
OzTransLtd wrote:DaleStan wrote: ... You seem to be suggesting that the error message be changed to "An and-mask would suffice here"? ...
I would say a simple message that this sprite can be coded more efficiently and being pointed to the wiki would suffice.
That's a quality-of-implementation issue. Taking this to an extreme, I could simply use the exact same message for everything: "NFORenum does not like this sprite; see the wiki." But that really would not be useful.
It seems to me that a shift-and should be marginally faster than a shift-and-add-*, but depending on how it is implemented, it might actually be the other way around.
OzTransLtd wrote:Here, I am actually using vehicle trigger 5+6 (which do not exist); this sprite should only be randomized at the time of purchase. That 'E0 01' was deliberate and it does work.

yes, that is triggers 5..7; not sure where I got 4..6. And yes, that line will work. Until Patchman defines a vehicle trigger 5, that is.
For those of you who are using industry prop 12, and haven't discovered this yet, I've uploaded a new 0.dat.
Posted: 06 Mar 2006 20:48
by Patchman
DaleStan wrote:OzTransLtd wrote:Here, I am actually using vehicle trigger 5+6 (which do not exist); this sprite should only be randomized at the time of purchase. That 'E0 01' was deliberate and it does work.

yes, that is triggers 5..7; not sure where I got 4..6. And yes, that line will work. Until Patchman defines a vehicle trigger 5, that is.
Yes, if you want no random triggers, you should specify no random triggers at all instead of using reserved (undefined) ones. Otherwise, as DaleStan says, it'll work for now but break once those become defined.
Posted: 07 Mar 2006 01:11
by OzTrans
DaleStan wrote:That's a quality-of-implementation issue. Taking this to an extreme, I could simply use the exact same message for everything ...
However you implement this is fine with me, I'll simply assume you know more than I do and will make changes to my code until the messages disappear.
Patchman wrote:Yes, if you want no random triggers, you should specify no random triggers at all instead of using reserved (undefined) ones. Otherwise, as DaleStan says, it'll work for now but break once those become defined.
I'll go over that again.
Thanks for all the help.
Posted: 07 Mar 2006 05:56
by DaleStan
Ugh... Brain fart on the high bit of <triggers>.
Just goes to show that you can't always trust me to know what I'm talking about. Usually, maybe. But not always.
v3.1.2 to v3.1.3
- (bugfix) Bit 7 of <triggers> is not a trigger.
- (hotfix) Add industry property 10.
Posted: 24 Mar 2006 06:43
by DaleStan
I'm coding again, at least for a little bit. Hopefully I'll catch some more inspiration here soon. ... And maybe some more free time.
v3.1.3 to v3.1.4
- Action 02 feature 07/09 <xofs> and <yofs> no are longer limited to 00..0F.
- (bugfix) Fix check for non-decreasing ypos in real sprites.
Posted: 26 Apr 2006 03:35
by DaleStan
After way too long fighting disinterest and/or coder's block, I finally have something releasable again.
Most of you folks probably won't notice, but there are some massive internal changes that reduce memory usage to about half and reduce runtime by about one third. I think this is a Good Thing (tm).
Those of you who compile your own versions will notice that I'm starting to depend on
boost. For now it's just current_function.hpp (and it's included), but I may add boost::program_options, if I can get it to comprehend optional arguments.
Changelog:
v3.1.4 to v3.2.0
- (hotfix) TextIDs F900..F904.
- (hotfix) Callbacks 3C and 3D.
- (hotfix) Industry variable 63, industry tile variable 61, vehicle variable 48.
- New format for lang bytes.
- Check that lang byte contains a known language.
- @@BEAUTIFY LINEBREAKS
- @@BEAUTIFY CONVERTONLY
- (change) Action 2s of at least three bytes will always define their ID.
- Check for duplicate style-names for all languages.
- Allow ON and OFF on the command line as + and -, resp.
- @@CLEARACTION2
- @@CLEARACTIONF
Posted: 08 May 2006 23:05
by DaleStan
NFORenum's source code, in its latest, bleeding-edge form (and all other forms it has had since 3.2.0, is now available from [url]svn://svn.ttdpatch.net/misc/nforenum[/url], and is no longer directly available from the NFORenum site.
Changelog:
v3.2.0 to v3.2.1
- @@USEOLDSPRITENUMS
- @@DEFINEID2
- @@LOCATEID2
- @@TESTID2
- (bugfix) Error message when Action B contains an invalid parameter now reports correct offset and parameter.
- Check for including textIDs with a 00 byte.
- (bugfix) Prevent beautifier from inserting extraneous blank lines a line that contains only quoted characters.
- Merge the <xoff>/<yoff> and <xoff>+<xextent>/<yoff>+<yextent> checks, and reduce them to Warn3.
- New properties, variables, and callbacks:
- - Station properties: 16, 17, 18
- - Station variables: 4A, 66
- - Callbacks: 140, 141, 142
- New action 5 type 0D
Posted: 09 May 2006 03:47
by George
DaleStan wrote:NFORenum's source code, in its latest, bleeding-edge form (and all other forms it has had since 3.2.0, is now available from [url]svn://svn.ttdpatch.net/misc/nforenum[/url], and is no longer directly available from the NFORenum site.
Where can I download the all in one rar archive now?
Posted: 09 May 2006 14:21
by DaleStan
It doesn't exist. A Windows binary is available from the site, and the source is at the other end of [url]svn://svn.ttdpatch.net/misc/nforenum/[/url].
For Windows users, I recommend
TortoiseSVN, although
Cygwin's svn client can also be useful.
Posted: 09 May 2006 16:17
by Wile E. Coyote
DaleStan, one proposition (might be impossible or unuseful):
NFO Renum checks, for example, numprops in Action 0, or numloadingtypes or nvars in Action 2 etc. and reports if they don't match. Is it possible to add switch for automatic fixing errors (for example: renum -p [filename] fixes numprops, renum -v fixes nvars etc.)
Posted: 09 May 2006 17:18
by DaleStan
Wile E. Coyote wrote:DaleStan, one proposition (might be impossible or unuseful):
NFO Renum checks, for example, numprops in Action 0, or numloadingtypes or nvars in Action 2 etc. and reports if they don't match. Is it possible to add switch for automatic fixing errors
Useful where possible, but not always possible.
Take, for example, these sprites:
Code: Select all
1*0 02 00 00 00 00 00 00 01 00 02 00 03 00 04 00
2*0 02 00 10 81 7F 00 02 03 02 01 00 00 00 02 00 01 01
3*0 00 00 01 01 02 00 06 15 08 01
In sprite 1, there's no way of telling whether nument1 and nument2 are supposed to be 00 05, 01 04, 02 03, 03 02, 04 01, or 05 00.
In sprite 2, is that <nvar> == 1 with two extra bytes, or <nvar>==2 with a missing default?
In sprite 3, is that one property for two vehicles, or two properties for one vehicle?
But in many cases it would be possible.
Posted: 12 May 2006 05:08
by DaleStan
For sprite 3, I decided to assume that <num-info> was correct while checking <num-props>.
These are the list of things NFORenum will (sometimes) auto-correct:
Action 0 <num-props>
Action 0 <num-info>
House/industry tile extended format standard action 2 <num-sprites>
Variational action 2 <nvar>
Random action 2 <nrand>
Action 3 <num-cid>
Action 4 <num-ent>
Action 7/9 <varsize>
Action A <num-sets>
Action E <num>
Action 12 <num-def>
Did I miss anything?
Anyone who wants to test this out can check out the latest revision of the NFORenum source from [url]svn://svn.ttdpatch.net/misc/nforenum[/url], but the action 7/9 correcting code is not yet (as of r220) committed.
Posted: 12 May 2006 11:29
by Jezulkim
I have a problem with the nfo renum. When I'm going to renum an nfo file, the renum.exe says:
NFO Renum wrote:Could not create .renum directory in C:\. (13)
Unkown reason
I'm using version 3.2.1
Posted: 12 May 2006 12:42
by DaleStan
13 is EACCES, meaning "Permission denied".
The only way I could reproduce this was to attempt to write to a read-only location.
I can't explain why C:\ would be read only, though. Try specifying a different directory with -D/--data.
Posted: 12 May 2006 14:13
by Wile E. Coyote
DaleStan wrote:Anyone who wants to test this out can check out the latest revision of the NFORenum source from [url]svn://svn.ttdpatch.net/misc/nforenum[/url], but the action 7/9 correcting code is not yet (as of r220) committed.
I can't open URL

Are corrections optional or automatic?
Posted: 12 May 2006 14:24
by DaleStan
Wile E. Coyote wrote:DaleStan wrote:Anyone who wants to test this out can check out the latest revision of the NFORenum source from [url]svn://svn.ttdpatch.net/misc/nforenum[/url], but the action 7/9 correcting code is not yet (as of r220) committed.
I can't open URL

You'll have to have something that speaks SVN and a compiler to use that. I use
TortoiseSVN, and either
Cygwin's gcc or MSVS 2003 to compile.
Wile E. Coyote wrote:Are corrections optional or automatic?
Automatic if you enable them.
renum foo.nfo does exactly what it did before, while renum -a foo.nfo will perform most autocorrections, and renum -aa foo.nfo will perform all of them.
EDIT: fix TortoiseSVN link
Posted: 12 May 2006 14:33
by Wile E. Coyote
Too big file... I can't download 7 or 9 MB with 56K connection

(for TortoiseSVN, I can't open Cygwin site).
Can'c compile with VB6 (noob question, but only hope)?
Posted: 12 May 2006 15:48
by DaleStan
Not with VB6. With V
C6, probably, but I haven't tested that in a long time.
Cygwin's site does seem to be down, but the installer is working fine, so I'll attach it. Make sure you get the gcc, make, and subversion packages; I'm not sure which (if any) of those install by default.
You'll also need the boost-devel package (Or maybe the boost package, not quite sure), unless you move current-fun... Oh forget that; I'm going to fix that in SVN; you don't currently need the boost package.
gcc and make are only required if you don't already have a C/C++ compiler.
I have no clue what the download size will be, however.
Then
Code: Select all
$ svn co svn://svn.ttdpatch.net/misc/nforenum
$ cd nforenum
$ make
To get new versions, it's
Code: Select all
$ cd nforenum (unless you're already in the nforenum directory.)
$ svn up
$ make
If you want a binary that can be run outside the Cygwin environment, use make CFLAGAPP=-mno-cygwin instead of make.
If you are using some other compiler, omit the make commands, and instead build NFORenum with that compiler.
Posted: 12 May 2006 18:51
by Jezulkim
DaleStan wrote:I can't explain why C:\ would be read only, though. Try specifying a different directory with -D/--data.
My C:\ it's not read only, I have an older version of nfo renum and that works fine. Specifying a new directory helped, but I have to re-specify that every time I renum a file. Or is there are way to set a default directory?