v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User:Fleeting Frames

From Dwarf Fortress Wiki
Revision as of 19:31, 28 May 2021 by Fleeting Frames (talk | contribs) (→‎Things I've worked on: itemage mentioned)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Things I've worked on[edit]

Can be divided into scripts, forts and designs.

Minecarts[edit]

Both scripts and designs.

Repeaters[edit]

5-tile 4-cart bumper[edit]

Both ramps are impulse ramps and thus need walls.

What to use it for? Well, if you plant four carts on it, you can get some of the most compact repeaters.
Furthermore, the length can be altered depending if you place carts newest to oldest or vice-versa (build order).

For example, 1199 (1200 with swapping 2 carts): 18-4-14-50, or if you will Ginkgo-Featherwood-Custard-Apple-Bloodthorn minecarts for the smallest day-long counter I know of yet. (tested)

A three-month example (for smoking sieges): 33-86-18-103 (Tested, newest to oldest from top to bottom: 1 side is 747 steps, other is 100053 steps.)

With low friction track stop on 2nd tile: 31-134-33-196, 1. and 3. can be done with almond and mangrove. Tested, with build order from newest to oldest it took 100803 steps; with oldest to newest it took 100797 steps.


I suspect this principle can be extended for smaller ones, perhaps possibly only 2-cart counter? Though with this there are both hundreds of possibilities and larger search space thanks to the generous 250000 subtile possibility space for exploring.


For a month-long (33600) toggler, the schema has to be expanded, as cart needs to pass over plate in a single step:

T r a c k R a m p s / B u i l d i n g s
S
^

S= Medium friction track stop.

Cart spends 29 steps in the secondary cycle, so it has to undershot a bit. Alas, it needs to come in with greater speed than what single ramp grants to stop near the bottommost ramp border; hence the small cycle and track stops.

Tested, with cart weights 19-88-30-79 in top to bottom older to newer it is exactly 33600 per cycle. 19 = rubber, 30 = pomegranate, 79 can be theoretically any weight from 76 to 80 (included).

As for priming the first hit, one can settle last 3 carts on tile edges by using ═▒▒instead of ╝═▒ at bottom at start, so the moment the weight 19 cart touches next cart it goes over. Then the weight 79 cart will take exactly ten steps on the three tiles before pressure plate after it is pushed over. Precise time for that can be arranged by utilizing deconstruct-toggled raised bridge holding it back.


Weight-adjustable two-cart repeaters[edit]

Idea is simple: A light cart delivers periodic impacts to heavy cart on a track stop, only moving a bit. Once the heavy cart goes over the tile, it does a small ring over a pressure plate and returns to start.

Simplest example:

^ S ¢

You'd open the hatch on start, place heavy cart on 'S'top and light cart on hatch. But the pit doesn't have to be just 2 ramps. Few useful options:

¢

NS ramps inside, the cart will deliver 4860 hits if the pit is dry or 4460 hits if filled with 2/7 water. Low impacts are useful for precision counting.

Also, since the cart enters from the side, you can lengthen the time between impacts pretty easily without affecting output.

Everything but northeast corner is ramp, total being being 301 step cycle delivering 29300 per hit. If you use NS ramp in center-north instead, it is 299 step cycle.

T r a c k R a m p
S

1z 24-step repeater in the east cycle with 9770 velocity westward impulse; good to use with medium track stop. The tricky bit is cart return though; as of now I don't have a suitable one (papaya hitting an olive cart that uses two T-ramps to send signal and return before papaya hits again has varying times from two days to much less.) Taking advantage of NW diagonal movement on bumped cart works for consistent cycle times, at least, but with using T-ramps to deliver impact and back via EW ramp onto corner it will alternate between going NW and going EW, which is harder to predict.


1-cart 1200 (1 day) step repeater[edit]
T r a c k s R a m p s / B u i l d i n g s
+ + + +
S

The S is medium track stop. If you use NS track ramp in the SE corner and replace wall it leaned on with a minecart, it will be hit with 32620 westward and 19560 northward on every day. Alternatively, you could place pressure plate on the ╝ east of track stop - cart will pass over it in 1 step, so this will toggle a bridge.

Of course, one could also easily rig 48 or 50-step repeater to 24/25 step counter, and possibly more compactly.

Simple powerless ternary counter[edit]
T r a c k R a m p s
z 1
¢ ¢
z 0

Based on Larix's ternary counter and spin memory. 1 Cart sits on the hatch, other one in one of the topmost ╔╗╚ tiles. Each time hatch opens, the cart on it starts cycling through the lower 3 ramps. When the hatch closes, it goes over, bumps other cart over the hatch, and sits 1 tile before it - unless it is right before the hatch, where it comes to rest on the hatch. Pretty easy to add 2n tiles lengthening the topmost-left half for 5,7,9,etc. counter. To only add a single tile, one could theoretically use sideways ramp before a corner that sends a cart to the side to come to rest on one tile earlier if it comes to rest on the sideways ramp.

Although I only listed the necessary walls to function, stray cats do not function inside while hatch is open.

Relaying from a signal from this is a bit troublesome, though - one could link ╚ to a door and ╗ to a floodgate so that both are only open simultaneously for a time when one cart is keeping the door open, thus preventing it from closing before floodgate opens.

Searcher[edit]

HTML 5-tile 4 cart exhaustive searcher for above: https://pastebin.com/Yfik6tF2

Outputs values equal and 1 lower (which happens if carts' build order is exactly aligned).

Can only expect relative accuracy (exact or off-by-as-much-as-six, depending on build order) for inelastic collisions. Since carts, notably the corner cart, can have remaining slow speed, this means using carts whose weight ratio is more than 2. On the other hand, looking only them is much faster.

Configs[edit]

Announcement Window[edit]

Lovely utility, but the defaults are not quite to my taste.

So here's a change.

Setup: Filters.txt & Filters.dat.


Scripts[edit]

Constructmultiz[edit]

An older lua script for helping placing irregularly-shaped constructions. Requires gui/indicator-screen, many changes could be made for improvements. Forum thread has shots and details.

Copystockpilelinks[edit]

A lua script that adds things in linked stockpile to minecart's desired items on linking.

cposchange[edit]

cposchange is a .lua script to run while loo'k'ing at cart for repeater testing.

With no arguments, it waits until cart moves off the tile, then pauses the game and tells you which cart moved. With cposchange flip it waits until the cart returns to the tile.

UnsuspendSelectedBuilding[edit]

UnsuspendSelectedBuilding.lua is a script that applies the idea of autounsuspend to single building selected;

giving an announcement on start, stop and completion; Intended to be used with keybinds such as keybinding add Alt-S@dwarfmode/QueryBuilding/Some UnsuspendSelectedBuilding

setwarning[edit]

setwarning.lua is a script for helping to save-scum migrants, caravans as well as catch other events (presently, gremlins and werebeasts, on account of not seeing any).

As I play more than once a season, I set it to simply run once in onMapLoad.init.

listexoticpreferences[edit]

lep.lua goes well with above, listing the names of all units who likes a whip, morningstar, longsword, two-handed sword, pike or great axe, for the purpose of weaponsmithing moods.

Usage is slightly eased by having a command like :lua dfhack.timeout(30, 'frames', function() if (#(dfhack.run_command_silent('lep'))<123) then dfhack.run_command('die') else print("Found mooddorf") df.global.pause_state = true end end) in onMapLoad.init, where 123 would be number 1 greater than the current length of lep's output.

listobituary[edit]

listobituary.lua - allows displaying and exporting csv of death dates. Requires gui/indicator-screen. Example image made using csv.

assigndeathdate[edit]

assigndeathdate.lua - allows assigning butchered deathdate to a unit who doesn't have death record. Will crash on save.

order_takeout[edit]

Companion script to buy_food_needs; allows ordering foods somebody wants to eat when diplomat asks what you want to order. (Doesn't work for ordering tree growths yet.)

selectSquads[edit]

A lua script to select individuals with metal weapon (or bolts, when passed R as parameter) in squad menu. Future changes tbc.

Bugfixing scripts[edit]

These scripts are intended to fix various bugs. To use these scripts save them as .lua files in hack/scripts/fix folder.

fix/wheelbarrow-stuckinside[edit]

wheelbarrow-stuckinside.lua is a script for solving Bug:6074 (Wheelbarrows accumulate items from incomplete hauling jobs).

Runs once, to use add this line of code to onMapLoad.init: repeat -time 1 -timeUnits days -command [ fix/wheelbarrow-stuckinside ] -name wheelbarrowstuckinside

fix/pathchain[edit]

pathchain.lua is a script for solving Bug:10564 (Pathing from chained or pitted animals causing lag and crashes).

Runs once, to use add this line of code to onLoad.init: repeat -time 1 -timeUnits days -command [ fix/pathchain ] -name pathchain

fix/militarygearclaims[edit]

militarygearclaims.lua is a script for behaviour like Bug:2749 or Bug:8833/Bug:9034 or when their claim on a previously-unforbidden or now-inaccessible item persists (unknown nr). For player convenience, doesn't remove specific gear assignments even when forbidden.

Military dwarves will go pick up their new gear whenever a new month comes, unless you prod them into changing active status earlier.

Unlike above, has many options, including removing forbidden items from inventory as well as just text output or targeting one unit.

Like above, it runs once, intended to use with repeat -time 1 -timeUnits days -command [ fix/militarygearclaims -textlessifempty ] -name militarygearclaims. Or could also use months instead of days.


Dwarfmonitor extensions[edit]

These are scripts that can use patching dfhack-config/dwarfmonitor.json and /hack/lua/plugins/dwarfmonitor.lua. They're tested in 43.03 only at present, though should likely work in other versions.

zoomToStop[edit]

zoomToStop.lua - A lua script to enable player to zoom to stop or cart of a hauling route.

It provides for this commands, keybindings and automatically patching dwarfmonitor for small image reminder: example screenshot.

Possible arguments are (no arguments), cart, bind, unbind, patch.

itemage[edit]

itemage.lua is a script that does two things:

1: Called with item selected or item id provided, it prints the item creation time and age.

2. Patched into dwarfmonitor, it'll display the age of items in loo'k' menu view, with ages called as items are selected.

Details of how to add inside link.

Script modifications[edit]

deathcause.rb - lists death date for more units

units.lua - allows sorting units by death date for sort-units

max-wave.lua - limits migrant wave size, now with counting residents.

librarian.lua - edited to convert int to bitfield so it can work in 43.03 (higher game versions should use PatrikLundell's original)

buy_food_needs.lua - now also buys food in trade caravan whose products are preferred to eat by somebody, to cover things like wheat flour

devel/inject-raws.lua - now also permits injecting colors.