Bay 12 Games Forum

Please login or register.

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

Author Topic: How to make a modification to Mining skill?  (Read 2347 times)

htabdoolb

  • Bay Watcher
    • View Profile
How to make a modification to Mining skill?
« on: August 17, 2011, 02:41:53 pm »

I'd like to make a slight change to how mining works in DF. At skills lower than legendary, dwarfs have a chance of destroying the stone/ore/gem they are mining through. I would like to change this, as it bugs the crap out of my slightly ocd self to think that I might let one precious gem or metal bar slip through my dwarves' stubby fingers. I'd like to keep the slower mining speed at lower skill levels(perhaps even decrease the speed further), but remove the chance for the resulting stone/gem/ore to be destroyed.

I've read through the modding page on the wiki, and also browsed through some of the threads here on the forums in order to try and find a way to do this. I have seen lots of information on changing creatures and materials, but virtually none on modding skills themselves. Can this be done, or are skills and how they function hard coded into the game?

The one thing that I saw that might work was changing dwarves so they have an innate legendary mining skill, but I'd rather not go that far.

Thanks for any help I might receive.
Logged

IT 000

  • Bay Watcher
  • Strange Mood
    • View Profile
Re: How to make a modification to Mining skill?
« Reply #1 on: August 17, 2011, 02:44:04 pm »

Not possible through modding.
Logged

***CORROSION v2.14***
<<<More Than Just Zombies>>>
Back from the Dead!

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: How to make a modification to Mining skill?
« Reply #2 on: August 17, 2011, 02:45:56 pm »

Not possible through modding.
Unfortunately this bit is hardcoded for now and can't be changed, as he says. Though I am curious what makes Cyan ore different, as IIRC you never destroy it when mining.
Logged

IT 000

  • Bay Watcher
  • Strange Mood
    • View Profile
Re: How to make a modification to Mining skill?
« Reply #3 on: August 17, 2011, 02:48:51 pm »

I'm pretty sure you still have a chance at destroying it. But legendary miners always get the thing that they're digging out.
Logged

***CORROSION v2.14***
<<<More Than Just Zombies>>>
Back from the Dead!

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: How to make a modification to Mining skill?
« Reply #4 on: August 17, 2011, 02:52:21 pm »

I'm pretty sure you still have a chance at destroying it. But legendary miners always get the thing that they're digging out.
Nay, read the wiki under "Veins and Mining" You'll always get a stone from it. Maybe that is tied to one of the tags in the raws? If so, you could try isolating which tag and duplicating it among all stones and ore and gems. You'd always get an item on mining that way.
Logged

IT 000

  • Bay Watcher
  • Strange Mood
    • View Profile
Re: How to make a modification to Mining skill?
« Reply #5 on: August 17, 2011, 02:58:32 pm »

Probably the DEEP_SPECIAL tag. It's the only possible variation. However this will make it replace adamantine (or visa versa)
Logged

***CORROSION v2.14***
<<<More Than Just Zombies>>>
Back from the Dead!

htabdoolb

  • Bay Watcher
    • View Profile
Re: How to make a modification to Mining skill?
« Reply #6 on: August 17, 2011, 02:59:08 pm »

I just looked at inorganic_stone_mineral.txt in the raws/objects folder, and cyan ore had [deep special] tag, and nothing else seems to have it. Might adding this to other minerals/gems/ore accomplish what I desire?

I'll try adding it to a few common mineral layers, then start a new map and see what happens when an untrained miners mines them.
Logged

IT 000

  • Bay Watcher
  • Strange Mood
    • View Profile
Re: How to make a modification to Mining skill?
« Reply #7 on: August 17, 2011, 03:00:41 pm »

It appears to have no effect on Layers, I slapped it on every stone layer in Corrosion. Additionally I'm pretty sure that civs won't bring said material to trade (that's why I slapped it on)
Logged

***CORROSION v2.14***
<<<More Than Just Zombies>>>
Back from the Dead!

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: How to make a modification to Mining skill?
« Reply #8 on: August 17, 2011, 03:04:06 pm »

This is just a theory based on very few facts, it may be a hardcoded behavior or may not be tied to the tags. Let us know what happens when you put it on the various stones.
Logged

htabdoolb

  • Bay Watcher
    • View Profile
Re: How to make a modification to Mining skill?
« Reply #9 on: August 17, 2011, 03:13:03 pm »

Ok, this looks promising so far. I added the [DEEP_SPECIAL] tag to a couple common layer minerals; diorite, granite, and marble. My untrained miners are leaving a stone for every square they mine out of those layers, but are leaving stones only about 10 - 20% of the time in veins and large and small clusters of minerals I left unchanged.

I'm going to dig down deep and check to see if the cyan ore is affected in any way.
Logged

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: How to make a modification to Mining skill?
« Reply #10 on: August 17, 2011, 03:14:51 pm »

Just be on the lookout for any other effects of using the tag.
Logged

htabdoolb

  • Bay Watcher
    • View Profile
Re: How to make a modification to Mining skill?
« Reply #11 on: August 17, 2011, 03:44:05 pm »

Interesting. Adding the [DEEP_SPECIAL] tag accomplished what I wanted, but it appears that there is a price. I revealed the map to take a look at the cyan ore formations. Several were normal, but two, however, were not. Instead of cyan ore, one was made of marble and the other diorite, which are two of the minerals I added [DEEP_SPECIAL] to.

It seems likely to me that whatever minerals have [DEEP_SPECIAL] will have a chance to replace cyan ore. The more minerals one adds [DEEP_SPECIAL] to, the less likely cyan ore will show up as normal.
« Last Edit: August 17, 2011, 03:49:01 pm by htabdoolb »
Logged

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: How to make a modification to Mining skill?
« Reply #12 on: August 17, 2011, 04:12:27 pm »

Well, duh, there are more materials to choose from. Most likely, for every vein normally associated with the cyan ore, a random [DEEP_SPECIAL] material is chosen.
You could also try giving dwarves high skill-learning rates with mining and/or natural mining skill.

Spoiler (click to show/hide)
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: How to make a modification to Mining skill?
« Reply #13 on: August 17, 2011, 04:23:12 pm »

Spoiler (click to show/hide)
Spoiler (click to show/hide)
Logged

htabdoolb

  • Bay Watcher
    • View Profile
Re: How to make a modification to Mining skill?
« Reply #14 on: August 17, 2011, 05:15:51 pm »

Alright, here is a bit more info. I tried adding [Deep special] to non-layer stone ores and some very weird things began to happen. The first thing I noticed on embarking in a new world was that some of the un-farmable stone tiles that are scattered across the surface layer were flashing rapidly. I put the cursor over one and saw that the description was flickering through all the different stone and soil types. The second thing I noticed was that all the layers of soil below the surface had been replace by generic "rough-hewn rock wall", which left "rock" stones behind when mined. This rock could be used to build workshops and constructions, but not turned into crafts or furniture. Each z-layer of rock seemed unique though, as they would show up separately in construction lists. There were also no trees on the map.

Things stayed strange when I dug deeper. Some of the ore veins and clusters had been replaced by  soil, and gold was showing up in small clusters instead of veins. The cyan ore formations had been replaced by random ores that I had added [deep special] to.

I think that I will try creating a world normally, embarking, them altering the save's raw files. That may give the stones, gems, and ores I want to preserve the 100% mining chance I desire without altering layer and vein formation during world creation.
Logged
Pages: [1] 2