Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Modding Possibility  (Read 2139 times)

athenalras

  • Bay Watcher
    • View Profile
Modding Possibility
« on: December 13, 2013, 10:58:51 pm »

Hey guys!
I'm new to this forum. Normally, I'd search forums for answers to my modding but I haven't found any for these yet.

I want to make the names of civilizations and names of individuals to be names. I'd like them to be separate from the language_(race).txt

Like another person stated, larger sieges in larger numbers. I've modded in more entities and made them all season-round active. But they don't come in groups large enough to threaten my dwarves once I've equipped 2 squads with full steel.

As Meph has posted:
"Not by conventional means, but there are tricks to make a creature generate more creatures. For example you get sieged by 100 goblins, and they spawn 100 trolls, 200 war wolves and 50 ogres... they probably would act like wildlife and dont follow the siege AI, but would attack you. It would use syndrometrigger and spawnunit, two dfhack scripts.

Or, even better, make a goblin siege use the force script to spawn 2-3 moresieges of a goblin2 entity."

How do you make them spawn the 100 trolls, etc.? It's too vague and unhelpful.

Also, modding birthrate. The only thing I've found a little related to this is [LITTERSIZE:min:max]. Not exactly birthrate. My elves don't reproduce quick enough to survive all the wars I have in my world gens. (And I want the wars)

Please answer these modding questions experts.
Logged

athenalras

  • Bay Watcher
    • View Profile
Re: Modding Possibility
« Reply #1 on: December 13, 2013, 11:59:31 pm »

Also, I'd like to know if there's a way to add more variety to armor protection. For instance, as far as I know there are 4 'levels' of armor: 0, 1, 2, 3.
Is there any way to add in betweens?
« Last Edit: December 14, 2013, 12:49:24 am by athenalras »
Logged

Prudent Viper

  • Bay Watcher
  • Professional Unprofessional
    • View Profile
Re: Modding Possibility
« Reply #2 on: December 14, 2013, 12:56:58 pm »

The answer to your questions is modding. Modding, Modding, Modding. You can mod goblins to spawn trolls by giving them an interaction that does so, you can mod in your own armour and weapons. I suggest checking out the wiki's guide. These are not easy things to mod though, so be patient when you do it.

Modding DF is different to most games, it is either a very simple, logical affair, or impossible. There are few inbetweens.

Or you could download a mod, Masterwork is pretty good I hear, and has not only large, but tough and varied sieges.

Logged
*Tryrar fires Prudent Viper. Out of a cannon. Into the sun*

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Modding Possibility
« Reply #3 on: December 15, 2013, 04:41:34 pm »

It was vegue and short, because I was typing on a kindle.

It works like this: Every goblin gets a self-targetted interaction, (see the wiki on interactions), which triggers SyndromeTrigger (a script for dfhack, see dfhack readme), which triggers Spawnunit (another script for dfhack, see same readme). The goblins will appear on the map, run the interaction, which runs the script, which will spawn new creatures. The how and why you have to find out yourself, I dont think anyone has written it yet... its not difficult, but dfhack r4 is quite new. I have only done this with reactions, not interactions so far, otherwise I would have posted an example. The new creatures wont be armed or armored, thats why I said it would be better to use the force script to simply spawn more invasions on top of the first one.

For separate names, you can do them individually with a dfhack script which is included in the download (rename is the name, if I am not wrong). Its all mostly scripting with dfhack, not modding in the normal sense.

Birthrate cant be modded.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Prudent Viper

  • Bay Watcher
  • Professional Unprofessional
    • View Profile
Re: Modding Possibility
« Reply #4 on: December 15, 2013, 04:51:51 pm »

Birthrate can be modded. Removing the Multiple Litter Rare tag, will increase birthrate. Modding them to lay eggs allows you to also modify CLUTCH SIZE.

Or you could not use game breaking exploits like danger rooms. They're really not needed at all.
Logged
*Tryrar fires Prudent Viper. Out of a cannon. Into the sun*

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Modding Possibility
« Reply #5 on: December 15, 2013, 05:51:09 pm »

Thats not birthrate. What you mean is the amount of kids born. What the OP asked for is to raise the numbers of pregnancies, shorten the time of pregnancy, or make pregnancies appear more often. He already mentioned [LITTERSIZE:min:max]. 
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: Modding Possibility
« Reply #6 on: December 16, 2013, 07:19:30 am »

Isn't there a dfhack script that causes a creature to become pregnant?
Can you tie that script to an interaction?  Just throwing ideas out there.

athenalras

  • Bay Watcher
    • View Profile
Re: Modding Possibility
« Reply #7 on: December 16, 2013, 07:27:38 am »

It was vegue and short, because I was typing on a kindle.

It works like this: Every goblin gets a self-targetted interaction, (see the wiki on interactions), which triggers SyndromeTrigger (a script for dfhack, see dfhack readme), which triggers Spawnunit (another script for dfhack, see same readme). The goblins will appear on the map, run the interaction, which runs the script, which will spawn new creatures. The how and why you have to find out yourself, I dont think anyone has written it yet... its not difficult, but dfhack r4 is quite new. I have only done this with reactions, not interactions so far, otherwise I would have posted an example. The new creatures wont be armed or armored, thats why I said it would be better to use the force script to simply spawn more invasions on top of the first one.

For separate names, you can do them individually with a dfhack script which is included in the download (rename is the name, if I am not wrong). Its all mostly scripting with dfhack, not modding in the normal sense.

Birthrate cant be modded.

Sorry if I sounded aggressive when I said it was vague and unclear. Didn't mean no harm. Thanks for the suggestions though. Tried out force script, kinda got error messages. Made new topic about the error. Did some searching for solving the error before posting the topic.

That was a very courteous of you to respond to my thread. Thank you.
Logged

athenalras

  • Bay Watcher
    • View Profile
Re: Modding Possibility
« Reply #8 on: December 16, 2013, 07:33:43 am »

While I'm interested in the birthrate issue, I'm aware that it might be impossible since it might be hard-coded. (I see no creature tokens related to this issue)

About the naming issue, is it possible to make a separate file for specific names instead of drawing them out from the language file?
Also, I'm pretty sure that the randomized last names of spouses and heirs is hard-coded but I just want to be 100% sure. Is it possible to make immediate relatives share the same last name? (for the sake of world gen history)
Logged

athenalras

  • Bay Watcher
    • View Profile
Re: Modding Possibility
« Reply #9 on: December 16, 2013, 07:38:07 am »

Isn't there a dfhack script that causes a creature to become pregnant?
Can you tie that script to an interaction?  Just throwing ideas out there.

I'm pretty sure there might be but it's kinda useless for my intentions. My intentions are for world genning. More baddies if you get my drift.
(Though [LITTERMAX:min:max] does help a bit but makes it awkward to see a family tree kinda...productive.

But a horde of pregnant goblin invaders may prove to be interesting. Angry little green preggos.
Logged

Thundercraft

  • Bay Watcher
    • View Profile
Re: Modding Possibility
« Reply #10 on: December 17, 2013, 02:06:46 am »

[snip]...About the naming issue, is it possible to make a separate file for specific names instead of drawing them out from the language file?
Also, I'm pretty sure that the randomized last names of spouses and heirs is hard-coded but I just want to be 100% sure. Is it possible to make immediate relatives share the same last name? (for the sake of world gen history)

Actually... yes.

Check out the Dwarven Heritage Project, which is a Lua script for DFHack. The author, expwnent, says:

It works on both historical figures and the dwarves in the current fort.

Basically, it renames them to inherit the last names of their ancestors based on certain rules (instead of being completely random). Even so, a dwarf doesn't necessarily share a last name with a sibling, or even a parent. Instead of the traditional patriarchal surname inheritance most of us are familiar with, it uses it's own system. However, he did say that it could have been written to do names the traditional way and it would have made it a lot simpler. (He wanted to make it more interesting.)

Granted, it was released a while ago and - officially - it hasn't been updated in a while. However, in this post legendary+1 modder Putnam shares his update to fix it for r3, so it should work.

There is a catch, however. This script needs to be run whenever a child is born in order for it to name the new child. A bit tedious, right?

Perhaps a future release will allow it to do this automatically? ??? Recently, expwnent wrote:
I've written 95% of a plugin version of this script, which runs about 10 times faster, but it isn't finished and it could be a little while before I finally finalize it.

BTW: I had an idea to automate this and other scripts. Since SoundSense is already listening to gamelog.txt for logPatterns "(.+) has given birth to a" boy / girl / twins / triplets, I thought it would be very handy if it could call heritage.lua. It already has some limited DFHack functionality and zwei (the author) said doing this was possible. I think I'll remind zwei about this request...

EDIT:
I may not need to ask. After looking into the SoundSense files (r42), it looks like it already has the capability to call a DFHack plugin. In the "executor" folder of SoundSense there is an "executor.xml" file which, among other things, contains:

Code: [Select]
<executor logPattern="\*\* Loading Fortress \*\*" call="${baseDir}/dfhack-run soundsense" />
This calls the soundsense.lua script, which automatically changes the background season music to match the current season whenever DF loads a game.

When I start a new fortress I'll have to try out an experiment with something like this:

Code: [Select]
<executor logPattern="(.+) has given birth to a boy\." call="${baseDir}/dfhack-run heritage" />

<executor logPattern="(.+) has given birth to a girl\." call="${baseDir}/dfhack-run heritage" />

<executor logPattern="(.+) has given birth to ((twins)|(triplets))\." call="${baseDir}/dfhack-run heritage" />
« Last Edit: December 17, 2013, 02:41:48 am by Thundercraft »
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Modding Possibility
« Reply #11 on: December 18, 2013, 05:38:41 am »

The requirement to call the script each time someone is born was what stopped me from using it... Great idea with Soundsense, Thundercraft.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Modding Possibility
« Reply #12 on: December 18, 2013, 05:41:05 am »

The requirement to call the script each time someone is born was what stopped me from using it... Great idea with Soundsense, Thundercraft.

Especially since it's slow.

I think there was a c++ version in the works at some point?

fortydayweekend

  • Bay Watcher
    • View Profile
Re: Modding Possibility
« Reply #13 on: February 16, 2014, 03:22:03 pm »

The requirement to call the script each time someone is born was what stopped me from using it... Great idea with Soundsense, Thundercraft.

Especially since it's slow.

I think there was a c++ version in the works at some point?

Should Heritage still be working properly (with the updated code you posted in July)? I'm getting lots of zero-name or one-name dwarves, instead of the expected 2 names. They have the 2 dwarven names but the english translations for a lot of words are missing.

Is that something wrong with the script being out of date or something wrong with my setup/world/fort?
Logged
The Sea Lamprey bites the Miner in the lower left back teeth and the severed part sails off in an arc!