Bay 12 Games Forum
Dwarf Fortress => DF Modding => Topic started by: Mr Crabman on August 25, 2021, 11:49:18 am
-
What does the ITEM_TOOL token DEFAULT_IMPROVEMENT accept? I've only seen it with [DEFAULT_IMPROVEMENT:SPECIFIC:ROLLERS:HARD_MAT], and the wiki describes it as:
- improvement type and subtype (latter only really applicable to SPECIFIC)
- tool material flag like HARD_MAT or SILK_MAT
Items that appear in the wild come standard with this kind of improvement. Used on scrolls: [DEFAULT_IMPROVEMENT:SPECIFIC:ROLLERS:HARD_MAT]
Currently bugged, the effect is also applied to everything made in-game. This causes scrolls to have two sets of rollers, for example.
But from this it's not clear what what improvement types there are other than SPECIFIC, and what other subtypes than ROLLERS are accepted.
This page here: https://github.com/DFHack/df-structures/blob/master/df.itemimprovements.xml
Seems to imply the only other accepted subtype other than ROLLERS is HANDLE, and the improvement types are:
<enum-item name="ART_IMAGE"/>
<enum-item name="COVERED"/>
<enum-item name="RINGS_HANGING"/>
<enum-item name="BANDS"/>
<enum-item name="SPIKES"/>
<enum-item name="ITEMSPECIFIC"/>
<enum-item name="THREAD"/>
<enum-item name="CLOTH"/>
<enum-item name="SEWN_IMAGE"/>
<enum-item name="PAGES"/>
<enum-item name="ILLUSTRATION"/>
<enum-item name="INSTRUMENT_PIECE"/>
<enum-item name="WRITING"/>
<enum-item name="IMAGE_SET"/>
But SPECIFIC is not shown here exactly, only ITEMSPECIFIC, so it's not 100% clear to me that this page is right. Are they correct that these are all the options, and is it meant to be SPECIFIC or ITEMSPECIFIC?
And if there is indeed no subtype for anything other than SPECIFIC, then should the others be used like this?:
[DEFAULT_IMPROVEMENT:ART_IMAGE:HARD_MAT]
Or this?:
[DEFAULT_IMPROVEMENT:ART_IMAGE:NONE:HARD_MAT]
Or would both work?
Finally, are there subtypes for the other improvements? And if so, what are they?
-
What does the ITEM_TOOL token DEFAULT_IMPROVEMENT accept? I've only seen it with [DEFAULT_IMPROVEMENT:SPECIFIC:ROLLERS:HARD_MAT], and the wiki describes it as:
- improvement type and subtype (latter only really applicable to SPECIFIC)
- tool material flag like HARD_MAT or SILK_MAT
Items that appear in the wild come standard with this kind of improvement. Used on scrolls: [DEFAULT_IMPROVEMENT:SPECIFIC:ROLLERS:HARD_MAT]
Currently bugged, the effect is also applied to everything made in-game. This causes scrolls to have two sets of rollers, for example.
But from this it's not clear what what improvement types there are other than SPECIFIC, and what other subtypes than ROLLERS are accepted.
This page here: https://github.com/DFHack/df-structures/blob/master/df.itemimprovements.xml
Seems to imply the only other accepted subtype other than ROLLERS is HANDLE, and the improvement types are:
<enum-item name="ART_IMAGE"/>
<enum-item name="COVERED"/>
<enum-item name="RINGS_HANGING"/>
<enum-item name="BANDS"/>
<enum-item name="SPIKES"/>
<enum-item name="ITEMSPECIFIC"/>
<enum-item name="THREAD"/>
<enum-item name="CLOTH"/>
<enum-item name="SEWN_IMAGE"/>
<enum-item name="PAGES"/>
<enum-item name="ILLUSTRATION"/>
<enum-item name="INSTRUMENT_PIECE"/>
<enum-item name="WRITING"/>
<enum-item name="IMAGE_SET"/>
But SPECIFIC is not shown here exactly, only ITEMSPECIFIC, so it's not 100% clear to me that this page is right. Are they correct that these are all the options, and is it meant to be SPECIFIC or ITEMSPECIFIC?
Apparently, "SPECIFIC" is a recently-added alias for "ITEMSPECIFIC". Its valid values are as follows:
<enum-type type-name='itemimprovement_specific_type'>
<enum-item name='HANDLE'/>
<enum-item name='ROLLERS'/>
</enum-type>
HANDLE is used internally for Buckets, and ROLLERS is apparently only used within custom reactions (i.e. MAKE_SCROLL, which uses "[IMPROVEMENT:100:scroll:SPECIFIC:ROLLERS:GET_MATERIAL_FROM_REAGENT:scroll rollers:NONE]").
-
I see; thank you.
Do you happen to know on whether those other improvement types (I assume those are all them?) have subtypes, or is it just SPECIFIC/ITEMSPECIFIC that has subtypes? And for when they lack a subtype, what the valid/accepted syntax would be?
-
I see; thank you.
Do you happen to know on whether those other improvement types (I assume those are all them?) have subtypes, or is it just SPECIFIC/ITEMSPECIFIC that has subtypes? And for when they lack a subtype, what the valid/accepted syntax would be?
So I just looked through a disassembly of itemdef_toolst::parse_raws(), and it appears to work as follows:
- With the types COVERED, RINGS_HANGING, BANDS, SPIKES, PAGES, or WRITING, there is no subtype, just a material specifier (which can be SHEET_MAT, SOFT_MAT, HARD_MAT, WOOD_MAT, METAL_MAT, MELEE_WEAPON_MAT, LEATHER_MAT, SILK_MAT, THREAD_PLANT_MAT, GLASS_MAT, CERAMIC_MAT, STONE_MAT, SHELL_MAT, or BONE_MAT).
- With the type [ITEM]SPECIFIC, you must specify a subtype of either HANDLE or ROLLERS, followed by a material specifier (as above).
- With INSTRUMENT_PIECE, I believe you need to specify a valid instrument piece type (which is typically going to come from dynamically-generated item definitions), followed by a material specifier (as above).
- All other improvement types (i.e. ART_IMAGE, THREAD, CLOTH, SEWN_IMAGE, ILLUSTRATION, and IMAGE_SET) are ignored.
-
So I just looked through a disassembly of itemdef_toolst::parse_raws(), and it appears to work as follows:
- With the types COVERED, RINGS_HANGING, BANDS, SPIKES, PAGES, or WRITING, there is no subtype, just a material specifier (which can be SHEET_MAT, SOFT_MAT, HARD_MAT, WOOD_MAT, METAL_MAT, MELEE_WEAPON_MAT, LEATHER_MAT, SILK_MAT, THREAD_PLANT_MAT, GLASS_MAT, CERAMIC_MAT, STONE_MAT, SHELL_MAT, or BONE_MAT).
Does this mean the syntax would be directly like this?
[DEFAULT_IMPROVEMENT:COVERED:HARD_MAT]
Or would it be:
[DEFAULT_IMPROVEMENT:COVERED:NONE:HARD_MAT]
Or would either work?
-
So I just looked through a disassembly of itemdef_toolst::parse_raws(), and it appears to work as follows:
- With the types COVERED, RINGS_HANGING, BANDS, SPIKES, PAGES, or WRITING, there is no subtype, just a material specifier (which can be SHEET_MAT, SOFT_MAT, HARD_MAT, WOOD_MAT, METAL_MAT, MELEE_WEAPON_MAT, LEATHER_MAT, SILK_MAT, THREAD_PLANT_MAT, GLASS_MAT, CERAMIC_MAT, STONE_MAT, SHELL_MAT, or BONE_MAT).
Does this mean the syntax would be directly like this?
[DEFAULT_IMPROVEMENT:COVERED:HARD_MAT]
Or would it be:
[DEFAULT_IMPROVEMENT:COVERED:NONE:HARD_MAT]
Or would either work?
It means the former - if you tried the latter, you'd get an error (or it'd just silently ignore the whole thing).