preload button hover image:
HomeSearchRankingsStatisticsAboutContact
Current Time: Nov 27, 2020, 04:50:49 am
 Dwarf Fortress File Depot » Utilities » TWBT Subtype Finder
      
Registration is not required to download. However, it will allow you to vote, comment, and upload. Forgot your password?
File Listing: TWBT Subtype Finder
Last Updated: Jul 20, 2014, 03:46:59 pm
File version: 1
For DF version: N/A
Downloads: 143 Size: 383.8 KB
Views: 3,050 Type: ZIP
Rating (0 votes): Unrated
Description
I was interested in the new TWBT plugin for DFHack that allows the addition of custom tile sets for items. The plugin requires the item subtype to define specific items, so I wrote a script that reads through the raws, and generates an export file for each item type, along with its subtype number.

The script was written in AutoHotKey, which means that it is sadly Windows only.

It was also meant to be a 'quick and dirty' tool, so the cancel buttons on the dialog boxes don't actually cancel, so much as move forward in the script without entering anything. Sorry about that. :oops:

The code is not licensed under anything, and anybody and everybody should take it, and improve upon it.

The download contains a compiled version of the code, and the source.

Enjoy!
Raw Data: JSON / Text
Checksum / Hash
SHA-256: 8b83849d05d7b2fb6ac34555f55706ed479a8b689d529bac389ca92a12fb22ad
IP: logged
Commands
More From This Author
Comments
IP: logged
 TWBT Subtype Finder (v 1)  » posted by Rydel on Oct 06, 2014, 05:59:19 pm
The tool only appears to read the default files, not additional files added by mods. What do I need to do to get it to use files from the mod as well?
IP: logged
 Re: TWBT Subtype Finder (v 1)  » posted by Dragoon209 on Oct 06, 2014, 06:36:59 pm
Rydel wrote:
The tool only appears to read the default files, not additional files added by mods. What do I need to do to get it to use files from the mod as well?

The script assumes that files are named in a specific way, mainly "itemtype_modname. Txt"

So new items might be item_YourMod.txt.

If you add the item type and and underscore to the front, it should work. Let me know!
IP: logged
 Re: TWBT Subtype Finder (v 1)  » posted by Rydel on Oct 06, 2014, 06:50:13 pm
Dragoon209 wrote:
Rydel wrote:
The tool only appears to read the default files, not additional files added by mods. What do I need to do to get it to use files from the mod as well?

The script assumes that files are named in a specific way, mainly "itemtype_modname. Txt"

So new items might be item_YourMod.txt.

If you add the item type and and underscore to the front, it should work. Let me know!

Unfortunately, this mode didn't arrange them by type. Is it possible to modify the code to check each file in the raws folder and work off the tokens themselves?
IP: logged
 Re: TWBT Subtype Finder (v 1)  » posted by Dragoon209 on Oct 06, 2014, 08:28:03 pm
Rydel wrote:
Dragoon209 wrote:
Rydel wrote:
The tool only appears to read the default files, not additional files added by mods. What do I need to do to get it to use files from the mod as well?

The script assumes that files are named in a specific way, mainly "itemtype_modname. Txt"

So new items might be item_YourMod.txt.

If you add the item type and and underscore to the front, it should work. Let me know!

Unfortunately, this mode didn't arrange them by type. Is it possible to modify the code to check each file in the raws folder and work off the tokens themselves?

Could you please send me the raw files you are trying to use? I want to make sure that any fix I make is going to solve your problem! Thanks
IP: logged
 Re: TWBT Subtype Finder (v 1)  » posted by Rydel on Oct 06, 2014, 09:12:34 pm
Dragoon209 wrote:
Rydel wrote:
Dragoon209 wrote:
Rydel wrote:
The tool only appears to read the default files, not additional files added by mods. What do I need to do to get it to use files from the mod as well?

The script assumes that files are named in a specific way, mainly "itemtype_modname. Txt"

So new items might be item_YourMod.txt.

If you add the item type and and underscore to the front, it should work. Let me know!

Unfortunately, this mode didn't arrange them by type. Is it possible to modify the code to check each file in the raws folder and work off the tokens themselves?

Could you please send me the raw files you are trying to use? I want to make sure that any fix I make is going to solve your problem! Thanks

It's for Rise of the Mushroom Kingdom: http://dffd.wimbli.com/file.php?id=8801
IP: logged
 Re: TWBT Subtype Finder (v 1)  » posted by Dragoon209 on Oct 07, 2014, 02:06:39 pm
Rydel wrote:
It's for Rise of the Mushroom Kingdom: http://dffd.wimbli.com/file.php?id=8801


Rydel,

I can't seem to reproduce the problem, it seems to work for me. Can you give me any more specifics as to what is not coming over?

Just in case there is any confusion, the program spits out a file for each Itemtype, not per file it finds items in. So for example, when I look in the Weapons.txt file, It lists the contents of both the standard weapons, and the added weapons from the mod. It lists the files it parsed through at the top, in the order it read them.
Code:
item_weapon.txt item_weapon_mw.txt 0 [ITEM_WEAPON:ITEM_WEAPON_WHIP] 1 [ITEM_WEAPON:ITEM_WEAPON_AXE_BATTLE] 2 [ITEM_WEAPON:ITEM_WEAPON_HAMMER_WAR] 3 [ITEM_WEAPON:ITEM_WEAPON_SWORD_SHORT] 4 [ITEM_WEAPON:ITEM_WEAPON_SPEAR] 5 [ITEM_WEAPON:ITEM_WEAPON_MACE] 6 [ITEM_WEAPON:ITEM_WEAPON_CROSSBOW] 7 [ITEM_WEAPON:ITEM_WEAPON_PICK] 8 [ITEM_WEAPON:ITEM_WEAPON_BOW] 9 [ITEM_WEAPON:ITEM_WEAPON_BLOWGUN] 10 [ITEM_WEAPON:ITEM_WEAPON_PIKE] 11 [ITEM_WEAPON:ITEM_WEAPON_HALBERD] 12 [ITEM_WEAPON:ITEM_WEAPON_SWORD_2H] 13 [ITEM_WEAPON:ITEM_WEAPON_SWORD_LONG] 14 [ITEM_WEAPON:ITEM_WEAPON_MAUL] 15 [ITEM_WEAPON:ITEM_WEAPON_AXE_GREAT] 16 [ITEM_WEAPON:ITEM_WEAPON_DAGGER_LARGE] 17 [ITEM_WEAPON:ITEM_WEAPON_SCOURGE] 18 [ITEM_WEAPON:ITEM_WEAPON_FLAIL] 19 [ITEM_WEAPON:ITEM_WEAPON_MORNINGSTAR] 20 [ITEM_WEAPON:ITEM_WEAPON_SCIMITAR] 21 [ITEM_WEAPON:ITEM_WEAPON_AXE_TRAINING] 22 [ITEM_WEAPON:ITEM_WEAPON_SWORD_SHORT_TRAINING] 23 [ITEM_WEAPON:ITEM_WEAPON_SPEAR_TRAINING] 24 [ITEM_WEAPON:ITEM_WEAPON_HAMMER_MW] 25 [ITEM_WEAPON:ITEM_WEAPON_HAMMER_BIG_MW] 26 [ITEM_WEAPON:ITEM_WEAPON_HAMMER_ULTRA_MW] 27 [ITEM_WEAPON:ITEM_WEAPON_TRIDENT_MW] 28 [ITEM_WEAPON:ITEM_WEAPON_GLOVE_MW] 29 [ITEM_WEAPON:ITEM_WEAPON_CLAW_MW] 30 [ITEM_WEAPON:ITEM_WEAPON_CHOMP_MW] 31 [ITEM_WEAPON:ITEM_WEAPON_CHOMP_BIG_MW] 32 [ITEM_WEAPON:ITEM_WEAPON_FAN_MW] 33 [ITEM_WEAPON:ITEM_WEAPON_PARASOL_MW] 34 [ITEM_WEAPON:ITEM_WEAPON_PICK_SMALL_MW] 35 [ITEM_WEAPON:ITEM_WEAPON_AXE_SMALL_MW] 36 [ITEM_WEAPON:ITEM_WEAPON_PICK_BATTLE_MW] 37 [ITEM_WEAPON:ITEM_WEAPON_SHOOTER_MW] 38 [ITEM_WEAPON:ITEM_WEAPON_SLINGSHOT_MW] 39 [ITEM_WEAPON:ITEM_WEAPON_HAMMER_GLOVE_MW] 40 [ITEM_WEAPON:ITEM_WEAPON_CANNON_MW] 41 [ITEM_WEAPON:ITEM_WEAPON_FINGERSHOT_MW] 42 [ITEM_WEAPON:ITEM_WEAPON_RAYGUN_MW] 43 [ITEM_WEAPON:ITEM_WEAPON_SCEPTER_MAGIC_MW] 44 [ITEM_WEAPON:ITEM_WEAPON_ROD_STAR_MW] 45 [ITEM_WEAPON:ITEM_WEAPON_MALLET_BIG_MW] 46 [ITEM_WEAPON:ITEM_WEAPON_FAN_TRAINING_MW] 47 [ITEM_WEAPON:ITEM_WEAPON_PARASOL_TRAINING_MW] 48 [ITEM_WEAPON:ITEM_WEAPON_BAT_MW] 49 [ITEM_WEAPON:ITEM_WEAPON_SCIMITAR_MW] 50 [ITEM_WEAPON:ITEM_WEAPON_CLUB_SPIKED_MW] 51 [ITEM_WEAPON:ITEM_WEAPON_STAFF_MW]

You can see the Mushroom Kingdom weapons at the bottom of the list, starting at #24.

Does this help? Let me know!
IP: logged
 Re: TWBT Subtype Finder (v 1)  » posted by Rydel on Oct 07, 2014, 05:30:35 pm
Dragoon209 wrote:
I can't seem to reproduce the problem, it seems to work for me. Can you give me any more specifics as to what is not coming over?
-SNIP-
You can see the Mushroom Kingdom weapons at the bottom of the list, starting at #24.

Does this help? Let me know!

It looks like it works for Weapons, since they use that name format, but the other items don't appear to show up, such as tools or toys, since they are all together in an item_mw.txt file.
For instance, mw-FOOD.txt lists
Code:
0 [ITEM_FOOD:ITEM_FOOD_BISCUITS] 1 [ITEM_FOOD:ITEM_FOOD_STEW] 2 [ITEM_FOOD:ITEM_FOOD_ROAST]

but is missing ITEM_FOOD_CANDY_MW, ITEM_FOOD_COOKIE_MW, ITEM_FOOD_SOUP_MW, ITEM_FOOD_POP_MW, ITEM_FOOD_SALAD_MW, ITEM_FOOD_MEAL_MW, and ITEM_FOOD_CAKE_MW.
IP: logged
 Re: TWBT Subtype Finder (v 1)  » posted by Dragoon209 on Oct 08, 2014, 12:02:04 pm
Rydel,

While putting multiple item types in a single file works, I wouldn't recommend writing mods this way. I have written my program to follow the method dwarf fortress reads items from the raws. Its not based on the filename of the file, but by the first line of text inside the raw file. Furthermore, since Toady places items of different types into different files, I consider it good practice to follow his example, and do the same with mod files. This should help compatibility in the future should the way files are loaded ever change, and break this current implementation of the mod.

I have taken all of the items out of the item_mw.txt file, deleted that file, and separated them out into their own armor, helm, pants, etc. after doing that, I am able to run the export properly, and each item gets a subtype number.

I would be happy to give you the files if you like. Perhaps give me your name on the DF Forum, and I can PM you there?

Thanks

Edit: I found you on the forum, and went ahead and PM'd you the files. Hope they help!
comment last edited by Dragoon209 on Oct 08, 2014, 12:13:24 pm
IP: logged
 Re: TWBT Subtype Finder (v 1)  » posted by Rydel on Oct 08, 2014, 05:10:35 pm
Dragoon209 wrote:
Rydel,

While putting multiple item types in a single file works, I wouldn't recommend writing mods this way. I have written my program to follow the method dwarf fortress reads items from the raws. Its not based on the filename of the file, but by the first line of text inside the raw file. Furthermore, since Toady places items of different types into different files, I consider it good practice to follow his example, and do the same with mod files. This should help compatibility in the future should the way files are loaded ever change, and break this current implementation of the mod.

I have taken all of the items out of the item_mw.txt file, deleted that file, and separated them out into their own armor, helm, pants, etc. after doing that, I am able to run the export properly, and each item gets a subtype number.

I would be happy to give you the files if you like. Perhaps give me your name on the DF Forum, and I can PM you there?

Thanks

Edit: I found you on the forum, and went ahead and PM'd you the files. Hope they help!

Unfortunately, I am not the mod creator, so doing this would make my graphics set incompatible with anyone using the unedited mod, as it will change the subtype numbering.
HomeSearchRankingsStatisticsAboutContact

Website © 2020 FenriSoft. The core site script is PHCDownload (© 2005-2020).
Hosted by Linode.