Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - nrh

Pages: [1]
1
DF Modding / Re: What's going on in your modding?
« on: November 25, 2021, 05:15:23 am »
Id almost say foward this to Toady, it could speed along things considerably for some aspects of the tavern arc, but id definitely use it if dwarves could be a bit more picky to choose their preference food for the job (unless somoene else brings it in? Im not sure)
It's not hard to change. Selecting best food from a list requires some more computations. I will make it an option later.

Very interesting, do dwarves drink out of owned mugs stored on tables too?

I experimented with giving a barrel of wine. Dwarves don't like it when their owned items are stored inside other items (not constructed buildings, like table, chest or cabinet). Most likely they would pick wine from a container and throw it on the floor of their room. Happens even if container is in the room already. And this goes as "store owned item" job, which is classified as "TidyUp" in raws.

Other problem is how to force dwarf to fill a mug if not for drinking. There is no separate job for that.

2
DF Modding / Re: What's going on in your modding?
« on: November 24, 2021, 11:11:57 am »
I found some interesting things about dwarves who own food:

1. If dwarf owns a prepared meal, he prioritizes eating it. Finally not some raw plump helmet!
2. Looks like if food owned by dwarf is stored on the table -- it does not rot. And dwarf doesn't try to throw it on the floor.

So I found how to create jobs in advfort.lua and made this experimental script based on it: https://github.com/Uvellibash/df-experiments/blob/main/hack/script/servant.lua

It counts private dining rooms and empty tables. Then it creates jobs to move prepared food on dining room tables, 1 meal per table.

If dining room is shared with spouse and has two tables -- 2 jobs are created.

Spoiler (click to show/hide)

To move things I use bringItemToDepot job-type. But instead of depot I pass coordinates of the table, and it just works. It also works with chests, maybe other buildings.

3
Not thoroughly tested. WIP. Make backup of your save before use!

Meaningful surnames might help you keep track of who is related to who.

This script reassigns surnames of all your alive fortress dwarves according to patrilineal or matrilineal inheritance rules.

For each dwarf it founds his greatest patrilineal/matrilineal line ancestor and copies his/her surname.

Optionally every dwarf  gets surname of her/his spouse.

It also modifies surnames for every ancestor in line, even if they are not present in your fort.

Example result for "surnames -patrilineal -inherit_parents -inherit_spouse":
Spoiler (click to show/hide)
In one fort I got two major clans with like ~20 dwarves in them.

Before doing anything you can also check number of descendants with common greatest ancestor using -list option.
Spoiler (click to show/hide)

Github link: https://github.com/Uvellibash/df-surnames
Script raw: https://raw.githubusercontent.com/Uvellibash/df-surnames/main/hack/scripts/surnames.lua

I only tested this script on Linux with dfhack 0.47.05-r1.

4
DF Modding / Re: What's going on in your modding?
« on: November 16, 2021, 04:18:22 pm »
I'm working on overhauling mayor elections using dfhack script. I'm inspired by "Crusader Kings".

What was made so far:
5 candidates are selected based on their social skills and lust for power value.
Each candidate picks one populist slogan based on most popular unfullfilled needs in fortress.
Candidates with stronger lust for power pick their slogan first (To somehow compensate their lower social skills).

Voter makes decision based on factors:
  • Candidate's social skills
  • Personal relations with candidate(friend, lover, grudge, father e.t.c.)
  • Absolute belief difference
  • If their unfullfilled needs are matching with candidate's slogan
  • If they share guild or religion with the candidate
My plan is to rig vanilla standard 17th Hematite elections by temporarily giving my winner candidate insane intimidation skill. So vanila game would make him mayor and handle other logic unknown to me.

Dfhack console test is under spoiler. Candidate list(left) and voter priorities(right)
Spoiler (click to show/hide)

Pages: [1]