Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: What does the ITEM_TOOL token DEFAULT_IMPROVEMENT accept?  (Read 1032 times)

Mr Crabman

  • Bay Watcher
  • A person with the head and pincers of a crab.
    • View Profile
What does the ITEM_TOOL token DEFAULT_IMPROVEMENT accept?
« 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:
Quote
- 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:
Code: [Select]
        <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?:
Code: [Select]
[DEFAULT_IMPROVEMENT:ART_IMAGE:HARD_MAT]
Or this?:
Code: [Select]
[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?

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: What does the ITEM_TOOL token DEFAULT_IMPROVEMENT accept?
« Reply #1 on: August 26, 2021, 12:20:00 pm »

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:
Quote
- 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:
Code: [Select]
        <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:
Code: [Select]
    <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]").
« Last Edit: August 26, 2021, 12:21:46 pm by Quietust »
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Mr Crabman

  • Bay Watcher
  • A person with the head and pincers of a crab.
    • View Profile
Re: What does the ITEM_TOOL token DEFAULT_IMPROVEMENT accept?
« Reply #2 on: August 26, 2021, 01:30:09 pm »

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?

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: What does the ITEM_TOOL token DEFAULT_IMPROVEMENT accept?
« Reply #3 on: August 26, 2021, 02:44:37 pm »

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.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Mr Crabman

  • Bay Watcher
  • A person with the head and pincers of a crab.
    • View Profile
Re: What does the ITEM_TOOL token DEFAULT_IMPROVEMENT accept?
« Reply #4 on: August 26, 2021, 03:39:47 pm »

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?
Code: [Select]
[DEFAULT_IMPROVEMENT:COVERED:HARD_MAT]
Or would it be:
Code: [Select]
[DEFAULT_IMPROVEMENT:COVERED:NONE:HARD_MAT]
Or would either work?

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: What does the ITEM_TOOL token DEFAULT_IMPROVEMENT accept?
« Reply #5 on: August 26, 2021, 05:25:44 pm »

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?
Code: [Select]
[DEFAULT_IMPROVEMENT:COVERED:HARD_MAT]
Or would it be:
Code: [Select]
[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).
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.