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.

Topics - fortunawhisk

Pages: [1]
1
Utilities and 3rd Party Applications / Peace of mind scripts
« on: December 04, 2019, 10:53:06 pm »
Here are a few "peace of mind" scripts that I made to manage tasks in dwarf fortress.

Communal: Have everyone drink, eat, or take a nap at the same time. Useful if everyone is in the tavern, next to the favored drinks / meals...
Spoiler (click to show/hide)

NeedWatch: All dwarves have a need to frequently craft objects. This script enables a crafting labor when that need gets to be distracting and disables it when it's fulfilled.
Spoiler (click to show/hide)

JobToggle: I noticed that using an alert to force dwarves into the tavern interrupted jobs and created tons of job cancellation spam. This script allows you to save the current labor settings for all citizens, clear the labor settings so citizens can naturally get free time to satisfy needs, and then reload those saved labor profiles at some later point. Uses persist-table, so saved labor data is persistent across play sessions.
Spoiler (click to show/hide)

DFCron: Allows you to schedule scripts using dwarf fortress dates. Like the *nix cron, only far less capable. Somewhat useful if you want to schedule scripts (like those above) for specific days. Requires you to create a dfcron.txt file, see the "-example" output for an example.
Spoiler (click to show/hide)

2
Utilities and 3rd Party Applications / Monotheism script
« on: March 25, 2019, 08:54:03 pm »
A script to reduce the deities each dwarf worships down to one or set a single deity and preferred worship level across all dwarves. I had several dwarves that followed multiple gods, this script was made to fix the stress problems associated with unmet needs there. Script records the first god in the relationship and needs lists, removes all deities and their associated need,  then re-inserts the recorded deity and associated need.

Spoiler (click to show/hide)

3
Two scripts that helped me with testing socialization and relationships:

Watching relationship metrics:
http://www.bay12forums.com/smf/index.php?topic=171707.msg7835921#msg7835921

Removing relationships (not reversible):
Spoiler (click to show/hide)

A couple of notes from various tests and watching rank values here:
gui/gm-editor df.historical_figure.find(unit.hist_figure_id).info.relationships.list

1) Relations are formed the first time a unit is idle or socializing next to another unit*
2) When a relationship rank hits 15, a friendship or grudge is formed, depending on compatibility.
3) When the rank is around 40, if the units are friends and are romantically inclined, they become lovers. I've seen 31-42 so far, probably influenced by one or more personality facets.
4) When the rank hits 50, and the units are lovers, they can get married.
5) Talking to grudges can really spike a unit's stress level (700+ per day), depending on personality.
6) Socializing units can increase rank with busy adjacent units if they don't move. I tested pumpstacks, libraries, and temples.

* - It doesn't look like units socialize with same tile or diagonally adjacent units. Only N,S,E,W adjacent units show increases in rank.

I'm sure I'm skipping over or unaware of any number of subtleties here.
Edit - 20190327:
- Looks like I made a mistake in testing. It's not same square AND N,S,E,W. It's ONLY N,S,E,W adjacent tiles.
Edit - 20190328: The rank at which dwarves become lovers isn't static.
Edit - 20190401: Socialization can occur with same tile and diagonally adjacent units, but ONLY when there is a unit in a NSEW adjacent position. When that condition is met, socialization happens with every dwarf in a 3x3 grid centered on the socializing dwarf. Put another way: Socialization is a 1 tile omnidirectional interaction, but requires a unit in a NSEW adjacent tile to activate.

4
Utilities and 3rd Party Applications / Displayed Food Preferences
« on: July 09, 2018, 01:14:07 am »
I was looking at setting food preferences for my citizens and it looks like there is a difference between what the unit "Thoughts and Preferences" screen reports and what the unit actually prefers. So far, it only looks like this applies to preferences for eating butchered creature components(LikeFood/MEAT). For instance, the TaP screen will report something like "prefers to consume kaniwa beer and mandrill". If you look at the unit preferences directly (using gm-editor), it looks like the unit actually prefers something a bit more exotic: mandrill hearts. I always assumed that meant that any meal containing mandrill or any mandrill parts would generate a good thought, but it appears it does not. Only meals containing EXACTLY the preference item generate good thoughts. Has anyone run into this before?

Also, some science (44.10):
Units will get a "decent meal" thought for eating any food they have a preference for, no matter how diluted:
- Raw: 100%, Easy: 50%, Fine: 33%, Lavish: 25%
Units will not get a "decent meal" thought for eating foods they don't have a preference for, no matter how skillfully prepared.
The "decent meal" thought doesn't appear to depend on having tables, chairs, or a dining room available.
Units will seek out preferred (edible) raw ingredients over prepared meals with preferred ingredients.

Replication:
It's possible to check this at scale, using PatrikLundell's script from the post below:
Quote
http://www.bay12forums.com/smf/index.php?topic=164123.msg7670974#msg7670974

I just added a "print(material)" immediately below the "local material =" line. It's (generally) expected to output lines like:
<material 419:172 PLANT:MUSHROOM_HELMET_PLUMP:STRUCTURAL>
<material 29:728 CREATURE:SPIDER_MONKEY:LUNG>

Example Save:
http://dffd.bay12games.com/file.php?id=13876

Reported:
http://www.bay12games.com/dwarves/mantisbt/view.php?id=10828

Edit:
1 - Added Replication steps
2 - Updated subject and summary, Added save file link
3 - Added link to bug

5
Utilities and 3rd Party Applications / Script to restrain creatures
« on: December 07, 2016, 12:07:54 am »
A gui driven script that can create CageLargeCreature or ChainAnimal jobs for civilians. The jailer hunts the target and drags them off to the chain/cage.
Only works in Fort Mode. GUI mode only allows civilians, but the command line will allow you to use any unit id. I use cprobe and bprobe to get the creature/building id's.

Spoiler (click to show/hide)

Notes:
- Pretty similar to the existing justice system, except victims are restrained indefinitely.
- Units with an active justice sentence will be released.
- Cages or restraints must be made into a room and set to justice.
- Cages must be metal. Chain material doesn't appear to matter.
- Mothers will remove infants from chains/cages with Seek Infant.
- Most jobs are unavailable when on a chain, but...
-- Military will spar/train/watch & attend demonstrations
-- Social activities still work (tavern, library, temple)
-- Chained victims in a tavern get liquor delivered via barkeep
-- Chained victims will consume food/water if it is available.
-- Units can be thrown free of chains!
- Merchants can be chained, but not caged (they go crazy)
-- Interestingly, restrained non-violent crazy creatures will get food/water?
- Restrained merchants go crazy a bit after the caravan leaves.
-- This can be prevented by setting using gm-editor to set flags1.merchant to false.

Enjoy!

Edit:
Updated for 44.10

6
Utilities and 3rd Party Applications / Deliberate Fisticuffs
« on: March 24, 2015, 01:11:50 am »
A gui driven script that can create StartingFistFight or BeatCriminal jobs for civilians. The aggressor hunts the target and attacks.
Only works in Fort Mode. GUI mode only allows non-military civilians as aggressors, but the command line will allow you to use any unit id.

Spoiler (click to show/hide)

Notes:
- Fistfights generate a Disorderly Conduct crime.
- Beatings will generally continue until target dies.
- The victim can dodge but doesn't counterattack
- The number of FistFight attacks seem to be random
- It is possible to specify the same dwarf as aggressor and victim.
- Beating job stops when the aggressor gets tired, scared, or hurt.
- Beatings will be shortened if the victim has an active justice sentence

Enjoy!

Edit: Updated script to 1.3
1.3
Some style changes, now works with 44.10.

1.2
Can now choose between lethal and less lethal options.
Improved help text

1.1
Now generates new jobs each time (seems less crashy)
Possible targets list now includes all civilians, not just non-military.
Allows multiple aggressors
Improved gui options
Fancy command line options

Pages: [1]