Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Modding Dorf Skills  (Read 965 times)

PsychicKid

  • Bay Watcher
    • View Profile
Modding Dorf Skills
« on: April 05, 2012, 05:21:41 pm »

To keep this to the point since I am on my phone: My armorsmith was possessed, and I am upset that he won't get skyrocketed to legendary once he finishes his artifact. Is there anyway at all to modify his armorsmith skill to legendary, like with DFHack or raw tinkering or etc?

Thanks.
Logged

GavJ

  • Bay Watcher
    • View Profile
Re: Modding Dorf Skills
« Reply #1 on: April 05, 2012, 05:26:44 pm »

If you can find a utility that lets you modify unit .dat files, then yes.  But they are not in plaintext like RAWs are.  Such a utility may or may not exist.  I'm guessing that if it does, it is probably still super difficult to use, since units can come in all kinds of flavors and the format is not going to be very standard, probably.
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

NecroRebel

  • Bay Watcher
    • View Profile
Re: Modding Dorf Skills
« Reply #2 on: April 05, 2012, 06:35:44 pm »

Runesmith could swap that possession to another mood type, thus causing the skill up at the end, but unfortunately that tool hasn't been updated since version 31.25. You could also try adding [SKILL_LEARN_RATE:FORGE_ARMOR:66667] to dwarves to make them learn armorsmithing at 666.67x the normal rate. It would take the creation of 1 armor piece to get 20000 xp in that case. It may not stick after reverting the change, though; try it and see. Also, there's a possibility that skill rates are assigned as a 16-bit unsigned integer, which would mean that that value wouldn't work due to being over 65535 and thus causing an integer overflow. It's hard to tell without testing.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

PsychicKid

  • Bay Watcher
    • View Profile
Re: Modding Dorf Skills
« Reply #3 on: April 05, 2012, 07:37:50 pm »

Runesmith could swap that possession to another mood type, thus causing the skill up at the end, but unfortunately that tool hasn't been updated since version 31.25. You could also try adding [SKILL_LEARN_RATE:FORGE_ARMOR:66667] to dwarves to make them learn armorsmithing at 666.67x the normal rate. It would take the creation of 1 armor piece to get 20000 xp in that case. It may not stick after reverting the change, though; try it and see. Also, there's a possibility that skill rates are assigned as a 16-bit unsigned integer, which would mean that that value wouldn't work due to being over 65535 and thus causing an integer overflow. It's hard to tell without testing.

I'll try adding the SKILL_LEARN tag to Dorfs and see what happens. I likely can't test it tonight because I'm swamped with homework, but at the very least I'll come back to this thread and post results anyway. To avoid risking it being an unsigned 16-bit integer, I'll just change the number to 65535. Not quite a Legendary, but close enough in my opinion, hehe.

UPDATE: I actually had some spare time to try it... And nothing happened. I add [SKILL_LEARN_RATE:FORGE_ARMOR:65535] to creature_standard.txt under the Dwarf section right? Does it have to be in a specific area? He completed the artifact just fine, but did not get a super-skillup.
« Last Edit: April 05, 2012, 09:10:51 pm by PsychicKid »
Logged

NecroRebel

  • Bay Watcher
    • View Profile
Re: Modding Dorf Skills
« Reply #4 on: April 05, 2012, 10:02:10 pm »

UPDATE: I actually had some spare time to try it... And nothing happened. I add [SKILL_LEARN_RATE:FORGE_ARMOR:65535] to creature_standard.txt under the Dwarf section right? Does it have to be in a specific area? He completed the artifact just fine, but did not get a super-skillup.
Well, yeah, the workaround wasn't to make a possession mood give any levels, it was to make it so that armorsmithing jobs done outside of the mood give the same amount of xp as a fey mood would. Possessions give 0 xp; 0 times 666.67 is still 0. You have to have your smith do another job for the massive skill up.

The tag should be able to go anywhere under the dwarf entry, though putting it at the end just to be safe is rarely a problem.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

PsychicKid

  • Bay Watcher
    • View Profile
Re: Modding Dorf Skills
« Reply #5 on: April 06, 2012, 02:27:59 pm »

UPDATE: I actually had some spare time to try it... And nothing happened. I add [SKILL_LEARN_RATE:FORGE_ARMOR:65535] to creature_standard.txt under the Dwarf section right? Does it have to be in a specific area? He completed the artifact just fine, but did not get a super-skillup.
Well, yeah, the workaround wasn't to make a possession mood give any levels, it was to make it so that armorsmithing jobs done outside of the mood give the same amount of xp as a fey mood would. Possessions give 0 xp; 0 times 666.67 is still 0. You have to have your smith do another job for the massive skill up.

The tag should be able to go anywhere under the dwarf entry, though putting it at the end just to be safe is rarely a problem.

It still does nothing. He gains the skill up at the normal rate. Am I putting it in the wrong file? Could someone else test for me? Thanks.
Logged

GavJ

  • Bay Watcher
    • View Profile
Re: Modding Dorf Skills
« Reply #6 on: April 06, 2012, 02:29:39 pm »

are you adding it to the raw files in the main DF folder?  Or the raw files for your current save (which are partitioned off in the data folder under that particular save world, and its own raw folder)?

The main one only determines the default raws for future, as-yet-ungenerated worlds.
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

PsychicKid

  • Bay Watcher
    • View Profile
Re: Modding Dorf Skills
« Reply #7 on: April 06, 2012, 02:32:53 pm »

are you adding it to the raw files in the main DF folder?  Or the raw files for your current save (which are partitioned off in the data folder under that particular save world, and its own raw folder)?

The main one only determines the default raws for future, as-yet-ungenerated worlds.

I added it to the raw file of the current save.

Edit: No matter what number I put in, he always seems to gain only 300 EXP per copper armor completed.
« Last Edit: April 06, 2012, 02:52:26 pm by PsychicKid »
Logged