Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: A newbie thinking of making his first mod  (Read 699 times)

JellySoda

  • Escaped Lunatic
    • View Profile
A newbie thinking of making his first mod
« on: February 18, 2019, 11:53:08 pm »

Howdy folks.

I've been playing DF off and on for a little over half a year to a year now and I love every moment of it. Lately, I've had an idea for a mod that I would like to create, but sadly, I have not the slightest clue on how to create a mod.

I want to create a mod that adds watchmaking to the game. Done at a Watchmaker's workshop, a Watchmaker would be able to craft different types of mechanical watches out of various materials. The most basic materials would be something like copper or iron, and the watchmaker would have to first create metal gears before he can assemble the gears together with various metals to create a nice mechanical watch.

So a basic flowchart would simply be Ore -> Metal Bar -> Metal Gear/Cog for creating the gears needed for the watch to function. Then simply Metal Gear/Cog + Metal Bar -> Watch

These watches can of course be made with increasingly more expensive materials such as Gold or Platinum and can even be encrusted with gems to further add to their quality. I'm thinking it would be more immersive for there to be a requirement of a bit of leather for the final watch assembly, to simulate the watch's strap, if this is possible.

But yea, I really have no idea where to start. I had a look at the DFWiki's section in modding and I saw it's basically just editing a text file but at that point I basically got lost. If anyone can give me a nice start on what to do, I would appreciate it. Thanks.
Logged

Ulfarr

  • Bay Watcher
  • Going on a pilgrimage to Mars
    • View Profile
Re: A newbie thinking of making his first mod
« Reply #1 on: February 19, 2019, 12:25:11 pm »

Yep the wiki's guide is kind of unwieldy. But it does cover a LOT.

The mod you describe basically consists of 2 reactions, 2 new items and 1 new workshop which is pretty much doable once you familiarize yourself with the process. I would personally start with the reactions since they can dictate some of the tokens you might need to add to your items.

There is a good guide on reactions too ( if you haven't read that already) but I would try to give you a quick example on how one of your reactions (the one for gears) should be:

  [REACTION:WATCH_GEARS]  <- that's the reaction's id
     [NAME:make watch gears] <- what you see in game in the workshop

     [BUILDING:WATCHMAKER_WORKSHOP] <- This is the building's id not the in game name

     [REAGENT:A:150:BAR:NONE:NONE:NONE][METAL_ITEM_MATERIAL] <- reagents are your input material, you can use more than one reagent if necessary. Be mindful of the quantity.

     [PRODUCT:100:1:ITEM_TOY:WATCH_GEAR:GET_ITEM_DATA_FROM_REAGENT:A:NONE] <- Note I used ITEM_TOY. That's because I think what you want to make fit that category better than say tools or instruments, it also means when you define your new items they have to be define specifically as toys.

     [SKILL:WATCHMAKER] <- The skill that is used when performing said reaction. AFAIK you can't really make new skills (in this case "WATCHMAKER" is wrong) but you can use the already existing ones. Metalcrafting seems fitting to me.

Using the above as a template and changing the reagents/products accordingly you can make the reaction that creates your watches. All that's left is to make the items, the shop and then edit your entities so they can use them. Good luck on your modding.

Logged
Bring Kobold Kamp to LNP! graphics compatibility fix.

So the conclusion I'm getting here is that we use QSPs because dwarves can't pilot submarines.

JellySoda

  • Escaped Lunatic
    • View Profile
Re: A newbie thinking of making his first mod
« Reply #2 on: February 19, 2019, 01:25:11 pm »

I get the general jist of it, thanks for explaining some things I was unsure about. My only thing I can see that I dont really understand is what do the numbers after tags such as [REAGENT:A] and [PRODUCT] mean? Is it some sort of item ID kind of thing?
Logged

Ulfarr

  • Bay Watcher
  • Going on a pilgrimage to Mars
    • View Profile
Re: A newbie thinking of making his first mod
« Reply #3 on: February 19, 2019, 01:44:33 pm »

These are explained in more detail in the reaction guide, so you should really take a look at that too.

[REAGENT:A:150:.....] means that the reaction will consume 150 units of said reagent.

[PRODUCT:100:1:...] means that the reaction has  a 100% chance to produce 1 unit of that product.
[PRODUCT:80:2:...] means that the reaction has  a 80% chance to produce 2 units of that product.

How much is a "unit" depend on what exactly is the reagent/product. For bars '150 units" = 1 bar (as in 1 copper bar),  for other items, say axes: "150 units" = 150 axes. There is a list of how much a unit for each case in the guide.
Logged
Bring Kobold Kamp to LNP! graphics compatibility fix.

So the conclusion I'm getting here is that we use QSPs because dwarves can't pilot submarines.