Bay 12 Games Forum

Please login or register.

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

Author Topic: What do I need to know about modding to do this stuff?  (Read 2171 times)

Marshall Burns

  • Bay Watcher
  • American Wizard
    • View Profile
    • Beyond the Wire Productions store
What do I need to know about modding to do this stuff?
« on: June 25, 2010, 03:10:17 pm »

Hi! I'm relatively new to DF, been playing it for about a week. I've been digging through the data files, and I've gathered that you can add materials, creatures, reactions, etc. to the game. I'm a hobby game designer in addition to a sucker for sim games, so that really made my eyes go big. Right away there's plenty of stuff I want to add.

I thought I'd come here and ask if it's feasible with the current version, and what I need to know about the tokens and such to do it. For instance, I'd like to know what each variable and argument is for. (I'm also a hobby programmer, so don't worry about having to dumb it down or anything).

What I'd like to do most is add chemistry, particularly acids, and a system of using them to derive elements from minerals. It'd be neat to use acids to make crafts (e.g. etching) as well.

I'm also interested in adding paper (and parchment, and papyrus) and inks, and having, say, a workshop where dwarves can write books of dwarven poetry and whatnot.

Also, gunpowder. How feasible is an arquebus? And siege engines work like buildings, right? So what about, say, organ guns or mortars?

Any help or information will be appreciated! Thanks!
-Marshall
Logged
By the way, I design table top RPGs and other games. You can buy some.

NRN_R_Sumo1

  • Bay Watcher
    • View Profile
Re: What do I need to know about modding to do this stuff?
« Reply #1 on: June 25, 2010, 05:25:35 pm »

for the guns, its quite impossible to do any sort of complex process like, pouring gunpowder in, gun cotton, ammo, cotton again.
due to the way ranged weapons work, shooting pre-made projectiles like modern bullets is just simply.. simpler, and doable.

Acids, I'd reccomend checking out Syndromes and Extracts.
etching would not be possible unless each etching was exactly the same. (Frosted glass for example) we simply cant add more arts yet.

if you wanted your dwarves to write stories, you should know that you cannot add new items to engrave things with, so inks wouldnt work unless you botched a workaround using something else.

but most of all the most important thing to know about modding these things, is that two out of three of these would have been answered using the "Search" function.
Logged
A dwarf is nothing but an alcohol powered beard.

afoninv

  • Bay Watcher
    • View Profile
Re: What do I need to know about modding to do this stuff?
« Reply #2 on: June 25, 2010, 05:28:00 pm »

Also, this.
Logged
-
V.

Shaostoul

  • Bay Watcher
  • Expanding your universe.
    • View Profile
    • Shaostoul Patreon
Re: What do I need to know about modding to do this stuff?
« Reply #3 on: June 25, 2010, 05:45:07 pm »

Alrighty... I'm going to say it here, just for whatever reason..

Real acid. No.
Real guns using any complex method. No
Smoke from guns being fired. No
Etching. No
A weapon called say... M16 firing something called 5.56 is possible. But it's lethality and "realism" would more or less be that of a crossbow. You can mod all kinds of factors, but end story, it's not a real bullet, it's going to fire as fast as a crossbow.
Real Ink, Paper, etc. No

You can make something "like it" but it won't really be it.
Logged
I mod games and educate others how to do so as well, if you'd like to learn join my Discord and you can join a bunch of like minded individuals. (Presently modding Space Engineers and No Man's Sky.)

Looking into modding DF? This forum guide & wiki guide may still be a good start!

Lord Urist

  • Bay Watcher
    • View Profile
Re: What do I need to know about modding to do this stuff?
« Reply #4 on: June 26, 2010, 02:07:34 am »

You can do paper and books, after a fashion.
It relys on creating books and paper as something else (say, toys or gems), then creating a building called something like 'library' where the dwarves will create books and read books. You then have to create a number of reactions for this new building, which the dwarves will then carry out. (So a reaction could be 'read book')

You can also do acid-bombs, which work by setting their melting and boiling points just slightly higher than the temperature of the underground (which is completely universal, everywhere). Then, you get hold of some of some rocks of 'acid', and put them where you want your trap to be. Then you run some magma underneath them (on the level below), or you could heat them up some other way, and they will melt, boil and vaporise. So now you've got some acid-rock-vapour hanging round. You also set it so that this rock is poisonous, and voila, you've got yourself a sort of acid trap, ready to poison any invaders, dwarves and nearby pets!

To link on from what others have said, it is completely impossible to create any form of stationary organ guns or the like, although you can abstract it a bit, and you can make a one-man, portable organ gun, which fires as Shaostoul said, with the example of an M16.

If you want to derive certain elements from rocks... you can set it to get metals out of rocks, by saying under the specific rock entry something like [METAL_ORE:GOLD:100], I think, which means you can smelt the rock to get gold, and have a 100% chance of getting some gold when you do this. Alternatively, a much longer method means you get almost anything from anything else by use of reactions, but can be very long-winded.

Having waffled on about all that, the df wiki is your friend!
http://df.magmawiki.com/index.php/Main_Page
Logged

Shaostoul

  • Bay Watcher
  • Expanding your universe.
    • View Profile
    • Shaostoul Patreon
Re: What do I need to know about modding to do this stuff?
« Reply #5 on: June 26, 2010, 03:05:39 am »

And it should be noted... on my guide, I have premade reactions and buildings and crap for near all vanilla base objects, I have also a huge list of products that I have at one point used myself.
Logged
I mod games and educate others how to do so as well, if you'd like to learn join my Discord and you can join a bunch of like minded individuals. (Presently modding Space Engineers and No Man's Sky.)

Looking into modding DF? This forum guide & wiki guide may still be a good start!

Marshall Burns

  • Bay Watcher
  • American Wizard
    • View Profile
    • Beyond the Wire Productions store
Re: What do I need to know about modding to do this stuff?
« Reply #6 on: June 26, 2010, 11:43:35 am »

I'll be reading Shaoustul's mod guide thread, but in the meantime, here's a post that I drafted up last night.

There's very little documentation, so I've been trying to deduce the syntax of the raw files. I'm hoping that all this has already been worked out, but let's start with the only building that you get to use as an example from the raws: the Soap Maker's shop.

[BUILDING_WORKSHOP:SOAP_MAKER]   
The first argument here clearly indicates that this object is a building, and what sort of building (a workshop). What other building types are possible? Does "BUILDING_SIEGE" make sense to the system? What about "BUILDING_CONSTRUCTION"? And so on? The second argument seems to be the string by which this building is identified for statements that need such an identifier, such as the reactions.

[NAME:Soap Maker's Workshop]
[NAME_COLOR:7:0:1]
These are obvious; the name given for this building, and the color that the name appears in.

[DIM:3:3]
Also obvious; the tile dimensions of the building.

[WORK_LOCATION:2:2]
This one took me a minute. It's the coordinates where a dwarf working in this workshop stands. I'm guessing it's relative to the top left corner?

[BUILD_LABOR:SOAP_MAKER]
This is the labor needed to construct the building, yes? As in, you must have a dwarf with "Soap maker" activated in his Pref->Labor menu.

[BUILD_KEY:CUSTOM_SHIFT_S]
The hotkey used for this building in the building menu. Apparently it parses that this building is a "WORKSHOP" and thus knows to put this hotkey in the Building->Workshop menu.

[BLOCK:1:0:0:0]
[BLOCK:2:0:0:0]
[BLOCK:3:0:0:0]
I got no clue here. Is this maybe the tiles in this workshop that obstruct dwarves?

[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]
I get this. This is the graphics used to represent this workshop in the varying stages of its construction. Although the color arguments have me confused. Why not just a simple RGB? I figured out that part of it is "background" color, and another part "foreground" color, but I'm not sure what's what because I don't know what the numbers mean. Also, there's 11 arguments, so there's at least a third factor involved here. The only thing I can think would be an alpha or gamma value, which would be nonsensical in this game (which, I'm guessing, is probably why the final arguments in these are always zero).

[BUILD_ITEM:1:BUCKET:NONE:NONE:NONE][EMPTY][CAN_USE_ARTIFACT]
The first bit, "BUILD_ITEM" means item requisite for building this.
 
The  "1" seems to be the amount of this item required.

The argument "BUCKET" seems to be the type of item. What values are valid for this argument? BUCKET, BAR, BLOCK, METAL_ORE, WOOD, BOULDER, and BARREL are all things I've seen in tags that seem to have this same syntax. What else works? WEAPON? AMMO? CRAFT? INSTRUMENT? Help me out here.

I don't yet have an understanding of the next three arguments, which are all null values here. I've been trying to piece them together from the tags in the reaction raws that seem to have the same syntax, but I haven't got a handle on it.
The [EMPTY] tag means that the bucket must be empty. I'm guessing this works for other containers that might be requisite for a building? For instance, BAG, BARREL, CHEST, or CABINET?

The [CAN_USE_ARTIFACT] clearly allows artifact buckets to be used for this purpose. Which I'm assuming is a good way to jack up your Wealth->Architecture, yes?

[BUILD_ITEM:1:NONE:NONE:NONE:NONE][BUILDMAT][WORTHLESS_STONE_ONLY][CAN_USE_ARTIFACT]
The fact that the  "item type" is null here -- that must mean that it doesn't matter whether it's a block, bar, metal ore, or boulder. In fact, it would appear that it wouldn't matter what it is *at all* if not for the [BUILDMAT] tag that clearly is to indicate that only building materials (blocks, bars, metal ores, and boulders) can be used. [WORTHLESS_STONE_ONLY] must be to prevent you from using economic stones.

(And we've been over [CAN_USE_ARTIFACT], but, I gotta ask: has anyone ended up with an artifact bar or block? Seems a bit anticlimactic for a dwarf to get possessed and make a block.)

After this, I've still got some questions about modding buildings. Like, what's the tag to require a fire-safe material, as with furnaces?


Now let's look at a reaction. Just to grab one, let's say:
[REACTION:BLACK_BRONZE_MAKING]
[NAME:make black bronze bars]
[BUILDING:SMELTER:NONE]
This indicates the building necessary to perform this reaction. The third bit, null here, is the hotkey for setting this task at the building.

[REAGENT:A:300:BAR:NO_SUBTYPE:METAL:COPPER]
[REAGENT:B:150:BAR:NO_SUBTYPE:METAL:SILVER]
[REAGENT:C:150:BAR:NO_SUBTYPE:METAL:GOLD]
These are the ingredients necessary. The ABC stuff is clearly to differentiate between reagents, because a specific reagent sometimes needs to be referenced (such as with the GET_MATERIAL_FROM_REAGENT thing).

The third bit seems to be the amount necessary. I've noticed that with most objects, this is in single units. With bars, it's a multiple of 150, and with thread it's like 15000. From this, I'm inferring that a bar is broken down into 150 reactive units, and thread into 15000. By this logic, this reaction uses two bars of copper, and one bar each of silver and gold. Am I right? If so, how far does this go? Can I make a reaction that uses only half of a bar by inputting "75" for that argument? Also, what happens to the rest of a partially-used bar? Does the game remember that it's only half a bar now?

The fourth argument is, again, item type. Again, I'm wondering what types are understood by the software. Does WEAPON work? CRAFT? What about, I dunno, BRACELET?

From there, the arguments seem to be about narrowing down the item. METAL indicates that this isn't just a bar, but a metal bar, then it goes further to specify which metals. As for "NO_SUBTYPE," I got no clue what to make of that because I couldn't find anything that had a different value for that argument, aside from "NONE." I'm guessing that NO_SUBTYPE is different from NONE in some way.

[PRODUCT:100:4:BAR:NO_SUBTYPE:METAL:BLACK_BRONZE][PRODUCT_DIMENSION:150]
This line indicates the product of this reaction. That second argument, "100," had me stumped for a while, but I think I've got it. It's the probability of this product being produced, yes? I know there is at least one reaction (smelting tetrahydrite) that has only a 20% chance of producing a given product, so it stands to reason that there must be a method for setting such probabilities. "4" is the number of this product yielded.

"PRODUCT_DIMENSION:150" had me stumped for a while, but that's just how the game knows that this product (a bar) has 150 reactive units, yes? And a standard thread product would have a dimension of 15000?

[FUEL]
[SKILL:SMELT]
These are obvious. This reaction requires fuel, and uses the smelting (or "furnace operating," right?) skill. What are the valid entries for the skill argument? For instance, is it "MECHANIC" or "MECHANICS"? Can I add skills? If so, what file do they need to be in?

Let's look at another reaction that's got something I don't get: steel making.
[REACTION:STEEL_MAKING]
[NAME:make steel bars]
[BUILDING:SMELTER:NONE]
[REAGENT:A:150:BAR:NO_SUBTYPE:METAL:IRON]
[REAGENT:B:150:BAR:NO_SUBTYPE:METAL:PIG_IRON]
[REAGENT:C:1:BOULDER:NO_SUBTYPE:NONE:NONE][REACTION_CLASS:FLUX]
I get it up through here. [REACTION_CLASS:FLUX] just means that this boulder has to be a flux stone. But it's got me wondering, what other reaction classes are there? I know there's gypsum. What else? Can I make my own? If so, where do they go?

[REAGENT:D:150:BAR:NO_SUBTYPE:COAL:NO_MATGLOSS]
Here's where it loses me. Now, I know that this isn't the same as the fuel tag below. Because, otherwise, this would be redundant. Also because my random knowledge database tells me that Iron Age steel was a variety of carbon steel made by layering strips of iron, coal, and strips of pig iron, then heating them and hammering & folding the crap out of them; this mixes the two metals all up together with the carbon from the coal, which (for some reason unknown to me because I'm not a metallurgist) makes the metal more flexible and way more durable. So that's not what confuses me. It's the "NO_MATGLOSS." "MAT" must be short for "material." I'm gathering that this means that it doesn't matter whether it's charcoal or coke, but why is it necessary to say "NO_MATGLOSS" instead of "NONE"? What am I missing?

[PRODUCT:100:2:BAR:NO_SUBTYPE:METAL:STEEL][PRODUCT_DIMENSION:150]
[FUEL]
[SKILL:SMELT]
This stuff I get, as I said.


Now, before I go any further with exploring the syntax, I want to make sure that I'm understanding all these correctly. Don't want to forge (bu-dum-splish) onward based on erroneous conclusions. So, clue me in, correct me, and so on and so forth.
Logged
By the way, I design table top RPGs and other games. You can buy some.

afoninv

  • Bay Watcher
    • View Profile
Re: What do I need to know about modding to do this stuff?
« Reply #7 on: June 26, 2010, 11:59:50 am »

Quote
The fourth argument is, again, item type. Again, I'm wondering what types are understood by the software. Does WEAPON work? CRAFT? What about, I dunno, BRACELET?
Item token, right. Same for reactions: 1st goes item token, 2nd is item subtype, 3rd is matgloss, 4th is matgloss subtype. Items are, obviously, made from material.
Here are item tokens:
http://df.magmawiki.com/index.php/Item_token (very incomplete) and
http://df.magmawiki.com/index.php/40d:Item_tokens (more or less complete for previous versions) for item tokens, and material tokens you'll be able to find on the wiki too =)

Quote
I get it up through here. [REACTION_CLASS:FLUX] just means that this boulder has to be a flux stone. But it's got me wondering, what other reaction classes are there? I know there's gypsum. What else? Can I make my own? If so, where do they go?
See e.g. inorganic_stone_mineral.txt , reaction class for matgloss is set there, for example. You can make your own reaction classes, but only for materials, not for items. E.g. stone, metal, or tissues like plant material or skin can have reaction class, but item types/subtypes - sword, toy, door - can not.

Almost everything else you've figured out is exactly true =) Excellent job!

Quote
What are the valid entries for the skill argument?
Shaostoul's guide has a list in this post.

Quote
Can I add skills?
No =(
« Last Edit: June 26, 2010, 12:22:34 pm by afoninv »
Logged
-
V.

Marshall Burns

  • Bay Watcher
  • American Wizard
    • View Profile
    • Beyond the Wire Productions store
Re: What do I need to know about modding to do this stuff?
« Reply #8 on: June 26, 2010, 12:51:55 pm »

Fantastic.

So, item subtype: what's an example? CRAFT:BRACELET, perhaps? WEAPON:SWORD? Like that?

Another quick question: can you add your own item types? I'd like an arquebus to have to be constructed out of several components that have to be made first; can I make up a GUNCOMP type or am I just going to have to classify the gun components as some other item?
Logged
By the way, I design table top RPGs and other games. You can buy some.

Emong

  • Bay Watcher
    • View Profile
Re: What do I need to know about modding to do this stuff?
« Reply #9 on: June 26, 2010, 12:54:20 pm »

Fantastic.

So, item subtype: what's an example? CRAFT:BRACELET, perhaps? WEAPON:SWORD? Like that?

Another quick question: can you add your own item types? I'd like an arquebus to have to be constructed out of several components that have to be made first; can I make up a GUNCOMP type or am I just going to have to classify the gun components as some other item?

Pretty much the only way to do it is to make them 'toys' that can only be produced via other reactions, then use those for the arquebus
Logged

afoninv

  • Bay Watcher
    • View Profile
Re: What do I need to know about modding to do this stuff?
« Reply #10 on: June 26, 2010, 12:58:38 pm »

Quote
So, item subtype: what's an example? CRAFT:BRACELET, perhaps? WEAPON:SWORD? Like that?
Right. On the second link to wiki you'll see something like this:
"ARMOR || Armor and clothing worn on the upper body. Subtypes come from item_armor."
It means subtypes are customizable via item_armor.txt

Types are hard-coded. Only some types have subtypes, this is hard-coded too. ALL subtypes are customizable. You can make ITEM_TOY:GUNCOMP thingie, for example.
« Last Edit: June 26, 2010, 01:06:40 pm by afoninv »
Logged
-
V.

Shaostoul

  • Bay Watcher
  • Expanding your universe.
    • View Profile
    • Shaostoul Patreon
Re: What do I need to know about modding to do this stuff?
« Reply #11 on: June 26, 2010, 01:34:51 pm »

I woke up not too long ago, so I'll start with something that appears relevant.

This is a working weapon reaction product.

[PRODUCT:100:1:WEAPON:ITEM_WEAPON_PICK:METAL:STEEL]

The way weapons see to be listed as well as many other things are in a similar syntax as ITEM_WEAPON_PICK.
Logged
I mod games and educate others how to do so as well, if you'd like to learn join my Discord and you can join a bunch of like minded individuals. (Presently modding Space Engineers and No Man's Sky.)

Looking into modding DF? This forum guide & wiki guide may still be a good start!

Marshall Burns

  • Bay Watcher
  • American Wizard
    • View Profile
    • Beyond the Wire Productions store
Re: What do I need to know about modding to do this stuff?
« Reply #12 on: June 28, 2010, 02:18:29 pm »

Ok, I've been reading around and experimenting, and I've come up with some more general questions.

What's the difference between the material state tokens POWDER and SOLID_POWDER?

The material state token ALL_SOLID -- I'm guessing this is a shorthand way to define the material's SOLID, POWDER, and SOLID_POWDER states all at once? Or is it just SOLID and SOLID_POWDER? That would seem to provide the reason for the presence of two different powder states.

I note that there's a PROSE skill. Is this actually used? Have I just not got far enough in the game to get to the point where it becomes relevant? What does it do?

If I make up a material using the material templates, does it become a valid argument for HAS_MATERIAL_REACTION_PRODUCT?

I note that there are breath attacks. Can these only be attributed to creatures, or can I apply them to weapons as well? In other words, can I make, say, a flamethrower?

What are the material tokens FILTH_B and FILTH_Y for? As a wild guess, I'd suppose B was blood, but I don't know what to make of Y.

There's a THROW skill but no thrown weapons that I can find. Anyone know how you go about defining a weapon as thrown?

Anybody know what the skill token is for tanning a hide? What about carving shell and horn? And armoring? And weaponsmithing?

Anybody know what units the temperatures are in?

To what objects can PREFSTRING be applied? Could a dwarf like swords for their sharpness, for instance? Or a saxophones for their sonorous timbre?

How do trade values work? I note that materials have a MATERIAL_VALUE which seems to indicate the value of the raw material. But once you make something out of it, the value goes up. What determines how much it goes up?

Thanks for your help, everyone!
Logged
By the way, I design table top RPGs and other games. You can buy some.

Emong

  • Bay Watcher
    • View Profile
Re: What do I need to know about modding to do this stuff?
« Reply #13 on: June 28, 2010, 02:36:29 pm »


I note that there's a PROSE skill. Is this actually used? Have I just not got far enough in the game to get to the point where it becomes relevant? What does it do?


PROSE is completely unused, as is NATURE_MAGIC (Or MAGIC_NATURE, I can never remember), ALCHEMY, CONCENTRATION, and maybe a few more I can't recall.

Oh, and tanning is TANNER, can't remember the rest off the top of my head.
Logged

Marshall Burns

  • Bay Watcher
  • American Wizard
    • View Profile
    • Beyond the Wire Productions store
Re: What do I need to know about modding to do this stuff?
« Reply #14 on: June 28, 2010, 02:44:49 pm »

I tried that and it threw an error.  I also tried TANNING, TAN, TANHIDE, and TAN_HIDE.
« Last Edit: June 28, 2010, 02:47:46 pm by Marshall Burns »
Logged
By the way, I design table top RPGs and other games. You can buy some.
Pages: [1] 2