[RELz] tes3lint, a tool for finding possible problems in a p

Post » Wed Dec 07, 2011 7:57 pm

tes3lint (http://www.gamesas.com/bgsforums/index.php?showtopic=930873) is now in Beta.

tes3lint is a command-line tool for investigating potential problems in TES3 plugins. It is written in Perl and runs natively on Windows or Linux.

Highlights from the http://code.google.com/p/mlox/wiki/Tes3lint:

Features
* Find out if the plugin defines autocalc'ed spells.
* Find out if the plugin has an implicit dependency on Tribunal/Bloodmoon functions because it uses them but does not list the expansion as a Master.
* List Evil GMSTs.
* Find deprecated usage of Leveled List scripting functions on standard Bethesda Lists.
* Find duplicate (i.e.: "dirty/unclean") records that are unchanged from one of the masters.
* Shows duplicate and modified INFO dialogs.
* Find CELLs that trigger the FOGBUG.
* Find any CELLs where fog density in DATA is different from AMBI subrecords.
* Find problematic usage of GetSoundPlaying for detecting events.
* Find dirty junk cells that are apparently injected by some CS bug.
* Find scripts that are unaware of MenuMode.
* Show if plugin is missing Author/Description/Version from plugin header.
* Find duplicate/modified INFOs.
* Finds potentially buggy case where INFO dialogs have had their IDs changed.
* Find all records in the plugin that override records in its Masters.
* Find problematic scripts attached to Bethesda doors.

Here is a http://code.google.com/p/mlox/wiki/Tes3lintSample to get an idea of some of the things it will tell you about a plugin.

The wiki page explains how to http://code.google.com/p/mlox/wiki/Tes3lint#Get_tes3lint and http://code.google.com/p/mlox/wiki/Tes3lint#Installing_and_Running_tes3lint tes3lint.
User avatar
laila hassan
 
Posts: 3476
Joined: Mon Oct 09, 2006 2:53 pm

Post » Thu Dec 08, 2011 1:26 am

Congratulations on this release!

* Swiveller *
User avatar
Baylea Isaacs
 
Posts: 3436
Joined: Mon Dec 25, 2006 11:58 am

Post » Wed Dec 07, 2011 9:09 pm

Congratulations indeed. :)
User avatar
Krista Belle Davis
 
Posts: 3405
Joined: Tue Aug 22, 2006 3:00 am

Post » Thu Dec 08, 2011 12:15 am

Is the new name the hint of a coming tes4lint? :D
User avatar
Gemma Flanagan
 
Posts: 3432
Joined: Sun Aug 13, 2006 6:34 pm

Post » Wed Dec 07, 2011 1:42 pm

Is the new name the hint of a coming tes4lint? :D

Ha ha :) Not really. It's just that I wanted to emphasize that this tool was not also usable for TES4 plugins. I'm sure the issues with TES4 plugins are quite different.

Once I get the next 3 or 4 Morrowind tools I have in mind out the door, maybe I'll move on to Oblivion and see what I'd like to do there.
User avatar
Mark Churchman
 
Posts: 3363
Joined: Sun Aug 05, 2007 5:58 am

Post » Thu Dec 08, 2011 1:20 am

Have you considered flagging up invalid headers? Where the TES3.DATA doesn't match file size of the file defined in the corresponding TES3.MAST?
User avatar
Kat Ives
 
Posts: 3408
Joined: Tue Aug 28, 2007 2:11 pm

Post » Wed Dec 07, 2011 9:17 pm

Have you considered flagging up invalid headers? Where the TES3.DATA doesn't match file size of the file defined in the corresponding TES3.MAST?

That would be pretty easily done. I've got a little library of over 2000 plugins installed, so I'll go do a test and see if that comes up with anything.

There are a couple good plugins to do tests on, that I thought I might mention:
MultiMark.esp contains a hexedited GMST that can choke a strict record parser.
morrowland.rar/From Hell To Heaven.esm is almost 70MB, so it's a good stress tester.

Edit: This was mildly interesting: I just tried a check for the number of records in the TES3.HEDR vs the actual count, and quite a few plugins differ. I conclude that particular field is pretty worthless :)
User avatar
Justin Bywater
 
Posts: 3264
Joined: Tue Sep 11, 2007 10:44 pm

Post » Wed Dec 07, 2011 2:01 pm

Have you considered flagging up invalid headers? Where the TES3.DATA doesn't match file size of the file defined in the corresponding TES3.MAST?

I've checked in a new flag for this (MASTERS - lists masters out of sync with installed masters), available from svn:
http://mlox.googlecode.com/svn/trunk/util/tes3lint (Right click/Save)

It'll be in the next release.
User avatar
CYCO JO-NATE
 
Posts: 3431
Joined: Fri Sep 21, 2007 12:41 pm

Post » Thu Dec 08, 2011 12:59 am

Another idea: When loading a plugin with the Enchanted Editor sometimes I get this warning:
Warning: The number of records was mis-reported in the file header. This might have been caused by the file being edited in a hex editor or other low level editor. The problem has been corrected and will probably have no effect.
Seem to get this with mods edited by TESAME and those cleaned with TESPCD.
User avatar
Emma
 
Posts: 3287
Joined: Mon Aug 28, 2006 12:51 am

Post » Wed Dec 07, 2011 4:26 pm

Another idea: When loading a plugin with the Enchanted Editor sometimes I get this warning:Seem to get this with mods edited by TESAME and those cleaned with TESPCD.

I have that check written in the code now, but I haven't enabled it yet. It ended up not seeming very interesting. It doesn't seem to affect either Morrowind or the CS, they just read all the records in the file anyway. But I could enable it, if you like.
User avatar
Vickytoria Vasquez
 
Posts: 3456
Joined: Thu Aug 31, 2006 7:06 pm

Post » Wed Dec 07, 2011 9:57 am

Well, maybe it's just me but I always fix those errors when I come across them :shrug:
User avatar
Kevin S
 
Posts: 3457
Joined: Sat Aug 11, 2007 12:50 pm

Post » Wed Dec 07, 2011 10:00 am

Okey dokey, next release will check the actual number of records vs. those recorded in the header.
User avatar
Carys
 
Posts: 3369
Joined: Wed Aug 23, 2006 11:15 pm

Post » Wed Dec 07, 2011 1:22 pm

Okey dokey, next release will check the actual number of records vs. those recorded in the header.

It is a really strange record that, as it isn't used by Morrowind at all. (That I can make out :shrug:)


(Not saying that it is a bad thing to check for or anything... )
User avatar
Jessie
 
Posts: 3343
Joined: Sat Oct 14, 2006 2:54 am

Post » Wed Dec 07, 2011 4:27 pm

I look forward to the release date (I'm not knowledgeable enough about all this to provide any beta-testing feedback :( ). Keep up the great work, john.moonsugar! This utility will be a blessing. :tops:
User avatar
Kahli St Dennis
 
Posts: 3517
Joined: Tue Jun 13, 2006 1:57 am

Post » Wed Dec 07, 2011 12:48 pm

The version of tes3lint in svn now has NUMRECS flag enabled:
http://mlox.googlecode.com/svn/trunk/util/tes3lint

example:
tes3lint -f numrecs "Zyndaar's Bows.esp"Zyndaar's Bows.esp: NUMRECS	[NUMRECS]: number of records in TES3.HEDR (20) != Actual count (8)

User avatar
Robert Jr
 
Posts: 3447
Joined: Fri Nov 23, 2007 7:49 pm

Post » Wed Dec 07, 2011 12:42 pm

John, have you seen abot's / LizTail's recent posts in the MGE thread? They talk about how to determine the end of a script (since the method MGE used previously didn't work on some mods). Might be worthwile to check whether tes3lint uses one of the two suggested working methods (record length check / check for "END" command) or the one the doesn't work on all mods (null-termination).
User avatar
Calum Campbell
 
Posts: 3574
Joined: Tue Jul 10, 2007 7:55 am

Post » Wed Dec 07, 2011 9:55 am

John, have you seen abot's / LizTail's recent posts in the MGE thread? They talk about how to determine the end of a script (since the method MGE used previously didn't work on some mods). Might be worthwile to check whether tes3lint uses one of the two suggested working methods (record length check / check for "END" command) or the one the doesn't work on all mods (null-termination).

Alas no, I don't follow MGE, as I haven't gotten it working on Linux yet :)

I'll go see if I can find what you're talking about. I'm not sure I understand what the issue is to begin with.
User avatar
Michelle davies
 
Posts: 3509
Joined: Wed Sep 27, 2006 3:59 am

Post » Wed Dec 07, 2011 11:59 pm

I'll go see if I can find what you're talking about. I'm not sure I understand what the issue is to begin with.

One version of MGE assumes that SCPT.SCTX was null termianted. It isn't in all cases.
User avatar
Marta Wolko
 
Posts: 3383
Joined: Mon Aug 28, 2006 6:51 am

Post » Wed Dec 07, 2011 10:58 am

Sorry, I should've been more clear. I was thinking this:

tes3lint parses scripts in the esp. Scripts are terminated, and after termination other code may follow (for example if the script has been edited), which never gets executed. There are two potential problems with this:

1. If a utility that parses the scripts misses the end of a script, it then it treats the following records as part of the script code. (This is what the MGE beta apparently did.)

2. If the utility continues to read script code after the "END" command, then it may report problems of this code which are effectively false hits (because the respective code will never get executed).

Or just check posts #187 and #188 in the current MGE thread. :)
User avatar
Josephine Gowing
 
Posts: 3545
Joined: Fri Jun 30, 2006 12:41 pm

Post » Wed Dec 07, 2011 2:47 pm

One version of MGE assumes that SCPT.SCTX was null termianted. It isn't in all cases.

Ah, I just read that. Thanks.

tes3lint doesn't care if the scripts are null-terminated or not.

However, abot's comment on script text termination at the first "END" is interesting, I didn't know that people did that, although I think abot mentioned it before, it didn't register in my brain.

I can probably do an okay job of recognizing END, but I'll have to see. I'm using regexps, not a real parser.

Edit: maybe it's time to reverse-engineer the compiled script! :) Has anyone done that yet?
User avatar
TASTY TRACY
 
Posts: 3282
Joined: Thu Jun 22, 2006 7:11 pm

Post » Wed Dec 07, 2011 11:20 am

I scanned 2311 plugins, comprising 55220 scripts, and found 26 instances of non-comment code after the "End" statement.


D'oh, I did make a mistake. It was 36 plugins/65 scripts had non-comment code after the end. I think :)
User avatar
Nicole Kraus
 
Posts: 3432
Joined: Sat Apr 14, 2007 11:34 pm

Post » Wed Dec 07, 2011 2:49 pm

Wow, fast work :)
Not that I think appending comments/previous versions of code after the end is a good practice, still it is something existing and working in some mods, like using Basic like = operator instead of C like ==, or <> instead of != ... MWEdit complains, TESCS happily compiles.
As the number of mods writing something after the first final end seems to be really low, all in all I don't think it is something critical to detect for MGE, but it is indeed good for this specialized tool :thumbsup:
User avatar
Isaac Saetern
 
Posts: 3432
Joined: Mon Jun 25, 2007 6:46 pm

Post » Wed Dec 07, 2011 7:44 pm

Wow, fast work :)
Not that I think appending comments/previous versions of code after the end is a good practice,

It's possible some of them were mistakes too. It would be easy to overlook a little "end" in the middle of your script if you put it in and forgot, or were using someone else's script as a template. I'll take a closer look and see if I find any that are suspicious. Maybe I should flag these.
User avatar
Dean
 
Posts: 3438
Joined: Fri Jul 27, 2007 4:58 pm

Post » Wed Dec 07, 2011 7:48 pm

Yes, maybe different persons working on scripts and keeping previous version when in doubt.
I just tried tes3lint-0.51 with one I stumbled upon when fixing some scripts (LGNPC_PaxRedoran_v1_12.esp, jo_BolvynCorpseScript script), it does not seem to be detected at the moment,
I am using this line
C:\Perl\bin\perl.exe tes3lint -r "G:\_games\_rpg\Morrowind\Data Files\LGNPC_PaxRedoran_v1_12.esp" > tes3lint.log
am I missing some parameter or is this feature not included in current uploaded version already?
User avatar
Alex Blacke
 
Posts: 3460
Joined: Sun Feb 18, 2007 10:46 pm

Post » Wed Dec 07, 2011 6:29 pm

I missing some parameter or is this feature not included in current uploaded version already?

Are you saying it does scan past the End? Or that it does not flag that there is code past the End?
The former is implemented in 0.51 so it should not scan past the End, the latter I was just musing about, haven't actually done anything yet.
User avatar
Anne marie
 
Posts: 3454
Joined: Tue Jul 11, 2006 1:05 pm

Next

Return to III - Morrowind