Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Custom Workshops  (Read 882 times)

Ampersand

  • Bay Watcher
    • View Profile
Custom Workshops
« on: April 08, 2010, 03:00:36 am »

Below is the contents of building_custom.txt, defining the Soapmaker's Workshop

Code: [Select]
[OBJECT:BUILDING]

[BUILDING_WORKSHOP:SOAP_MAKER]
[NAME:Soap Maker's Workshop]
[NAME_COLOR:7:0:1]
[DIM:3:3]
[WORK_LOCATION:2:2]
[BUILD_LABOR:SOAP_MAKER]
[BUILD_KEY:CUSTOM_SHIFT_S]
[BLOCK:1:0:0:0]
[BLOCK:2:0:0:0]
[BLOCK:3:0:0:0]
[TILE:0:1:' ':' ':150]
[TILE:0:2:' ':' ':'/']
[TILE:0:3:'-':' ':' ']
[COLOR:0:1:0:0:0:0:0:0:6:0:0]
[COLOR:0:2:0:0:0:0:0:0:6:0:0]
[COLOR:0:3:6:0:0:0:0:0:0:0:0]
[TILE:1:1:' ':' ':'=']
[TILE:1:2:'-':' ':8]
[TILE:1:3:' ':' ':150]
[COLOR:1:1:0:0:0:0:0:0:6:0:0]
[COLOR:1:2:6:0:0:0:0:0:6:0:0]
[COLOR:1:3:0:0:0:0:0:0:6:0:0]
[TILE:2:1:'-':' ':8]
[TILE:2:2:' ':' ':8]
[TILE:2:3:' ':150:' ']
[COLOR:2:1:6:0:0:0:0:0:6:0:0]
[COLOR:2:2:0:0:0:0:0:0:6:0:0]
[COLOR:2:3:0:0:0:6:0:0:0:0:0]
[TILE:3:1:150:' ':8]
[TILE:3:2:' ':' ':8]
[TILE:3:3:' ':240:' ']
[COLOR:3:1:6:0:0:0:0:0:6:7:0]
[COLOR:3:2:0:0:0:0:0:0:6:7:0]
[COLOR:3:3:0:0:0:7:0:1:0:0:0]
[BUILD_ITEM:1:BUCKET:NONE:NONE:NONE][EMPTY][CAN_USE_ARTIFACT]
[BUILD_ITEM:1:NONE:NONE:NONE:NONE][BUILDMAT][WORTHLESS_STONE_ONLY][CAN_USE_ARTIFACT]

What can we glean from this text?

I'll address every Tag from top to bottom in order, and explain the ones I can make sense of.

[OBJECT:BUILDING] This tag is probably required at the start of every building. I haven't experimented with it, so I can't be certain of that.

[BUILDING_WORKSHOP:SOAP_MAKER]  Since only custom workshops are in at this point, Building_Workshop seems redundant. If the system is generalized to other types of buildings later, maybe it won't be. This tag is what the workshop is named in all other raw references, for permitted buildings in the creature raws for example.

[NAME:Soap Maker's Workshop] This is what is actually going to show up when you hit b in dwarf mode.

[NAME_COLOR:7:0:1] This is the color of the name as it is displayed in the building menu, and possibly after it's already been built, and you 'q' over it, or otherwise visit any menu that references it.  it uses the same method as creature colors, foreground:background:brightness

[DIM:3:3] This is an interesting one. In the development logs, he did mention being able to have workshop sizes other than 3x3, and this is the tag to do that. For obvious reasons having either dimension being 0 is impossible, but you can have a building of whatever size you want, within reason. I suspect extremely large sizes are not supported or would cause glitches. I haven't tried putting 500:500 in there, but if anyone wants to see what happens, be my guest.

[WORK_LOCATION:2:2] This defines where in the building the dwarf will stand to work. In this case, in the center

[BUILD_LABOR:SOAP_MAKER] The skill used by the building is defined here. You can't add new job or skill types right now, so you're always going to be refering back to an existent skill as defined under the PERMITTED_JOB tags in entity_default.

[BUILD_KEY:CUSTOM_SHIFT_S] This tag defines the button shortcut for selecting the building. This can be left blank, meaning that you have to use the secondary selectors in the menu to scroll over and highlight the building name to build it. Custom is presumably always required, but can be followed with any letter or Shift_any letter for the capital version, as the tags are always capitalized.

   [BLOCK:1:0:0:0]
   [BLOCK:2:0:0:0]
   [BLOCK:3:0:0:0]

Determines whether any tiles of the building are impassable once built.

[TILE] and [COLOR]: are closely related. First, I must explain why they are iterated three times. It merely shows the progress of the construction, starting at the first and ending at the last.

[TILE] defines the displayed tile at each block, appears to be able to take in characters surrounded by ' ' such as empty spaces or =, or can reference objects on the tileset you're using by number, without ' ' around them.

[COLOR] tags look complicated but aren't. Each line contains three instances of the color codes, foreground:background:brightness, for each tile the building is wide. The first number is not part of the color codes, but instead determines whether it's just been laid down,
  • construction is started [1], progressing [2] or finished [3]
[BUILD_ITEM:number of items:item type (if not stone):unknown:unknown:unknown]

(all three unknowns probably have something to do with quality, item material, and if an object like a rope, cloth, or thread, how much is required. Cannot be sure until experiments are done, or Toady tells all.)

[EMPTY] means the object cannot contain anything (like water in this case), presumably.

[CAN_USE_ARTIFACT] The bucket can be an artifact bucket.

[BUILDMAT] Restricts the item to building materials such as wood logs, raw stone, and blocks of wood, stone or metal

[WORTHLESS_STONE_ONLY] Only non-economic stones will be permitted for building this structure. I guess [CAN_USE_ARTIFACT] refers to blocks being used, if somehow a dwarf makes artifact stone blocks.

There may be more tags that are not in the Soapmaker's Workshop. Toady would need to inform us of that.

« Last Edit: April 08, 2010, 03:24:35 am by Ampersand »
Logged
!!&!!

Upright Path

  • Bay Watcher
    • View Profile
Re: Custom Workshops
« Reply #1 on: April 08, 2010, 03:09:25 am »

[BUILDING_WORKSHOP:SOAP_MAKER] -- Actually does not seem to be redundant. There is currently a 'BUILDING_FURNACE in the string dump. I haven't actually gotten around to testing it, but I believe that it places it in the furnaces 'tab' of the build screen.

For [BUILD_ITEM: ... ] it seems like anything that can be used as a REAGENT's tag can be used in that place. Probably including 'Lye'.

[BUILDMAT] seems to make it so that only items that can be used in construction, BARS, STONE, WOOD, BLOCKS can be used in that spot.

[BLOCK:...] Is used to determine which spaces in the construction are impassable.
Logged

Ampersand

  • Bay Watcher
    • View Profile
Re: Custom Workshops
« Reply #2 on: April 08, 2010, 03:18:27 am »

Thanks, edited for corrections.
Logged
!!&!!

Petr Ga

  • Bay Watcher
    • View Profile
Re: Custom Workshops
« Reply #3 on: April 08, 2010, 03:37:53 am »

i dont see what is product of that workshop...
Logged
2: Give RMs a gas syndrome that causes RMs only to breed profusely.

Ampersand

  • Bay Watcher
    • View Profile
Re: Custom Workshops
« Reply #4 on: April 08, 2010, 03:40:29 am »

Those are defined in reaction_other.txt
Code: [Select]
reaction_other

[OBJECT:REACTION]

[REACTION:TAN_A_HIDE]
[NAME:tan a hide]
[BUILDING:TANNER:CUSTOM_T]
[REAGENT:A:1:NONE:NONE:NONE:NONE][USE_BODY_COMPONENT][UNROTTEN]
[HAS_MATERIAL_REACTION_PRODUCT:TAN_MAT]

In the product, if you want to use the reagent's material itself, use NONE instead of a reaction product class (TAN_MAT in this example).

[PRODUCT:100:1:SKIN_TANNED:NONE:GET_MATERIAL_FROM_REAGENT:A:TAN_MAT]
[SKILL:TANNER]
[AUTOMATIC]

[REACTION:RENDER_FAT]
[NAME:render fat]
[BUILDING:KITCHEN:CUSTOM_R]
[REAGENT:A:1:GLOB:NONE:NONE:NONE][REACTION_CLASS:FAT][UNROTTEN]
[HAS_MATERIAL_REACTION_PRODUCT:RENDER_MAT]
[PRODUCT:100:1:GLOB:NONE:GET_MATERIAL_FROM_REAGENT:A:RENDER_MAT]
[SKILL:COOK]
[AUTOMATIC]

[REACTION:MAKE_SOAP]
[NAME:make soap]
[BUILDING:SOAP_MAKER:CUSTOM_S]
[REAGENT:A:1:BARREL:NONE:NONE:NONE][CONTAINS_LYE]
[REAGENT:B:1:GLOB:NONE:NONE:NONE][REACTION_CLASS:TALLOW][UNROTTEN]
[HAS_MATERIAL_REACTION_PRODUCT:SOAP_MAT]
[PRODUCT:100:1:GLOB:NONE:GET_MATERIAL_FROM_REAGENT:B:SOAP_MAT]
[SKILL:SOAP_MAKING]

[REACTION:MAKE_PEARLASH]
[NAME:make pearlash]
[BUILDING:KILN:CUSTOM_P]
[REAGENT:A:150:BAR:NONE:POTASH:NONE]
[PRODUCT:100:1:BAR:NONE:PEARLASH:NONE][PRODUCT_DIMENSION:150]
[FUEL]
[SKILL:SMELT]

[REACTION:MAKE_PLASTER_POWDER]
[NAME:make plaster powder]
[BUILDING:KILN:CUSTOM_SHIFT_P]
[REAGENT:A:1:BOULDER:NONE:NONE:NONE][REACTION_CLASS:GYPSUM]
[REAGENT:B:1:BOX:NONE:NONE:NONE][EMPTY][BAG][PRESERVE_REAGENT]
[PRODUCT:100:1:POWDER_MISC:NONE:INORGANIC:PLASTER][PRODUCT_DIMENSION:150][PRODUCT_TO_CONTAINER:B]
[FUEL]
[SKILL:SMELT]
Logged
!!&!!

Upright Path

  • Bay Watcher
    • View Profile
Re: Custom Workshops
« Reply #5 on: April 08, 2010, 03:50:53 am »

Only the Kiln, Smelter, Tanner, Kitchen and any buildings defined in a building_* in the raw are available for use in Reactions.

The building itself does not have any information about the reactions that it can use. That information goes in the Reaction itself.

Each reaction can have multiple buildings associated with it.

In the [BUILD_ITEM: ... ] tag the entries are the same as those of a [REAGENT: ... ] tag. Meaning that they are [BUILD_ITEM:<ITEM_TOKEN>:<ITEM_SUBTYPE>:<MATGLOSS_TOKEN>:<MATGLOSS_SUBTYPE>]. Typically, beyond the <ITEM_TOKEN>:<SUBTYPE> this doesn't seem to matter, since it's rare that you'd want to be so specific about the 'sort' of material needed for the building in question.

Of course, if you're doing something like an 'Acid Factory' you'd want to make sure the [BUILD_ITEM:BUCKET:NONE:METAL:NONE] sort of tag was used, if you want to make things 'make sense'.
Logged

Gorobay

  • Bay Watcher
    • View Profile
Re: Custom Workshops
« Reply #6 on: April 08, 2010, 05:35:50 am »

[OBJECT:BUILDING] This tag is probably required at the start of every building. I haven't experimented with it, so I can't be certain of that.
It is probably required at the start of every custom building file, just like other [OBJECT:<TOKEN>] lines in other files. You don't need it before each building, but you would need it if you split your custom building raws into two files.
Logged

Lancensis

  • Bay Watcher
    • View Profile
Re: Custom Workshops
« Reply #7 on: April 08, 2010, 10:41:48 am »

Presumebly there must be some sort of "firesafe" tag, to put on the build items?
Logged

Upright Path

  • Bay Watcher
    • View Profile
Re: Custom Workshops
« Reply #8 on: April 08, 2010, 10:44:49 am »

Look at http://df.magmawiki.com/index.php/Reactions#Reagent_Modifier. Any modifier tag available for use under the Reagents heading is available for use in buildings.
Logged

Erk

  • Bay Watcher
    • View Profile
Re: Custom Workshops
« Reply #9 on: April 08, 2010, 11:16:40 am »



[BUILD_LABOR:SOAP_MAKER] --> this is the labour the dwarf has to have enabled to build the workshop. The reactions determine what labour the dwarf has to have enabled to perform a particular action there.

[BUILD_ITEM:number of items:item type (if not stone):unknown:unknown:unknown] --> these relate to item subtypes and materials. For example, if you want your building to require copper large serated discs the tag would be:
[BUILD_ITEM:1:TRAPCOMP:ITEM_TRAPCOMP_LARGESERRATEDDISC:INORGANIC:COPPER]

If you just want an inorganic disc, you'd need only
[BUILD_ITEM:1:TRAPCOMP:ITEM_TRAPCOMP_LARGESERRATEDDISC:INORGANIC:NONE]

If any disc would be ok (eg wood)
[BUILD_ITEM:1:TRAPCOMP:ITEM_TRAPCOMP_LARGESERRATEDDISC:NONE:NONE]

If any trap component would be ok,
[BUILD_ITEM:1:TRAPCOMP:NONE:NONE:NONE]

And if any item at all would be ok (which can result in some weird things, like building a workshop out of sand or plump helmets or rat remains)
[BUILD_ITEM:1:NONE:NONE:NONE:NONE]
Logged
'River' cancels eat: Food is problematic.

Upright Path

  • Bay Watcher
    • View Profile
Re: Custom Workshops
« Reply #10 on: April 08, 2010, 11:24:19 am »

[BUILD_ITEM: ... ] Is a reagent that just missing the Identifier that's used for the product (The [REAGENT:A: ... ] used in [PRODUCT_TO_CONTAINER:A] tag). As such, any of the information that's valid inside ofhttp://df.magmawiki.com/index.php/Reactions#Reagents is valid here.

Logged