Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: [Tool] DF Entity Checker v0.23  (Read 22086 times)

AVE

  • Bay Watcher
    • View Profile
[Tool] DF Entity Checker v0.23
« on: April 28, 2012, 01:47:52 pm »

This tool checks entity (civilization) tags and shows buildings and reactions that exists in raw's files but are not added to the entity tags.

Usage: run (preferably in DF directory - where /raw/ is located). If the tool finds /raw/ directory, it automatically reads it's contents. If not, press button "Change dir" and select the directory, which contains /raw/. Afterwards, select entity to check, and press "Check" button. Afterwards, just copy required lines from respective windows into the corresponding entity.

Now doing cross-check also, as suggested by Jeoshua here. Cross-check test for:
  • Entity-defined buildings with not all entity-defined reactions (adds not defined reactions)
  • Entity-defined reactions with not all entity-defined buildings (adds not defined buildings)
  • Possible mistypes (entity-defined reactions and buildings that are not defined in raws)
Also testing for various errors, such as:
  • reactions w/o defined buildings.
  • buildings w/o defined reactions (possibly decorations? whatever, mostly it is an error).
Log window received a huge boost in usefulness, as nearly everything that isn't right goes there!

Updated: New buttons: "Clear log" and "Copy log to clipboard".

Screenshot (slightly outdated, but shows basic usefulness of the program):
Spoiler (click to show/hide)

Binaries (for Windows) are here, source is here.

Changelog:
Spoiler (click to show/hide)
Suggestions (on how to improve this), bugreports and comments are welcome!
« Last Edit: May 06, 2012, 12:35:24 pm by AVE »
Logged

MrDim

  • Bay Watcher
    • View Profile
Re: [Tool] DF Entity Checker
« Reply #1 on: April 28, 2012, 02:01:36 pm »

So the recycler was the only building the Dwarves couldn't build?
Logged

AVE

  • Bay Watcher
    • View Profile
Re: [Tool] DF Entity Checker
« Reply #2 on: April 28, 2012, 02:09:52 pm »

So the recycler was the only building the Dwarves couldn't build?
Yep, I used a small bit of my mod just to test the tool and make screenshot of it working. After adding those lines to dwarven entity I created a test pocket region, embarked, and it was fully working - new building and reactions for this building where already there.

Actually I wrote this tool because I constantly forget to add buildings and reactions to the dwarven entity. :) The saddest part of it comes when I find a great embark point - and my mod isn't working! :D
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [Tool] DF Entity Checker
« Reply #3 on: April 28, 2012, 05:24:10 pm »

This is wonderful, wonderful, WONDERFUL. Thank you. Great for mixmods.

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: [Tool] DF Entity Checker
« Reply #4 on: April 28, 2012, 06:03:59 pm »

It's not finding any entities for me, at all.  Not even the Dwarves.

Granted, I'm using a heavily modded game, but still it should find SOMETHING.

The log contains some information:
Spoiler (click to show/hide)

Looks like a Python version problem to me.  What version is this made for?
Logged
I like fortresses because they are still underground.

AVE

  • Bay Watcher
    • View Profile
Re: [Tool] DF Entity Checker
« Reply #5 on: April 29, 2012, 09:54:45 am »

Looks like a Python version problem to me.  What version is this made for?
If you are using binaries (and you should, according to you citing the log.txt, which is automatically created on any unhandled errors only in this specific situation), you don't need anything - it is already included in the distribution. If you prefer to use the source - I wrote this tool using python 2.7 and latest stable wxPython for 2.7.

It's not finding any entities for me, at all.  Not even the Dwarves.
The log contains some information
This is strange. From the logs it seems that it has found the "/raw/objects" subdirectory in whatever directory you are pointing it to, but cannot find any "entity_*.txt" files there! Are you pointing it to the Dwarf Fortress directory (which contains dwarffortress.exe and "/raw/objects" subdirectory), or may be to your mod location (which is not the complete raws)?

You should point the tool to the directory where it can find "/raw/objects" subdirectory, where it can find the complete raws for running the DF game. There must be entity*.txt, reaction*.txt and building*.txt files.
Logged

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: [Tool] DF Entity Checker
« Reply #6 on: April 29, 2012, 10:28:39 am »

No I'm deffinitely pointing it towards "j:\games\Dwarf Fortress", and raw\objects under that folder most certainly does contain entity_*.txt files.  Many of them.  The log isn't all the feedback I got.  The window showed that it had found the buildings correctly, and the reactions.  I didn't manually count them to verify it, but it finds 105 buildings and 1092 reactions.

And 0 entities  >:(
Logged
I like fortresses because they are still underground.

AVE

  • Bay Watcher
    • View Profile
Re: [Tool] DF Entity Checker
« Reply #7 on: April 29, 2012, 11:06:29 am »

it finds 105 buildings and 1092 reactions. And 0 entities  >:(
Then it is was a bug. Fixed. The bug was in that I was not ready to see one entity per file. :D
Also, last entity in file with multiple entities was lost.

Thanks for the bugreport!
« Last Edit: April 29, 2012, 11:40:45 am by AVE »
Logged

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: [Tool] DF Entity Checker
« Reply #8 on: April 29, 2012, 11:56:08 am »

Awesome!

As a suggestion for the next version.

This tool seems to look through everything to see what buildings and reactions are not added to the entity.  Would it be possible to look through the data and find out which REACTIONS that are premitted do not have the correct BUILDING in that entity's raws?

I ask because I'm getting results on the readout that the MOUNTAIN entity cannot build the HUMAN, ELF, GREMLIN, or GREENSKIN buildings.  Obviously, I don't want them to, but I do want to be able to create everything I need to in-game that I've already declared they are premitted to use as a reaction.
Logged
I like fortresses because they are still underground.

AVE

  • Bay Watcher
    • View Profile
Re: [Tool] DF Entity Checker
« Reply #9 on: April 29, 2012, 01:32:37 pm »

This tool seems to look through everything to see what buildings and reactions are not added to the entity.  Would it be possible to look through the data and find out which REACTIONS that are premitted do not have the correct BUILDING in that entity's raws?
As I understand, you are talking about something that could be called "cross-checking" - a test that checks whether all the reactions of some building are added correctly and vice versa. Am I right? If so, it is possible (just somewhat complicated) and probably will be implemented in a separate button (output will stay the same).
Logged

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: [Tool] DF Entity Checker
« Reply #10 on: April 29, 2012, 03:07:41 pm »

Basically cross-checking, yes.  Since you've already got the data loaded, I just feel the next step could be "validating" that data.  To see if everything is set up correctly.
Logged
I like fortresses because they are still underground.

AVE

  • Bay Watcher
    • View Profile
Re: [Tool] DF Entity Checker v0.2
« Reply #11 on: May 01, 2012, 02:02:42 pm »

Updated to 0.2.
Cross-check implemented. As a bonus, added testing for various errors. ;)
Logged

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: [Tool] DF Entity Checker v0.2
« Reply #12 on: May 01, 2012, 04:48:14 pm »

This tool just because 200% more useful than before.  Many many thanks AVE.

===

Oh jeez!  About 200 or so errors found, all check out as valid oversights/screwups on my part.

Also it's spitting out some minor errors, like:
"Reaction STEEL_BAYONET is in entity-permitted reactions but is not defined in reactions_*.txt"

The proper files are named "reaction_*.txt" and exist, although it is correct that the entries do not.

Final suggestion (maybe): Clear Log button.  Instead of selecting all and hitting delete, you could use one button to clear it.  Also possibly a few "Copy To Clipboard" buttons would be useful... Much easier suggestion than last time.
« Last Edit: May 01, 2012, 05:24:40 pm by Jeoshua »
Logged
I like fortresses because they are still underground.

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: [Tool] DF Entity Checker v0.2
« Reply #13 on: May 02, 2012, 07:08:18 am »

I would like to say that using this tool, I was FINALLY, and in one session's worth of work, able to straighten out the problems I was having on embarks.  Over 500 reactions were either missing or misplaced across the 10 entity types I have.

Any errors I've found with the program are either cosmetic or minor and interface based.  Everything that needs to be able to be done CAN be done, and everything the program reports about the crosschecking is true and factual besides what appears to be the minor typo I pointed out above.

Again, thanks so much AVE, and also BUMP.
« Last Edit: May 02, 2012, 07:10:10 am by Jeoshua »
Logged
I like fortresses because they are still underground.

AVE

  • Bay Watcher
    • View Profile
Re: [Tool] DF Entity Checker v0.2
« Reply #14 on: May 02, 2012, 08:55:04 am »

The proper files are named "reaction_*.txt" and exist, although it is correct that the entries do not.
Fixed.
Final suggestion (maybe): Clear Log button.  Instead of selecting all and hitting delete, you could use one button to clear it.  Also possibly a few "Copy To Clipboard" buttons would be useful... Much easier suggestion than last time.
Buttons added. Also, log is now cleared at every directory change.

Binaries and source updated @ DFFD.
I would like to say that using this tool, I was FINALLY, and in one session's worth of work, able to straighten out the problems I was having on embarks.  Over 500 reactions were either missing or misplaced across the 10 entity types I have.
That is great! Always nice to see that something you do actually helps people. Thanks for the feedback!
« Last Edit: May 02, 2012, 03:02:57 pm by AVE »
Logged
Pages: [1] 2