i'd like to request a plugin or script that made armours and weapons wear down with use. i don't know how hard it would be or how reasonable it is to ask.
Removal of vanilla DF jobs from unmoddable buildings
- Possible: ?
- Good for total conversions that need to get rid of dwarven/medieval/fantasy things.
- Good for people that want to revamp complete industries, for example farming/food industry.
Addition of custom jobs to vanilla buildings
- Possible: ?
- This allows giving useless or barely used buildings more jobs.
- Fore example woodburner or ashery.
Triggering of sieges, megabeasts, titans, fbs or ambushes
- Possible: ?
- Helps boring forts that receive no outside threats.
Portal buildings. Enter building #1, worker is teleported to building #2
- Possible: ?
- Quickly travel across the map.
- Reinforcements for deep layers, like the circus.
- More tactics, ambush invasions yourself.
- Enter otherwise walled-off areas, without opening doors for enemies.
OusideOutside only buildings, like the windmill.
- Possible: ?
- For example special farms, or for total conversions using solar panels.
Power-dependent workshops, need power to run
- Possible: ?
- This allows more advances machines to be made.
- Finally draws more people to build machines/gears/axles.
Coat items with materials, which affect the wearer
- Possible: ?
- Good for magical/cursed armors.
- Allows more advances weapons, that add interactions to the wearer.
- For example molotov-cocktails, or a dwarven flamethrower.
- Allows advances crafting system, use special reagents for special items.
- For example fire imp-items give fireball, dragon-items give firebreath, GCS-items give poison immunity.
Creature creation
- Possible: ?
- Make new creatures in workshops. (Or other sources?)
- Should allow the creation of owned pets and/or new workers/civ-members.
- Currently only possible with an extreme workaround that spawns friendly or hostile creatures, no pets or civ members.
Slavery aka Change civ/race alignement
- Possible: ?
- Turn captured invaders into civ-members or pets.
- This would allow more uses of cage-trap captured invaders.
Adding wear to armor and weapons
- Possible: ?
- Items get worn out by use.
Targeting only worn clothing with a reaction
- Possible: ?
- Makes cleaning up worn clothing a lot easier
- Could be used for a "burn worn clothing" or "recycle thread from worn clothing" reaction.
Cavern Embark
- Possible: ?
- Wagon, pets and the 7 embark dwarves spawn in the first cavern instead of the surface.
Liquid generation by workshops
- Possible: ?
- Spawn water/magma on a nearby tile.
Magma Aquifer
- Possible: ?
- Assign a magma-source to an inorganic material.
- Should work like an aquifer, but spawn magma instead.
This is what i was talking about. Possible with scripting is not same as possible for mod usage. This again needs some system to call a script (with or without params) on some event.Triggering of sieges, megabeasts, titans, fbs or ambushes
- Possible: ?
- Helps boring forts that receive no outside threats.
Already possible with scripting. See http://www.bay12forums.com/smf/index.php?topic=91166.msg3934299#msg3934299
Plugin that makes any skill moodable.
Urist McCrazy looses a roaring laughter, fell and terrible!
Urist McCrazy has grabbed a *Sword*!
Urist McCrazy slashes Urist McBystander with his *Sword* and the severed part sails off in an arc!
Urist McBystander has been struck down!
Urist McCrazy has calmed down.
Urist McCrazy is now a legendary sworddwarf!
QuotePortal buildings. Enter building #1, worker is teleported to building #2
- Possible: ?
- Quickly travel across the map.
- Reinforcements for deep layers, like the circus.
- More tactics, ambush invasions yourself.
- Enter otherwise walled-off areas, without opening doors for enemies.
Shouldn't be too hard, actually.
QuoteOusideOutside only buildings, like the windmill.
- Possible: ?
- For example special farms, or for total conversions using solar panels.
Is it ok if it just deconstructs immediately if they try to build inside? If so, then it would be fairly straightforward.
But the game's pathfinder wouldn't use it, so either you'd have to do a custom pathfinding routine for every dwarf (and since you can't disable the game's pathfinding this could have an fps issue), or only allow the portals to be used for custom jobs that aren't handled by the game's job assignment where dfhack can control the unit exclusively.
It should be possible to detect if a tile is inside during placement, from tile_designation, so you'd be able to stop the player from placing the building inside in the first place I think?
or interpose building.isUnpowered()QuoteIt should be possible to detect if a tile is inside during placement, from tile_designation, so you'd be able to stop the player from placing the building inside in the first place I think?
Yeah, that should be doable. Of course, you'd also have to deal with the case that the outside stops being outside, but that should be doable also.
Already possible with scripting. See http://www.bay12forums.com/smf/index.php?topic=91166.msg3934299#msg3934299This is what i was talking about. Possible with scripting is not same as possible for mod usage. This again needs some system to call a script (with or without params) on some event.
As for the rest of it i'll try to give some implementation examples later (both for modders and dfhackers)
Portal buildings. Enter building #1, worker is teleported to building #2This one was intended for military purposes, I think adding it to the pathfinding of the game, so that haulers would use it, is way to tricky. I was mostly thinking of these deep curious underground structures, with the squads barely making it to the lower levels before turning around for a drink/meal. Or fighting in the third cavern/circus.
- Possible: YES
- Quickly travel across the map.
- Reinforcements for deep layers, like the circus.
- More tactics, ambush invasions yourself.
- Enter otherwise walled-off areas, without opening doors for enemies.
Cavern EmbarkA question about that one: How could we possibly give the player an option for this before he embarks ? It would run as soon as fortress mode starts, so I dont know how that could be implemented. Adding a dfhack option at the embark screen (the one in which you select dwarves, pets, items) and have a line of text saying: Cavern Embark: Yes/No, hotkey "c"... falconnes plugins come into mind, with the added commands and texts in the stockpiles.
- Possible: YES
- Teleport starting group into the caverns, then run revflood.
- Wagon, pets and the 7 embark dwarves spawn in the first cavern instead of the surface.
Coat items with materials, which affect the weareris in the first post. I guess your solution is the better one, directly making the item from the material. :)
Oh btw it's possible to edit veins (e.g. change material type (only to inorganic), add tiles to it, remove tiles, create new veins)Oh. The creature that changes tiles on its trail. Like Shai-Hulud from Dune.
@peregarrett: I dont think thats possible, or reasonably easy to do. I would know no way of modding or flags that would allow this, but better wait for warmist, expwnent, quietust or someone else more knowedgeable to answer.first one might not be possible (same race unit can't have different materials for it's body parts) might be wrong though...
@warmist: I actually cant think of an implementation of this in a mod. Changing veins would only result in getting either new gems, boulders or ore, which can all be done by conventional modding.
@warmist: the second one actually sounds cool. It would be nice to improve mining in the game, because as it stands its rather basic. Adding unmineable veins/layers... then having your miner dig near it, build a workshop "drill" or dwarven mining-something, to turn the material around it mineable.Warpstone imo is not fair- imagine training your miners for all that time only to loose to some freak random accident. In game design unavoidable and totally random discouragement is not used because it gives nothing good and takes away fun. That is either players will not mine "warpstone" having materials anymore in fear, or they will lose miners to it. There is no fun elements (e.g. what can i do to avoid, how to engineer it etc...).
"You struck granite"
Damn, granite is too hard to mine through...
Build dwarven mining station
Run reaction
"The granite has been softened"
Well, something like that ^^
I do have veins in the mod that make people dizzy, with rare gems inside that kill (warpstone) and I did have "deadly traps" in rubble that might kill your miner, and even undigable veins... but people really, really dislike all of this for some reason. The warpstone is turned off by many players, and the rest I removed because I got so much negative feedback about it. I dont mind undigable veins that make you explore more, but apparently people are used to easy mining.
Wait. When you say you can change materials of unmined inorganics.... does that mean you can essentially paint tiles and replace the tiles with something other inorganic? As in... painting a maze made of slade, with some candy inside ?
Another idea i just tested (and it worked). A way to assign jobs to non-main race. E.g. you construct golems, and you have your golem control center, that when it does reactions assigns golems (one per reaction or all in one go) a job from available jobs. That way you can have mixed race forts without buggy "friendship"Just WOW!
Small suggestion - a way to organize reactions in multiple choice trees. Like it is done for craftshop - rock\make rock crafts or forges - furniture\copper\forge copper barrel.need to write this down, it might be possible.
The plugin could watch the list of reactions available for selected workshop and manage the current level we're in.
for example, current kiln reactions could be renamed to "Clay\Make clay statue (pot, crafts, etc)" and "Glaze\Glaze clay statue (pot, crafts, etc)" which divides them into two groups - "Clay" and "Glaze".
For setting hotkey on each level you may define a dummy reaction for "Clay" or "Glaze" with no input, no output and no skill, with hotkey only.
Warmist, that is AWESOME. Seriously, that allows to buy your own designated workers, mining-only, farming-only... your dwarves could outsource some industries to other creatures. It works only on pets I assume?it works both on your units and not :) (thats what expwnent is using for digging invaders) of course i limit it only to my own units (further filtering is possible). Actually how it's works it's easier to do with non-designation works (i.e. everything in workshops, building constructions/buildings). And yes you could filter by race/caste/etc...
Ingame you would need a dwarf/pet to be transformend into this "worker pet" or you can embark with/order these "worker pets". But you cant create them out of thin air, because modders (at the moment at least) can only create hostile or friendly untis. Friendly units only stand around and do nothing.
A plugin that lists thoughts and how many dwarves have them. For example if I have "Complained about the lack of well x5", I know what the population wants from me. The most currently efficient method is to sort dwarves by ascending happiness and check the least happy citizens in-game.Seconded, that would be amazing
how about forcing megabeasts to arrive? or caravans... or sieges
sacrifice a dwarf and force a megabeast to descend upon your fortress
have a shop that "steals from a civ" and force a siege
how about making peace or war with other civs through reactions?
--the code itself was made by Quietust
--AFAIK, this should work, hehe.
--Syntax may just be shit :V
--Testing shows that you have to have the prerequisites for the megabeast attack. Sorry.
function force_megabeast()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Megabeast, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
force_megabeast()
Also allowed to have different type:how about forcing megabeasts to arrive? or caravans... or sieges
sacrifice a dwarf and force a megabeast to descend upon your fortress
have a shop that "steals from a civ" and force a siege
how about making peace or war with other civs through reactions?
Megabeast forcing can be done with this script:Code: [Select]--the code itself was made by Quietust
--AFAIK, this should work, hehe.
--Syntax may just be shit :V
--Testing shows that you have to have the prerequisites for the megabeast attack. Sorry.
function force_megabeast()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Megabeast, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
force_megabeast()
So, theoretically, we could just spam "force migrants" until we hit the pop cap in under a week game time, and then groan as the game keeps sending more waves anyway.
fix/*
Scripts in this subdirectory fix various bugs and issues, some of them obscure.
fix/dead-units
Removes uninteresting dead units from the unit list. Doesn't seem to give any noticeable performance gain, but migrants normally stop if the unit list grows to around 3000 units, and this script reduces it back.
fix/population-cap
Run this after every migrant wave to ensure your population cap is not exceeded. The issue with the cap is that it is compared to the population number reported by the last caravan, so once it drops below the cap, migrants continue to come until that number is updated again.
fix/stable-temp
Instantly sets the temperature of all free-lying items to be in equilibrium with the environment and stops temperature updates. In order to maintain this efficient state however, use tweak stable-temp and tweak fast-heat.
fix/item-occupancy
Diagnoses and fixes issues with nonexistant 'items occupying site', usually caused by autodump bugs or other hacking mishaps.
(on that note, if anyone manages to crack workshops that require power, compact logic gates would be a natural first step)Done by angavrilov in power meter plugin (a presureplate new mode that detects when mechanical power is applied)
Also allowed to have different type:Might need to set up entity for those entries that need it (civ attack/caravan/diplomat etc...) or other fields that are unknown.
- Caravan
- Migrants
- Diplomat
- CivAttack
- FeatureAttack - unused, does nothing
- Megabeast
- WildlifeCurious
- WildlifeMischievous
- WildlifeFlier
- NightCreature
-- Forces an event.
--Function codes all based on Quietust's code.
local EventType = ...
if EventType == "caravan" or EventType == "diplomat" or EventType == "siege" or EventType == "migrants" then
if dfhack.gui.getSelectedUnit().civ_id==nil then
qerror('Caravan, diplomat, migrants and siege require a civ unit to be highlighted.')
end
end
--code may be kind of bad below :V Putnam ain't experienced in lua...
if EventType ~= "caravan" and EventType ~= "migrants" and EventType ~= "diplomat" and EventType ~= "megabeast" and EventType ~= "curiousbeast" and EventType ~= "mischievousbeast" and EventType ~= "mischeviousbeast" and EventType ~= "flier" and EventType ~= "siege" and EventType ~= "nightcreature" then
qerror('Invalid argument. Valid arguments are caravan, migrants, diplomat, megabeast, curiousbeast, mischievousbeast, flier, siege and nightcreature.')
end
function force_megabeast()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Megabeast, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
function force_migrants()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Migrants, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end
function force_caravan()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Caravan, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end
function force_diplomat()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Diplomat, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end
function force_curious()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.WildlifeCurious, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
function force_mischievous()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.WildlifeMichievous, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
function force_flier()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.WildlifeFlier, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
function force_siege()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.CivAttack, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end
function force_nightcreature()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.NightCreature, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
--this code may be bad too :V
if EventType=="caravan" then force_caravan()
elseif EventType=="migrants" then force_migrants()
elseif EventType=="diplomat" then force_diplomat()
elseif EventType=="megabeast" then force_megabeast()
elseif EventType=="curiousbeast" then force_curious()
elseif EventType=="mischievousbeast" or EventType=="mischeviousbeast" then force_mischievous()
elseif EventType=="flier" then force_flier()
elseif EventType=="siege" then force_siege()
elseif EventType=="nightcreature" then force_nightcreature()
end
<...>Quickly glancing over it looks okay. Although we really need to make some lua/dfhack tutorials (lua is a strange language, and most of the stuff can be done very simply by (ab)using tables).
Can dfhack affect pathfinding in any way?Not really. We could mark to recalc the pathfinding (i think, but that happens every time you lock doors). And maybe paint connected path areas (that is quite useless)
Something to order dwarves to specifically build/dig from a particular direction would be massively useful. No more collapsing the floor they're standing on, no more walling themselves in, no more "creature occupying site" because they're standing where they're trying to build something.
Speaking of pathfinding; I know this may seem rather pointless at first glance, but could there be a DFHack plugin that can draw on screen the shortest path between 2 points? Or something of the sort?Can dfhack affect pathfinding in any way?Not really. We could mark to recalc the pathfinding (i think, but that happens every time you lock doors). And maybe paint connected path areas (that is quite useless)
Something to order dwarves to specifically build/dig from a particular direction would be massively useful. No more collapsing the floor they're standing on, no more walling themselves in, no more "creature occupying site" because they're standing where they're trying to build something.
the ability to initiate "some migrants have arrived"
Are there any coordinate values that can be used to teleport a unit? Or perhaps force a unit to load in your map from anywhere in the world?well you can warp units base on their position, just that's separate from forcing a unit to load on to your map... hmm might test out the unit spawner to see if copying a unit data can be done.
Any way to detect a creature's body size?
Also allowed to have different type:Might need to set up entity for those entries that need it (civ attack/caravan/diplomat etc...) or other fields that are unknown.
- Caravan
- Migrants
- Diplomat
- CivAttack
- FeatureAttack - unused, does nothing
- Megabeast
- WildlifeCurious
- WildlifeMischievous
- WildlifeFlier
- NightCreature
Aha! Fixed that issue. Here's the script (preferably "force.lua" or "forceevent.lua":Code: [Select]-- Forces an event.
--Function codes all based on Quietust's code.
local EventType = ...
if EventType == "caravan" or EventType == "diplomat" or EventType == "siege" or EventType == "migrants" then
if dfhack.gui.getSelectedUnit().civ_id==nil then
qerror('Caravan, diplomat, migrants and siege require a civ unit to be highlighted.')
end
end
--code may be kind of bad below :V Putnam ain't experienced in lua...
if EventType ~= "caravan" and EventType ~= "migrants" and EventType ~= "diplomat" and EventType ~= "megabeast" and EventType ~= "curiousbeast" and EventType ~= "mischievousbeast" and EventType ~= "mischeviousbeast" and EventType ~= "flier" and EventType ~= "siege" and EventType ~= "nightcreature" then
qerror('Invalid argument. Valid arguments are caravan, migrants, diplomat, megabeast, curiousbeast, mischievousbeast, flier, siege and nightcreature.')
end
function force_megabeast()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Megabeast, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
function force_migrants()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Migrants, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end
function force_caravan()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Caravan, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end
function force_diplomat()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Diplomat, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end
function force_curious()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.WildlifeCurious, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
function force_mischievous()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.WildlifeMichievous, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
function force_flier()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.WildlifeFlier, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
function force_siege()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.CivAttack, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end
function force_nightcreature()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.NightCreature, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end
--this code may be bad too :V
if EventType=="caravan" then force_caravan()
elseif EventType=="migrants" then force_migrants()
elseif EventType=="diplomat" then force_diplomat()
elseif EventType=="megabeast" then force_megabeast()
elseif EventType=="curiousbeast" then force_curious()
elseif EventType=="mischievousbeast" or EventType=="mischeviousbeast" then force_mischievous()
elseif EventType=="flier" then force_flier()
elseif EventType=="siege" then force_siege()
elseif EventType=="nightcreature" then force_nightcreature()
end
A plugin to export the description text of item/engraving/creature you're watching, is it posible?I think expwnent was working on something very similar.
I don't quite like asking for something instead of making it myself, but I'd like for interactions/syndromes to be able to run scripts/plugins directly instead of relying on boiling stones.
-- in-game use only
--Teleports the creature straight up some or to a selected position, depending on the game mode
--relies on plugin that doesn't exist yet, this is here mostly because I like writing code :V
--targets represent what I would like these to be selected with :V
--local target = CONTEXT_CREATURE
--local targetLocation = CONTEXT_LOCATION
--0 is dorf mode
if gamemode==0 then
local tileSize = {dfhack.maps.getTileSize()}
local teleportToZ = (tileSize[3])-1
target.pos.z = teleportToZ
end
--1 is adventure mode
if gamemode==1 then
local target.pos = targetLocation
end
I just thought that thieves went for the nearest target availableIf I remember correctly, from other exploits and trappings and etc. I read on the boards, some creatures and ambushes/sieges usually home in towards the most valuable item (where some people placed artifacts behind a giant cave spider they tamed, to also farm in on giant cave spider silk, and such). I checked the values of the items that were crashing my game, and the minecart was among the most valuable of the lot a kea could steal from me out in the open.
...
I just thought up another one: Death-Note
Highlight the character you want to kill, and it'll markup the heart or most-valuable organ of the creature as non-existant, or destroyed/broken, thereby killing the creature immediately.
What about impact velocity? Directional, and straight downward could be options. Have them hit the ground (even when walking on the ground already) at terminal velocity. Set motion speed, and toggle the impact flag (if there is such a thing), and now you have blood fireworks. Would work even on flying creatures (explode them in mid-air).Heh, this actually could work.
A plugin that periodically (say once per a 100 frames) checks what a dwarf's "stated job" is (walking to a workshop and gathering materials counts) and records a counter during the game session. It would give the ability to print statistics, for example what percent of time a dwarf spent doing what job, but what I'm most interested in is idlers. I can just go to the U screen, but for some things it would be useful to see who was idling the most lately. You could also get statistics on soldiers sparring, doing demonstrations, etc.
Coat items with materials, which affect the wearer
- Possible: ?
- Good for magical/cursed armors.
- Allows more advances weapons, that add interactions to the wearer.
- For example molotov-cocktails, or a dwarven flamethrower.
- Allows advances crafting system, use special reagents for special items.
- For example fire imp-items give fireball, dragon-items give firebreath, GCS-items give poison immunity.
Something to fix the caverns in adventure mode so you can actually encounter creatures in them
-- Allows instant transmission.
math.randomseed(dfhack.getTickCount())
if df.global.gamemode~=1 then
qerror("Adventure mode only (for now). Sorry!")
end
function getTileType(x,y,z)
local block = dfhack.maps.getTileBlock(x,y,z)
if block then
return block.tiletype[x%16][y%16]
else
return 0
end
end
function getPowerLevel(unit)
local speed = 1000/dfhack.units.computeMovementSpeed(unit)
local strength = unit.body.physical_attrs.STRENGTH.value/3550
local endurance = unit.body.physical_attrs.ENDURANCE.value/1000
local toughness = unit.body.physical_attrs.TOUGHNESS.value/2250
local spatialsense = unit.status.current_soul.mental_attrs.SPATIAL_SENSE.value/1500
local kinestheticsense = unit.status.current_soul.mental_attrs.KINESTHETIC_SENSE.value/1000
local willpower = unit.status.current_soul.mental_attrs.WILLPOWER.value/1000
local bodysize = (unit.body.blood_count/100)^2
local powerlevel = bodysize*speed*((strength*endurance*toughness*spatialsense*kinestheticsense*willpower)^(1/6))
return powerlevel
end
function getSubjectPronoun(unit)
local sex = unit.status.current_soul.sex
if sex == 1 then return "he"
elseif sex == 0 then return "she"
else return "it"
end
end
function getObjectPronoun(unit)
local sex = unit.status.current_soul.sex
if sex == 1 then return "him"
elseif sex == 0 then return "her"
else return "it"
end
end
function getPowerLevelComparison(unit1,unit2)
local randomnumber = math.random(2)
local subjectPronoun = getSubjectPronoun(unit2)
local objectPronoun = getObjectPronoun(unit2)
local comparison = getPowerLevel(unit2)/getPowerLevel(unit1)
if comparison < .8 then
if comparison < .1 then
if randomnumber == 1 then return "Hmm, " .. subjectPronoun .. "'s not very powerful..."
else return "Ha, " .. subjectPronoun .. "'s so weak!" end
elseif randomnumber==1 then return "I can definitely take " .. objectPronoun .. "."
else return "Eh, " .. subjectPronoun .. " shouldn't be too difficult to beat." end
elseif comparison >= .8 and comparison <= 1.2 then
if comparison == 1 then return "Huh. Identical power levels? Either this is me or this is weird."
else return "I'm about as strong as " .. objectPronoun .. "." end
elseif comparison > 1.2 and comparison <= 10 then return "Okay, " .. subjectPronoun .. "'s a bit stronger than I am!"
elseif comparison > 10 and comparison <= 100 then return "Oh man, " .. subjectPronoun .. "'s a lot stronger than me! I hope my skill can prevail."
elseif comparison > 100 and comparison <= 10000 then return "Okay, I do NOT want to fight that!"
elseif comparison > 10000 and comparison <= 1000000 then return "No way can I win against a foe like that!"
else return "QUACK!"
end
end
local function positionIsValid(x,y,z)
local occupancy = dfhack.maps.getTileBlock(x,y,z).occupancy[x%16][y%16]
local tiletype = getTileType(x,y,z)
local attrs = df.tiletype.attrs[tiletype]
if occupancy.building~=0 or occupancy.unit or not dfhack.maps.isValidTilePos(x,y,z) or attrs.shape == df.tiletype_shape.WALL then return false else return true end
end
local player = df.global.world.units.active[0]
if ...==nil then
for _uid,unit in ipairs(df.global.world.units.all) do
print(_uid,df.creature_raw.find(unit.race).caste[unit.caste].caste_name[0],dfhack.TranslateName(dfhack.units.getVisibleName(unit)),getPowerLevelComparison(player,unit))
end
qerror("type the number for the creature you want to teleport to!")
end
local unitToTeleportTo = df.global.world.units.all[tonumber(...)]
local function teleport(unit)
local playeroccupancy = dfhack.maps.getTileBlock(player.pos).occupancy[player.pos.x%16][player.pos.y%16]
local teleportToPosX = unit.pos.x
local teleportToPosY = unit.pos.y
local timesTried = 0
teleportToPosY = unit.pos.y - 1
repeat
if timesTried > 4 then qerror("Failed to teleport.") end
local hasNotTried = true
if teleportToPosY < unit.pos.y and hasNotTried then
teleportToPosY = unit.pos.y
teleportToPosX = unit.pos.x-1
hasNotTried = false
end
if teleportToPosX < unit.pos.x and hasNotTried then
teleportToPosX = unit.pos.x
teleportToPosY = unit.pos.y+1
hasNotTried = false
end
if teleportToPosY > unit.pos.y and hasNotTried then
teleportToPosY = unit.pos.y
teleportToPosX = unit.pos.x+1
hasNotTried = false
end
if teleportToPosX > unit.pos.x and hasNotTried then
teleportToPosX = unit.pos.x
teleportToPosY = unit.pos.y-1
hasNotTried = false
end
timesTried = timesTried + 1
until positionIsValid(teleportToPosX,teleportToPosY,unit.pos.z)
dfhack.gui.showAnnouncement("You put two fingers up to your head and concentrate...",11)
player.pos.x = teleportToPosX
player.pos.y = teleportToPosY
player.pos.z = unit.pos.z
if not player.flags1.on_ground then playeroccupancy.unit = false else playeroccupancy.unit_grounded = false end
end
teleport(unitToTeleportTo)
Based on the family planing script from the DFHack 0.34.11 r2 thread, DFHack can interact with the pregnancy system to at least a limited extent. So:
1.Can DFHack be used to immediately bring a pregnancy to term (what happens if you set unit.relations.pregnancy_timer = 1?)
2.Can DFHack be used to induce a pregnancy?
3.If yes to both, doesn't that mean we can spawn creatures now?
Also, is there a webpage documenting DFHack scripting, similar to the token/raw modding pages on Dwarf Fortress Wiki?
It gets us a lot, though, doesn't it? A Megabeast could have a self-targeting interaction that cues DFhack to make it pregnant with an instantaneous pregnancy, allowing it to spawn offspring to protect it. A variant of the child counting code could be used to turn the babies into a different species if desired. I think it also gets us workshop spawned creatures, with the potentially huge drawback that the created creature would count as the child of the dwarf doing the reaction (dwarf does reaction, temporarily turns into a female something or other, gives birth, turns back). ...I guess that would also fully heal the dwarf doing the reaction, thanks to all the transformations. The reaction could also induce pregnancy in a pet located anywhere in the fortress, right?1.Can DFHack be used to immediately bring a pregnancy to term (what happens if you set unit.relations.pregnancy_timer = 1?)1. Yes
2.Can DFHack be used to induce a pregnancy?
3.If yes to both, doesn't that mean we can spawn creatures now?
2. Yes
3. Not really, no.
I don't know if those can be created on the fly in DFHack
Should be possible without all that much work. I probably can't get to it any time soon, though.
Should be possible without all that much work. I probably can't get to it any time soon, though.
...i'd like a method, please, because I'm trying my damndest and can't find where targets or locations could be for any sort of interaction
...D_E, you may want to look at the post I was quoting for context...
I'm not sure, but I think transformed critters giving birth may crash the game.
However! trueTransformation may prevent this. If it does, coooool beans.
digv, if the location can be slightly modified with +1 each direction.
changevein, if the location can be slightly modified with +1 each direction.
magmasource, to make magma aquifer generating workshops.
liquids, probably once for 7/7 water and 7/7 magma.
removebadthoughts.
I'm not sure, but I think transformed critters giving birth may crash the game.
However! trueTransformation may prevent this. If it does, coooool beans.
Can transformed creatures even give birth?
[SYNDROME]
[CE_BODY_TRANSFORMATION:PROB:100:START:0:END:5]
[CE:CREATURE:RABBIT:MALE]
[SYN_CLASS:\PERMANENT]
[SYN_CLASS:HUMAN]
[SYN_CLASS:MALE]
I'm not sure, but I think transformed critters giving birth may crash the game.
However! trueTransformation may prevent this. If it does, coooool beans.
Blargh. I'd love to test this but I can't get trueTransform to work. Do I have to do something special to enable it? There's a dll of the right name in the plugins folder, but the example syndrome doesn't work. Does it really have to be male ducks? I deleted ducks out of the game (it's Zelda). What if I used a male rabbit? Does it not work in the arena?
Adding wear to armor and weaponsNot 100% sure but I think it should be possible to add wear to just about any item (including furniture etc). It might sound fun to have everything decay after a while but honestly I think it would be pretty annoying if you periodically need to replace your stuff. Especially because rock and metal are limited resources. And it would need to be tested how the game treats worn out non-cloth items - do they even get thrown away? Anyways, it could make sense for items made from certain materials, like for example iron weapons which rust away and become unusable after a couple of years. And with the code from autodump-destroy it should be possible to delete them from the map when that happens.
- Possible: ?
- Items get worn out by use.
I noticed the "add wear to armor" idea, but what about removing wear from clothing? The latter would be more fun, in my opinion.I don't know the exact RAW tag off the top of my head, but it's possible to define regular clothes as armor, after which they won't wear out anymore.
Slavery aka Change civ/race alignementDefinitely possible to a certain extent. Having a custom workshop "torture chamber" which has a 50:50 chance to either kill and invader or convert him to friendly would be fun. Some experiments with "tweak makeown" show that you can add most creatures to your civ with the limitation that you can't assign rooms to them (they seem to be treated as pets) but they will do certain jobs.
- Possible: ?
- Turn captured invaders into civ-members or pets.
- This would allow more uses of cage-trap captured invaders.
i want that a lot. how would i go about doing it?QuoteAdding wear to armor and weaponsNot 100% sure but I think it should be possible to add wear to just about any item (including furniture etc). It might sound fun to have everything decay after a while but honestly I think it would be pretty annoying if you periodically need to replace your stuff. Especially because rock and metal are limited resources. And it would need to be tested how the game treats worn out non-cloth items - do they even get thrown away? Anyways, it could make sense for items made from certain materials, like for example iron weapons which rust away and become unusable after a couple of years. And with the code from autodump-destroy it should be possible to delete them from the map when that happens.
- Possible: ?
- Items get worn out by use.
i want that a lot. how would i go about doing it?
also, i'd like to re-add spoilage to food even when stockpiled
Suggestion:
getbloodcount
For knowing just how much bleeding-related punishment a creature can take.
-- Gets blood count of creature (7000 is max for most humans)
function getBloodCount(unit)
if not unit then qerror("No unit selected or specified; aborting!")
return unit.body.blood_count
end
arg = ...
if tonumber(arg) then bloodCountUnit = df.global.world.units.all[tonumber(arg)]
else bloodCountUnit = dfhack.gui.getSelectedUnit()
print(getBloodCount(bloodCountUnit))
Easier n' pie.How do I use that? If I put it in the scripts folder with the filename getbloodcount.lua then I get an error when I try to use it (lua:7: cannot use '...' outside a vararg).
Easier n' pie.How do I use that? If I put it in the scripts folder with the filename getbloodcount.lua then I get an error when I try to use it (lua:7: cannot use '...' outside a vararg).
-- Gets blood count of creature (7000 is max for most humans)
function getBloodCount(unit)
if not unit then
qerror("No unit selected or specified; aborting!")
end
return unit.body.blood_count
end
arg = ...
if tonumber(arg) then
bloodCountUnit = df.global.world.units.all[tonumber(arg)]
else
bloodCountUnit = dfhack.gui.getSelectedUnit()
end
print(getBloodCount(bloodCountUnit))
With the triggering, is it possible to trigger a specific megabeast
or specific race to attack?
I'm not sure, but I think transformed critters giving birth may crash the game.
However! trueTransformation may prevent this. If it does, coooool beans.
Actually, it looks like it doesn't.
In the arena, the kittens were messed up in terms of names and group affiliation (ie, immediately attacked their mothers, who belonged to group 1).
However, in fortress mode they did not, and appear normal.
Also:Blargh. I'd love to test this but I can't get trueTransform to work. Do I have to do something special to enable it? There's a dll of the right name in the plugins folder, but the example syndrome doesn't work. Does it really have to be male ducks? I deleted ducks out of the game (it's Zelda). What if I used a male rabbit? Does it not work in the arena?
It seems truetransform ONLY works in fortress mode ???.
_____________________________________________________________________________
So, yeah.
Looks like reaction created creatures are a go!
...Once someone takes this proof-of-concept and fleshes it out into a real DFHack plugin...
Since DFHack can prospect at embark screen, is it possible to create a custom search script for embark? One that would take more parameters than the official one.
Oh, there are plenty of factors which I'm looking for time to time, depending on what kind of fort I'm planning to build.While searching cliffs, why not also relative elevations, cliff indication height markers, and otherwise that the other screens show; along with race relations (What if you want to be at war with humans, while at peace with gobbos?); and in combination with cliffs and rivers, waterfalls (if can be scannable; River/brook tile on a partifular cliff height/relativity height markup; csan for a partuclary high waterfall)?
Sand (often requested).
Specific minerals or layer stones.
Vegetation density.
Tree density.
Cliffs.
Specific types of terrain (glacier, desert, moist broadleaf forest, lake, sea etc).
River size.
River convergence.
I'm pretty sure some people could add their own suggestions, there were plenty of ideas for embark finder improvement through the years.
Ideally, such a tool could support logical operators, or alternatively allow the user to assign weights to different search parameters.
I'm not sure, but I think transformed critters giving birth may crash the game.
However! trueTransformation may prevent this. If it does, coooool beans.
Actually, it looks like it doesn't.
In the arena, the kittens were messed up in terms of names and group affiliation (ie, immediately attacked their mothers, who belonged to group 1).
However, in fortress mode they did not, and appear normal.
Also:Blargh. I'd love to test this but I can't get trueTransform to work. Do I have to do something special to enable it? There's a dll of the right name in the plugins folder, but the example syndrome doesn't work. Does it really have to be male ducks? I deleted ducks out of the game (it's Zelda). What if I used a male rabbit? Does it not work in the arena?
It seems truetransform ONLY works in fortress mode ???.
_____________________________________________________________________________
So, yeah.
Looks like reaction created creatures are a go!
...Once someone takes this proof-of-concept and fleshes it out into a real DFHack plugin...
Does this mean we could transform a Dwarf into some creature, have that creature give birth, and then transform back into the same Dwarf but have the baby be a member of the civilization?
A search plugin for the pasture / cage menu, similar to what Falcone added for other things.
What were the results? Anything interesting?http://www.bay12forums.com/smf/index.php?topic=51059.msg1087476#msg1087476 (http://www.bay12forums.com/smf/index.php?topic=51059.msg1087476#msg1087476)
What were the results? Anything interesting?
[USE_MATERIAL_TEMPLATE:CAT_ZAP:CREATURE_EXTRACT_TEMPLATE]
[SYNDROME]
[SYN_NAME:cat transformation]
[SYN_AFFECTED_CLASS:GENERAL_POISON]
[SYN_AFFECTED_CREATURE:DWARF:ALL]
[SYN_CONTACT]
[CE_BODY_TRANSFORMATION:START:0:END:1000]
[CE:CREATURE:CAT:FEMALE]
[CAN_DO_INTERACTION:MATERIAL_EMISSION]
[CDI:ADV_NAME:turn into cat]
[CDI:USAGE_HINT:ATTACK]
[CDI:MATERIAL:LOCAL_CREATURE_MAT:CAT_ZAP:TRAILING_VAPOR_FLOW]
[CDI:TARGET:C:LINE_OF_SIGHT]
[CDI:TARGET_RANGE:C:15]
[CDI:MAX_TARGET_NUMBER:C:1]
[CDI:WAIT_PERIOD:1000]
2) Embark to a locationA search plugin for the pasture / cage menu, similar to what Falcone added for other things.
Already done, see here: http://www.bay12forums.com/smf/index.php?topic=124708.0 (http://www.bay12forums.com/smf/index.php?topic=124708.0)
Adds some more filters (caged and gender) to pastures and pits as well as searching/filtering when assigning to cages.
Thanks, another one I'd find very useful is either search function for workshop profiles, or just sorting everyone alphabetically.
This would allow spawning of pets that count as children. To get working civ members with this, you would have to use a dwarven caste instead. Hugo and me use this trick for slaves... buy a pet that gives birth to a non-pet caste that transforms into a dwarven caste.
Your solution is a lot better then the currently one used, with the reanimation/transformation of bodyparts.
[REACTION:EXAMPLE]
[NAME:create item from enhanced material]
[ADVENTURE_MODE_ENABLED]
[REAGENT:weapon:1:WEAPON:NONE:NONE:NONE]
[REAGENT:reagent:1:NONE:NONE:INORGANIC:ADAMANTINE]
[PRODUCT:100:1://REACTION:weapon:NONE:NONE]
Is it possible to have a GUI mod that will let you select a job in the workshop and specifically choose what items you want used for that job, or forbid item types from being used?
if an enemy cant pathfind to the fort. they try to deconstruct an outerwall into a ramp for possible accessibility.
i ask because i want to try and mod it in
Since pathfinding is mentioned, I just wanted to refresh my old idea of a Pathfinding GUI plugin.if an enemy cant pathfind to the fort. they try to deconstruct an outerwall into a ramp for possible accessibility.Massively difficult. I have something that maybe 5% works but it's incredibly slow and buggy and I can't work on it right now.
i ask because i want to try and mod it in
Hey, thats something I havent seen before :)Personally, with all the visualizers and such that have been produced, and so forth, along with all the advances and tools made with the most recent DFHack, I'm surprised this idea (and even the tileset alone) haven't come up in anyone's minds to implement this far down the line.
I can absolutely envision it down here as on overlay. Then you have a minimap and you build menu at the same time, without this unnecessary second box. The map would need to be toggled off/made invisble if you enter another menu that reaches further down (for example the build:workshop menu) but I think it would make a great addition. :)
(screenshot)
fastdwarf can teleport. how bout a plugin for teleporting bad guys.
i can see a teleporting gremlin being a nightmare during an invasion.
I would like to see a creature's actual size and grazer value (if applicable) on a creatures description page, either directly or by way of displayed hotkey for additional info. Other values may also be of interest but those two came to mind.That can be done by simple raw modding.
If mining >= 15
add syndrome LEGENDARY_MINER
else if mining >=10
add syndrome ACCOMPLISHED_MINER
else if mining >= 5
add syndrome PROFICIENT_MINER
end
* The syndromes should have timeouts just a bit longer than the check period. skill = 0
for dwarf_skill in (a set of skills, such as military)
if dwarf_skill > skill
skill = dwarf_skill
end
end
If skill >= 15
add syndrome LEGENDARY_WARRIOR
else if skill >=10
add syndrome ACCOMPLISHED_WARRIOR
else if skill >= 5
add syndrome PROFICIENT_WARRIOR
end
* The script would be meant to be modified by modders to suit their needs, so there should be emphasis on good code readability and comments. Yes, thats why I have never done it... I have 1300 creatures... now if someone could write a script that adds *SIZE XXX* to the beginning of each creature description, reading out the size from the raws, that would be awesome. ^^
skillsyndrome stuff
I would like to see a way to edit the number of dwarves you can have on embark, please
It got lost during the rewriting. There will be a ruby script that does this in the next release.I would like to see a way to edit the number of dwarves you can have on embark, please
The weird thing is, dfusion has a script that should do this... it just isn't exposed, as far as I can tell.
I have one feature request: a search plugin for the burrow interface to filter by name or profession.
I don't know about itemsyndrome, but if it works like autoSyndrome then you can already make it trigger a ruby or lua script on the target dwarf and add whatever syndrome you want after checking skills. No additional stuff necessary.Of course there is additional stuff necessary. I never used Lua myself and am not familiar with dfhack API, so I need someone else to do the main part, then I can just edit the script to what syndromes for which skills exactly are needed. All I need is a "proof of concept" that would set a few syndromes based on skill levels, such as my mining and warrior example and a list of skills that Lua understands. I can take it from there.
2. Automate tree farming, by setting an area to re-designate tree cutting (or plant gathering) once per month. Using a zone somehow would be cool, but burrows might be easier - for example: at the start of each month, apply cut-trees designation to any burrow with 'TREE-CUT' in the name, and apply plant gathering designation to any with 'PLANT-GATHER' in the name. I'm not sure how it might work with zones, but I'll leave it here anyway.
Awesome!2. Automate tree farmingI'll add that to my to do list.
Awesome!2. Automate tree farmingI'll add that to my to do list.
Another suggestion, which I forgot to put in the other post: export-all from legends mode.
I'd think that this shouldn't be too tricky to implement and it's been on feature request lists for years, but seems low-priority for Toady since it's basically a UI issue and mostly useful for legends or mapping utilities.
-- Export all detail maps from legends
gui = require 'gui'
local vs = dfhack.gui.getCurViewscreen()
local i = 0
local MAPS = {
[0] = "Standard biom+site map",
"Elevations including lake and ocean floors",
"Elevations respecting water level",
"Biome",
"Hydrosphere",
"Temperature",
"Rainfall",
"Drainage",
"Savagery",
"Volcanism",
"Current vegitation",
"Evil",
"Salinity",
"Structures/fields/roads/etc.",
"Trade",
}
function wait_for_legends_vs()
vs = dfhack.gui.getCurViewscreen()
if i < 15 then
if df.viewscreen_legendsst:is_instance(vs) then
gui.simulateInput(vs, 'LEGENDS_EXPORT_DETAILED_MAP') -- "d" on screen some number internally
dfhack.timeout(10,'frames',wait_for_export_maps_vs)
else
dfhack.timeout(10,'frames',wait_for_legends_vs)
end
end
end
function wait_for_export_maps_vs()
vs = dfhack.gui.getCurViewscreen()
if df.viewscreen_export_graphical_mapst:is_instance(vs) then
vs.anon_13 = i -- anon_13 appears to be the selection cursor for this viewscreen
print('Exporting: '..MAPS[i])
i = i + 1
gui.simulateInput(vs, 'SELECT') -- 1 internally, enter on screen
dfhack.timeout(10,'frames',wait_for_legends_vs)
else
dfhack.timeout(10,'frames',wait_for_export_maps_vs)
end
end
if df.viewscreen_legendsst:is_instance( vs ) then -- dfhack.gui.getCurFocus() == "legends"
wait_for_legends_vs()
elseif df.viewscreen_export_graphical_mapst:is_instance(vs) then
wait_for_export_maps_vs()
else
dfhack.printerr('Not in legends view')
end
I'd still give my left kidney for the ability to alter/replace vanilla reactions.
I'd still give my left kidney for the ability to alter/replace vanilla reactions.
2. removeNative(shop_name)
Removes native choice list from the building.
3. addReactionToShop(reaction_name,shop_name)
Add a custom reaction to the building.
QuotePortal buildings. Enter building #1, worker is teleported to building #2This one was intended for military purposes, I think adding it to the pathfinding of the game, so that haulers would use it, is way to tricky. I was mostly thinking of these deep curious underground structures, with the squads barely making it to the lower levels before turning around for a drink/meal. Or fighting in the third cavern/circus.
- Possible: YES
- Quickly travel across the map.
- Reinforcements for deep layers, like the circus.
- More tactics, ambush invasions yourself.
- Enter otherwise walled-off areas, without opening doors for enemies.
How about being able to flush the 'Units killed' tab. It would free up ram that should be free to start with and let migrants come back in if you are over the 3k unit count.
fix/dead-units
Removes uninteresting dead units from the unit list. Doesn't seem to give any noticeable performance gain, but migrants normally stop if the unit list grows to around 3000 units, and this script reduces it back.
How about being able to flush the 'Units killed' tab. It would free up ram that should be free to start with and let migrants come back in if you are over the 3k unit count.
From the book of Readme.rst:Quote from: DFHack documentsfix/dead-units
Removes uninteresting dead units from the unit list. Doesn't seem to give any noticeable performance gain, but migrants normally stop if the unit list grows to around 3000 units, and this script reduces it back.
I only have one problem with it: it removes dead enemies. I don't want all the wild animals and slaughtered livestock, but I do want all the dead goblins and megabeasts :(
That would be great. Currently clothes and soap production are almost too tedious to bother with, despite tantrum spirals and disease outbreaks.Soap production is not that bad. You can set something as followed.
I like your tool a lot. Is there a way it could work in arena mode?
There's a plugin to add syndromes for units with high skills, could the same be done for attributes, so I can for example give a dwarf with high liberalness a syndrome which makes itsemi-crazyliberal?
A quick suggestion / request for a plugin: a GUI popup to type dfhack commands without changing windows.
Makes fullscreen more attractive, less break in immersion than alt-tab all the time, etc. Any idea how difficult this would be?
A quick suggestion / request for a plugin: a GUI popup to type dfhack commands without changing windows.
Makes fullscreen more attractive, less break in immersion than alt-tab all the time, etc. Any idea how difficult this would be?
For linux users it is as simple as installing a program called "guake" and opening dfhack through that. I am not sure how dfhack is loaded in windows though....
A quick suggestion / request for a plugin: a GUI popup to type dfhack commands without changing windows.
Makes fullscreen more attractive, less break in immersion than alt-tab all the time, etc. Any idea how difficult this would be?
For linux users it is as simple as installing a program called "guake" and opening dfhack through that. I am not sure how dfhack is loaded in windows though....
A quick suggestion / request for a plugin: a GUI popup to type dfhack commands without changing windows.
Makes fullscreen more attractive, less break in immersion than alt-tab all the time, etc. Any idea how difficult this would be?
For linux users it is as simple as installing a program called "guake" and opening dfhack through that. I am not sure how dfhack is loaded in windows though....
In Windows, DFHack loads as part of the Dwarf Fortress process by masquerading as the SDL library.
A quick suggestion / request for a plugin: a GUI popup to type dfhack commands without changing windows.
Makes fullscreen more attractive, less break in immersion than alt-tab all the time, etc. Any idea how difficult this would be?
For linux users it is as simple as installing a program called "guake" and opening dfhack through that. I am not sure how dfhack is loaded in windows though....
In Windows, DFHack loads as part of the Dwarf Fortress process by masquerading as the SDL library.
Thank you kindly.
I have a suggestion for a plugin... though this might be considered too much of a cheat/exploit.
I was using the autotrade plugin and that got me to thinking. Is there or could there be a plugin that periodically designates a stockpile to be dumped/melted? I can think of a number of ways that would be helpful to me. Auto-clearing refuse piles, auto-generating steel from leggings and trap parts (combined with the automelt plugin), auto-dumping poorly made furniture so workflow doesn't count it.... etc. Thanks in advance.
Haven't seen any auto-melt, but I think it has a good chance as well.I'd really like to have one, if possible. With workflow this opens alot of possibilities...
Haven't seen any auto-melt, but I think it has a good chance as well.I'd really like to have one, if possible. With workflow this opens a lot of possibilities...
New idea:
A plugin that allows the player to rename stockpiles and workshops, and the new nicknames show up in the jobs list.
Speaking of artifacts... how about a script that puts the item description on the first 'view item' page?
Mockup:Spoiler (click to show/hide)
I mean, I just get sick of having to press 'v' every time I want to look at an artifact, and since there's a space there anyway... For very long descriptions, cut it off at the bottom of the space and hit 'v' for the full text.
Fricy and Putnam: Thanks! :)
I use Masterwork DF, which includes DFHack. The rename script is included, but no hotkey was listed.
Fricy and Putnam: Thanks! :)
I use Masterwork DF, which includes DFHack. The rename script is included, but no hotkey was listed.
Meph thought it only worked for citizens, I think :V
Targeting only worn clothing with a reaction
- Possible: PROBABLY NO
- Makes cleaning up worn clothing a lot easier
- Could be used for a "burn worn clothing" or "recycle thread from worn clothing" reaction.
The probably impossible part is making the reaction only target worn clothing, preventing it from just always retargetting the same shoe over and over, and so on. It's probably possible if you really try hard enough, but it would be awkward at best and could result in a lot of job cancellation spam.Admittedly I know nothing about actual DF modding, only scipting in general. Maybe I'm just missing something about how the reactions work. I would think that if you had a script that returned an item with wear, and did something with it in a reaction to make it either not exist anymore or not have wear anymore, that the next time you ran the script it wouldn't be selecting the same item again. But maybe because of the tick system, that just doesn't work?
Hasnt been updated... I didnt get much info though, so I wouldnt know what to change on the opening post.
Aboveground-only buildings would be nice. ^^
I have plans for such a plugin in my backlog, probably be the next one to come out. Basically expanding the existing getplants plugin to support burrows and possibly min/max limits
A script that forces some non-dwarf creatures to work. The point is to be able to run multi-racial forts by taming creatures with [PET] and [CAN_LEARN] - you can already do that with gremlin and tigermen for some reason, but they will only do "noble and kids" tasks.https://gist.github.com/warmist/5636653
EDIT: Oh, and a random thing: I made my own version of slayrace magma which spawns water. That causes cave-ins and insta-kills on all cold maps. Was quite funny to watch ice boulders fall from the sky.
How about custom reactions that can only be used in certain seasons or during certain months?
How about civilization workshop availability related to spheres their deities/powers/whatever. So if a human civilization worships a fire god you could mod in a fire god altar, and it would be accessible by dwarves as well if any of their civilization's deities have fire as one of their spheres.
Not sure, but is it possible to heal dwarves with reactions?
Ok, here the list that accumulated while modding:
#1. Portal-Building, transports worker from building A to building B. Not pathfinding/AI related.
#2. Make reactions/buildings require mechanical power.
#3. Rotate workshops, just like you can change orientation of siege-engines.
#4. Aboveground or Belowground buildings.
#5. Liquid-Spawner, if reaction is run, Water/Magma is spawned, just like a Screwpump, but without input.
#6. A notification for the player if a civ-member is starving or dehydrated.#7. Animaltraining. Add +1 to a selected skill on a pet pastured on a workshop. "Train dog" adds 1 skill of biting to all pastured dogs for example.Done.
#8. Unmake a creature, it disappears without causing bad thoughts. Used to simulate a migrant leaving the fort.
#9. Engrave slabs before the units death, to honor even living soldiers.
#10. Good/evil biomes for caverns. For plants, grasses, trees and creatures.
#11. UI before embark that asks the player: How many embark points and how many dwarves would you like?
#12. Custom gods/pantheon, e.g. Putnam, finish the stuff you started. :P
#13. Start/Stop custom rains by reaction, for example "it rains elf blood" in any biome.
Edit: It would also be nice to get a script that could export all the site maps before the next release of DF - at the moment it's only hamlets, but with more and varied sites around this would become a lot more valuable. It would also tie into a more advanced suite of legends-mode hacks, if that ever comes together.You do realize that we're going to potentially rewrite nearly everything when the next release comes out. We've no idea what all will be changed in the next release. Code we write to deal with sites in the current version is fairly unlikely to work with the next version without being substantially reworked.
Not sure if still an issue, but i read that once all fish have been fished, the map doesnt produce more. That seems like a good target to be fixedI believe if you edit the population numbers (there is a tool in dfhack that lets you) you can repopulate. I usually just use it to get a couple thousand sea serpents to think of my fort as home :P
Would it be possible to teleport visitors from a certain civ down to a cavern edge whenever they enter your map? Cavern traders, ambushes, and sieges are things I've wanted to see for ages.Expwnent mentioned something about it being possible. Teleporting your embark crew down there, then unreveal the map, and revflood the cavern. Zeah, Cavernembark. :)
that or say make a site and embark as an adventurer directly under the ground and using revflood would also work.Would it be possible to teleport visitors from a certain civ down to a cavern edge whenever they enter your map? Cavern traders, ambushes, and sieges are things I've wanted to see for ages.Expwnent mentioned something about it being possible. Teleporting your embark crew down there, then unreveal the map, and revflood the cavern. Zeah, Cavernembark. :)
Cavern ambushes and sieges are already possible and modded into MDF.
a plugin to mark all ore's as flagged for mining
Awesome! Now "someone" just needs to do it. Of course in my experience "someone" always has a todo list that, if printed out, would completely swamp the word in paper ;)It's not that long: https://gist.github.com/warmist/3905090
For things like a "magma extractor" that allows you to get tiny amounts of metals from magma. I want to use it up so that you need to put such a building near the magma source and not on top of a 1 tile pool that was created from a magma melter or pumped up via magma piston.Ok, that makes sense. I do have one of these minecart filler things, and yes, as soon as you have one active workshop you make unlimited magma.
Also I want to make a "minecart filler", and it would be best for that to use fluids as well. If the cart filler didn't use fluids it would be possible (easy in fact) to get two or so minecarts full from the magma sea and use them to create a filling station on the surface. Free easy to get magma anywhere you want, not good.
// Some of these may not be needed.
#include <stdint.h>
#include <iostream>
#include <map>
#include <vector>
#include "Core.h"
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Maps.h"
#include "modules/World.h"
#include "modules/MapCache.h"
#include "modules/Gui.h"
using namespace DFHack;
using namespace df::enums;
using df::global::world;
DFHACK_PLUGIN("eat-magma");
// Only use with a NEEDS_MAGMA workshop and in a reaction that has FUEL,
// that way the workshop is guaranteed to have a usable amount of magma below.
// This program is an example of cut and paste codding at its worst,
// too bad DFHack isn't written in Go :p
// Anyway my C++ skills have atrophied more than I thought, plus I know nothing about the DFHack API...
// This function is copied directly from the steam engine plugin.
// BTW: why use the "auto" keyword? I thought that was implicit.
void decrement_flow(df::coord pos, int amount)
{
auto pldes = Maps::getTileDesignation(pos);
if (!pldes) return;
int nsize = std::max(0, int(pldes->bits.flow_size - amount));
pldes->bits.flow_size = nsize;
pldes->bits.flow_forbid = (nsize > 3 || pldes->bits.liquid_type == tile_liquid::Magma);
enable_updates_at(pos, true, false);
}
command_result eat_magma(color_ostream &out, std::vector<std::string> & params)
{
// How much to eat
int min_level = 1;
if (parameters.size() != 3) {
return CR_WRONG_USAGE;
}
// Is int the correct type to use here?
int c_x = atoi(parameters[0].c_str());
if ( c_x < 0 || c_x > 1 )
return CR_WRONG_USAGE;
int c_y = atoi(parameters[1].c_str());
if ( c_y < 0 || c_y > 1 )
return CR_WRONG_USAGE;
int c_z = atoi(parameters[2].c_str());
if ( c_z < 0 || c_z > 1 )
return CR_WRONG_USAGE;
// These will need to change for non-3x3 workshops.
int t_x = c_x-1;
int b_x = c_x+1;
int t_y = c_y-1;
int b_y = c_y+1;
int z = c_z;
for (int x = t_x; x <= b_x; x++)
{
for (int y = t_y; y <= b_y; y++)
{
auto ptile = Maps::getTileType(x,y,z);
if (!ptile || !FlowPassableDown(*ptile))
continue;
auto pltile = Maps::getTileType(x,y,z-1);
if (!pltile || !FlowPassable(*pltile))
continue;
auto pldes = Maps::getTileDesignation(x,y,z-1);
if (!pldes || pldes->bits.flow_size < min_level)
continue;
if (pldes->bits.liquid_type == tile_liquid::Magma)
{
decrement_flow(df::coord(x,y,z-1), min_level);
out.print("Successfully ate one magma.\n");
return CR_OK;
}
else
{
// Eat water here,
// if I can ever think of a way to keep the reaction from working if there is no water...
}
}
}
out.print("Failed to find magma tile.\n");
return CR_OK;
}
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{
commands.push_back(PluginCommand("eat-magma", "Remove 1/7 magma from a tile below a 3x3 workshop centered on the specified location.", eat_magma));
return CR_OK;
}
(http://i.imgur.com/80rlUez.png):o
Just something i was working on...
Currently trying to figure out what more can be needed e.g. would like to allow animated tiles, maybe (BIG MAYBE) a custom tick logic (like steam engine has)- would probably be big fps hit (it gets called each tick for each workshop-it could work but nothing complicated)(http://i.imgur.com/80rlUez.png):o
Just something i was working on...
YEAH!
Animation would be nice (even for workshops without power), but its graphical only. The important part is the use, the functionality. :)Custom tick logic could allow for e.g. real machines: my 2 current ideas: dragon breath engine (a pump like machine that instead of pumping magma from same level turns it into dragonfire) and a crusher (that crushes all stone stuff into blocks, and unfortunate live/dead units into flesh blocks), no need for jobs or anything, just connect power and enjoy. Just like steam engine works: fill up with fuel (or if using magma/water, do nothing!).
What would the custom tick logic do in comparison to how it works atm? If it hurts FPS, then I would rather try to avoid it, especially if it is used in a race that mainly uses powered workshops for everything.
blds.addBuilding(soapmaker.id,5,0,{{x=0,y=0}}) -- uses 5 produces 0 mechanical energy.
fps hit would be ~0blds.addBuilding(soapmaker.id,5,0,{{x=0,y=0}},1,makeFrames(),-1) --make frames is a big function
blds.onUpdateAction.bla=function (bld)
if bld:getCustomType()== soapmaker.id then
dfhack.maps.spawnFlow({x=bld.centerx,y=bld.centery,z=bld.z},0,0,0,199)
end
end
this function gets called each frame for each soapmaker.blds.registerBuilding("DRAGON_ENGINE_N",{consume=25,gears={x=0,y=0},action={25,makeSpewFire("north")},animate={???,isMechanical=true}})
more info about each one will be given later
If that dragon-breath engine does material emissions... then you could do custom siege engines with that. Even without the magma underneath. Remote controled siege engines. :o
Both ideas are awesome btw. :)
Faster than I thought :)I recently found out something new about water and drinks (thanks to Hugo_the_dwarf). You can actually do DRINK:NONE:WATER:NONE and the dwarves will drink the water from a barrel. You can also do DRINK:NONE:INORGANIC:NONE, and you will get magma in the barrel. A magma-drink, which dwarves drink without problem.Code: [Select]
// Some of these may not be needed.
#include <stdint.h>
#include <iostream>
#include <map>
#include <vector>
#include "Core.h"
#include "Console.h"
#include "Export.h"
#include "PluginManager.h"
#include "modules/Maps.h"
#include "modules/World.h"
#include "modules/MapCache.h"
#include "modules/Gui.h"
using namespace DFHack;
using namespace df::enums;
using df::global::world;
DFHACK_PLUGIN("eat-magma");
// Only use with a NEEDS_MAGMA workshop and in a reaction that has FUEL,
// that way the workshop is guaranteed to have a usable amount of magma below.
// This program is an example of cut and paste codding at its worst,
// too bad DFHack isn't written in Go :p
// Anyway my C++ skills have atrophied more than I thought, plus I know nothing about the DFHack API...
// This function is copied directly from the steam engine plugin.
// BTW: why use the "auto" keyword? I thought that was implicit.
void decrement_flow(df::coord pos, int amount)
{
auto pldes = Maps::getTileDesignation(pos);
if (!pldes) return;
int nsize = std::max(0, int(pldes->bits.flow_size - amount));
pldes->bits.flow_size = nsize;
pldes->bits.flow_forbid = (nsize > 3 || pldes->bits.liquid_type == tile_liquid::Magma);
enable_updates_at(pos, true, false);
}
command_result eat_magma(color_ostream &out, std::vector<std::string> & params)
{
// How much to eat
int min_level = 1;
if (parameters.size() != 3) {
return CR_WRONG_USAGE;
}
// Is int the correct type to use here?
int c_x = atoi(parameters[0].c_str());
if ( c_x < 0 || c_x > 1 )
return CR_WRONG_USAGE;
int c_y = atoi(parameters[1].c_str());
if ( c_y < 0 || c_y > 1 )
return CR_WRONG_USAGE;
int c_z = atoi(parameters[2].c_str());
if ( c_z < 0 || c_z > 1 )
return CR_WRONG_USAGE;
// These will need to change for non-3x3 workshops.
int t_x = c_x-1;
int b_x = c_x+1;
int t_y = c_y-1;
int b_y = c_y+1;
int z = c_z;
for (int x = t_x; x <= b_x; x++)
{
for (int y = t_y; y <= b_y; y++)
{
auto ptile = Maps::getTileType(x,y,z);
if (!ptile || !FlowPassableDown(*ptile))
continue;
auto pltile = Maps::getTileType(x,y,z-1);
if (!pltile || !FlowPassable(*pltile))
continue;
auto pldes = Maps::getTileDesignation(x,y,z-1);
if (!pldes || pldes->bits.flow_size < min_level)
continue;
if (pldes->bits.liquid_type == tile_liquid::Magma)
{
decrement_flow(df::coord(x,y,z-1), min_level);
out.print("Successfully ate one magma.\n");
return CR_OK;
}
else
{
// Eat water here,
// if I can ever think of a way to keep the reaction from working if there is no water...
}
}
}
out.print("Failed to find magma tile.\n");
return CR_OK;
}
DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{
commands.push_back(PluginCommand("eat-magma", "Remove 1/7 magma from a tile below a 3x3 workshop centered on the specified location.", eat_magma));
return CR_OK;
}
I think I got all the semicolons, but I have spent so long working with Go (in which semicolons are optional and discouraged) that I have probably missed a few.
Another possible/probable problem is includes, I may have some that are not needed and lack some that I need.
This is a very basic test version, it only eats 1/7 magma and the parameters should be the center tile of a 3x3 area that the workshop should cover.
Usage:
eat-magma x y z
(I have no idea if this works, will someone please compile it for me?)
That's just bad engineering :)Also bad ascii art and general building raw design :/ But it's fun to use. Also i made a mod manager (at least start of it...)
Warmist: "Mh... maybe I could work a bit on powered workshops"That's just bad engineering :)Also bad ascii art and general building raw design :/ But it's fun to use. Also i made a mod manager (at least start of it...)
Solving problems that nobody has (http://i.imgur.com/XhjgoPo.png)
function getMagma(pos)
local flags=dfhack.maps.getTileFlags(pos)
return flags.liquid_type, flags.flow_size
end
function removeLiquid(pos)
local flags=dfhack.maps.getTileFlags(pos)
flags.flow_size=0 --could be just removing 1 or 2 etc...
dfhack.maps.enableBlockUpdates(dfhack.maps.getBlock(pos.x/16,pos.y/16,pos.z),true) --needed to restart the flow sometimes
end
The display case does look like something every player could use, regardless of mod or not.If that's what you see when you q over the display case, I'd use it.
But then you will have a workshop that consumes b boiling water item and does not give anything. Steam engine is like a masterpiece. As is siege engine plugin and other stuff by angavrilov.As you know I have no knowledge about C++, I just thought it could be easily altered. If it doesnt work that way, no problem. I am more than excited enough about the powered workshops. :)
But then you will have a workshop that consumes b boiling water item and does not give anything. Steam engine is like a masterpiece. As is siege engine plugin and other stuff by angavrilov.As you know I have no knowledge about C++, I just thought it could be easily altered. If it doesnt work that way, no problem. I am more than excited enough about the powered workshops. :)
We could use a plugin that allows doctors to treat patients with specific substances, making syndrome-based medicine possible without complicated setups.
--reaction:
[REACTION:LUA_HOOK_CURE_BLA]
[NAME:Adminster cure for bla]
[PRODUCT:0:1:LIQUID_MISC:NONE:WATER][PRODUCT_DIMENSION:2000]
--lua file:
function lookUpSyndrome(name)
for k,v in pairs(df.global.world.raws.syndromes.all) do
if v.syn_name==name then
return v,k
end
end
end
function hasDisease(unit,syndrome)
for k,v in pairs(unit.syndromes.active) do
if v.type==syndrome.id then
return true
end
end
return false
end
function cureDisease(unit,syndrome)
for k,v in pairs(unit.syndromes.active) do
if v.type==syndrome.id then
local todel=v
unit.syndromes.active:erase(k)
todel:delete()
return true
end
end
return false
end
function cureBla(reaction,unit)
local dx,dy,dz
local syndrome="BLA" --change this to suit your needs, or better yet make it into function parameter
local syn_raw=lookUpSyndrome(syndrome)
for k,v in pairs(df.global.world.units.active) do
if v~=unit and not v.flags1.dead and hasDisease(unit,syn_raw) then --work on alive, sick units and not himself (well maybe you could let him cure himself)
dx=v.pos.x-unit.pos.x
dy=v.pos.y-unit.pos.y
dz=v.pos.z-unit.pos.z
if dx*dx+dy*dy<3 and dz==0 then --work on only close units
cureDisease(unit,syn_raw)
return
end
end
end
end
require("plugins.eventful").registerReaction("LUA_HOOK_CURE_BLA",cureBla)
lua file must be placed in to init.lua (in raw folder) or in some other file and called from that raw/init.lua file with dofile("path/to/file.lua")
autogenerated jobs, maybe praying could be like thatOr, more mundane thought: toilets. casinos. music stage. tavern. General non-productive socialising stuff.
yeah we can do that with slabs (i.e. workshop will need a slab to hold the text :) ). Also slabs have a type (used in adventurer mode):Quoteautogenerated jobs, maybe praying could be like thatOr, more mundane thought: toilets. casinos. music stage. tavern. General non-productive socialising stuff.
Or productive things: If its truly reactions that are done by idle dwarves at random, people could build smoking lounges and libraries and gardens... urists reads a book, gains some skill-gain, urists smokes a pipe, runs "remove bad thoughts"...
EDIT: About that display stand: Could signs be added? Custom 1 tile workshop, and it displays a text that the player can enter? I know notes are already in the game, but it would be something with more atmosphere.
Slab ,
Memorial,
CraftShopSign,
WeaponsmithShopSign,
ArmorsmithShopSign,
GeneralStoreSign,
FoodShopSign,
/**
* from the gods?
*/
Slab2,
FoodImportsSign,
ClothingImportsSign,
GeneralImportsSign,
ClothShopSign,
LeatherShopSign,
WovenClothingShopSign,
LeatherClothingShopSign,
BoneCarverShopSign,
GemCutterShopSign,
WeaponsmithShopSign2,
BowyerShopSign,
BlacksmithShopSign,
ArmorsmithShopSign2,
MetalCraftShopSign,
LeatherGoodsShopSign,
CarpenterShopSign,
StoneFurnitureShopSign,
MetalFurnitureShopSign
We could also use that for something.
Is that an ingame UI for enabling and disabling scripts/plugins? (How many different things are you doing at the same time? ^^)All of them. Biggest regret that i don't have time to find out how to fix the animal multiplication bug, then i could build my perfect adv-fort...
Hello! Ya'll are awesome! Love your work! Wish I knew more programming :P. And now for something completely different.
I searched for the following but I couldn't find it... I am looking for a plugin that would make an option for stockpiles to automatically designate items brought there for melting or dumping instead of the player having to do it manually. I am specifically interested in the melting aspect, but dumping would also be good.
I do use a plugin that auto designates all items in specified stockpiles for trade (http://www.bay12forums.com/smf/index.php?topic=124523.msg4145157#msg4145157) when a caravan comes, so I think it is doable. But I don't have enough programming experience to do it myself.
I know this would help me a ton for melting down goblinite or creating an infinite supply of steel bars and leggings (with the workflow plugin). If there isn't one out there would it be simple to program? Is it a good idea and worth programming? What do you all think? Thanks in advance! I appreciate you all!
I've already made an automelt plugin for stockpiles similar to my autotrade one. Just running it through some testing before publishing it. It's easy enough to make an auto dumping one too. Wasn't sure if people would need that option.
It's easy enough to make an auto dumping one too. Wasn't sure if people would need that option.An autodump stockpile is something I'd like the option of having. It'd be a little like having a QSP, but with no dwarf-side setup and manual recovery of the "stockpiled" items.
Just a question: Is there any way to start/force clouds/fogs/mists? I would really love to have a reaction that spawns evil weather, even if its not a evil region.
dfhack.maps.spawnFlow(pos,type,mat_type,mat_index,dimension)
one param: dfhack.maps.spawnFlow(xyz2pos(
then \LOCATION OR STH...
),type,mat_type,mat_index,dimension)
Is there some kind of plugin that adds natural disasters such as storms, tornadoes, eruptions, floods, cyclones and the like out there? Would appreciate.No, not yet. There is one that could simulate storms, and I added some weather effects to glaciers using regional interactions, but nothing really elaborate.
How abou a split stack reaction?You are looking at it wrong. Userdata is an implementation detail (you should "not know about it"). Also if there is a way of copying items, first create new item, then do newItem:assign(oldItem), take care as this is not deep recursive (afaik) for you would need newItem:assign(utils.clone(oldItem,true)). Then set the correct item id etc, special references and so on. The big problem is that items are very varied and can be difficult to generalize (e.g. body parts have huge amount of stuff, for that reason the scripts for item creations to my knowledge don't implement body part creation) and it's hard to do the right thing for every item type. In special cases (that is useful cases, like arrows, coins, etc...) splitting might be easy, bones on other hand might not.
If there were some way to copy all of an item's data, then just reduce the stack size... but I have no idea how to copy userdata.
local ret,err = pcall(function() return item.subtype end)
if i remember the syntax correctly.
Mostly this is something I'd like because I use vertical shafts to drop items from the surface and they keep hitting the haulers at the bottom.Can't this be done in-game, especially if you're willing to use power?
Can't this be done in-game, especially if you're willing to use power?It would need to be hauled back up to the top of the shaft right?
Have a one-stop route that pushes the minecart down the shaft and onto a roller. The minecart rolls forwards, past a lowest-friction track stop that dumps the cart's items, and onto a stockpile that accepts minecarts. Because the minecart doesn't need to be hauled to a stockpile, it's immediately ready to go back onto its stop.
Floor hatch and pressure plate? Hauler gets close to drop-zone, walks over plate, closes hatch, nothing can hit him, items pile up on the hatch one z-level above, hauler takes item from ground, walks away, steps on plate again, opens hatch, next batch of dropped items lands on the floor, ready to be taken by the next hauler.Can't this be done in-game, especially if you're willing to use power?It would need to be hauled back up to the top of the shaft right?
Have a one-stop route that pushes the minecart down the shaft and onto a roller. The minecart rolls forwards, past a lowest-friction track stop that dumps the cart's items, and onto a stockpile that accepts minecarts. Because the minecart doesn't need to be hauled to a stockpile, it's immediately ready to go back onto its stop.
Floor hatch and pressure plate? Hauler gets close to drop-zone, walks over plate, closes hatch, nothing can hit him, items pile up on the hatch one z-level above, hauler takes item from ground, walks away, steps on plate again, opens hatch, next batch of dropped items lands on the floor, ready to be taken by the next hauler.This is what I figure I'll have to do along with limiting it to one hauler at a time, would still like to see conveyor buildings, though.
Floor hatch and pressure plate? Hauler gets close to drop-zone, walks over plate, closes hatch, nothing can hit him, items pile up on the hatch one z-level above, hauler takes item from ground, walks away, steps on plate again, opens hatch, next batch of dropped items lands on the floor, ready to be taken by the next hauler.This is what I figure I'll have to do along with limiting it to one hauler at a time, would still like to see conveyor buildings, though.
Masterwork DF - Gnome Fortress has powered conveyor belts, thanks to IndigoFenix. The race is still in developement, but you can play it. :)Nice! I will have to check it out.
It would need to be hauled back up to the top of the shaft right?I was thinking impulse elevator. I made a little test setup -- the elevator covers a 3x3 area, and the minecart drops down the shaft in the middle of the elevator and slams onto the roller.
I've been avoiding using impulse ramps on my more serious forts, but I could still use rollers to get the carts back to the top.It would need to be hauled back up to the top of the shaft right?I was thinking impulse elevator. I made a little test setup -- the elevator covers a 3x3 area, and the minecart drops down the shaft in the middle of the elevator and slams onto the roller.
How about a salt extractor? A reaction that uses saltwater buckets and charcoal and outputs salt powder bags. If such a workshop exists it could also grind rock salt into salt bags too.I'm honestly interested. Is there a way to differentiate salt water from fresh water in reactions? Or at least make it so a workshop isn't available if there isn't any salt water?
I've been avoiding using impulse ramps on my more serious forts, but I could still use rollers to get the carts back to the top.This (http://www.bay12forums.com/smf/index.php?topic=119430.5) is an efficient powered setup.
This (http://www.bay12forums.com/smf/index.php?topic=119430.5) is an efficient powered setup.Bookmarked. Cheers.
Without custom logic in DFHack, no, it is not possible - in-game, salt water is simply water that has salt "contaminants" on it (the same way swords can be coated with blood and blowdarts can be coated with venom). There's the additional issue that dwarves do not fill buckets with water unless they intend to use them immediately, and that only happens with hardcoded jobs (and it also forces the water collected to be drinkable, so they won't collect salt water in the first place).How about a salt extractor? A reaction that uses saltwater buckets and charcoal and outputs salt powder bags. If such a workshop exists it could also grind rock salt into salt bags too.I'm honestly interested. Is there a way to differentiate salt water from fresh water in reactions? Or at least make it so a workshop isn't available if there isn't any salt water?
+1 from me. Saltwater filter sounds very helpful.How about a salt extractor? A reaction that uses saltwater buckets and charcoal and outputs salt powder bags. If such a workshop exists it could also grind rock salt into salt bags too.I'm honestly interested. Is there a way to differentiate salt water from fresh water in reactions? Or at least make it so a workshop isn't available if there isn't any salt water?
Without custom logic in DFHack, no, it is not possible - in-game, salt water is simply water that has salt "contaminants" on it (the same way swords can be coated with blood and blowdarts can be coated with venom). There's the additional issue that dwarves do not fill buckets with water unless they intend to use them immediately, and that only happens with hardcoded jobs (and it also forces the water collected to be drinkable, so they won't collect salt water in the first place).How about a salt extractor? A reaction that uses saltwater buckets and charcoal and outputs salt powder bags. If such a workshop exists it could also grind rock salt into salt bags too.I'm honestly interested. Is there a way to differentiate salt water from fresh water in reactions? Or at least make it so a workshop isn't available if there isn't any salt water?
Is there any way to rename individual generic items in a running fort? Its driving me slightly mad trying to find a way through brute force (don't really know much about coding, learning slowly)
Or figure out the named weapons/armor?Is there any way to rename individual generic items in a running fort? Its driving me slightly mad trying to find a way through brute force (don't really know much about coding, learning slowly)
Maybe if it was made into an artifact without actually increasing the quality. Hmm.
There are only two ways (that I know of) that an item can have a special name:Are those named-weapons (i.e. the ones that dwarves give names to) done through artifact records?
1. the item has a PetInfo record connected to it (which likely also requires that it be a tame vermin), which would make it also show up in the Z-Animals screen.
2. the item has an Artifact record connected to it, which would make it also show up in the Artifacts list.
Silly suggestion that ties into meph's idea for his plugin:
what if the invading force was just another embark group? and you have to deal with a group of settlers building on your 'land'
Like we have digging invaders and building destroyers but what about Fortifying invaders whochop your wood and build their own city... on your lawn.do what you would do if you embark on top of another civ.
Though I wonder how one could pull this off, use any of the auto fort programs but tie it to any one with the invader flag?
Use the adventure fort mode script but have it tie to the invading party and write a bunch of macros?
Megaproject of large caliber it is hmm now to figure out how to make a macro out of advfort so that any one assign will start building stupid crud.Silly suggestion that ties into meph's idea for his plugin:
what if the invading force was just another embark group? and you have to deal with a group of settlers building on your 'land'
Like we have digging invaders and building destroyers but what about Fortifying invaders whochop your wood and build their own city... on your lawn.do what you would do if you embark on top of another civ.
Though I wonder how one could pull this off, use any of the auto fort programs but tie it to any one with the invader flag?
Use the adventure fort mode script but have it tie to the invading party and write a bunch of macros?
O_O
This would be massively difficult. I don't see myself ever having enough time to do that. Digging invaders was a superproject in itself.
it would be more interesting (imho) when they would not be attacking, but just e.g. setting a shop or a tavern and then trading the shit out of your dwarves :Dor hell with all these new building types having a resident gnome villa in a Dwarf fort won't be so bad.
...I'm kind of bothered by the fact that I never think of these things and you always have to come out and suggest it for me to even consider the notion. I really need to figure out in what way I'm thinking wrong.Dont take it too serious. I am bothered by the fact that I always have to bother people to get such things done, instead of being able to do it myself. Just call it team work or resource splitting. ;)
I'll see what I can do after my volunteer work.
df.global.world.entities.all[X].resources.animals.pet_races
df.global.world.entities.all[X].resources.animals.pet_castes
But I have never tried adding or subtracting available pets and such, I have no idea if it would work.urist da vinci wrote a script rhat could do this for trees. I assume it could be modified... ghe issue was that it had to be run manually... it targets specific civs, so it needs to run after you load a world.
local my_entity=df.historical_entity.find(df.global.ui.civ_id)
--Display what pets are currently available
printall(my_entity.resources.animals)
for k,v in pairs(my_entity.resources.animals.pet_races) do
print(k, v, df.creature_raw.find(v).creature_id)
end
printall(my_entity.resources.animals.pet_castes)
--Uncomment lines to activate code!
--ELF funny stuff (on vanilla raws at least)
--my_entity.resources.animals.pet_races:insert('#',my_entity.race+2)
--my_entity.resources.animals.pet_races:insert('#',my_entity.race+2)
--my_entity.resources.animals.pet_castes:insert('#',0)
--my_entity.resources.animals.pet_castes:insert('#',1)
--do the same for wagon_races and wagon_castes if you also want them as wagon-pullers
--adds WATER to the extracts list so you can buy barrels of water to dump into a cistern?
--my_entity.resources.misc_mat.extracts.mat_type:insert('#',6)
--my_entity.resources.misc_mat.extracts.mat_index:insert('#',0)
I've so far this is where I've gotten,
(https://dl.dropboxusercontent.com/u/129105368/book.PNG)
A custom material book with a custom title.
Wonder if ForumDwarves and it's .txt input and output has the answers I need ....
:o
Do I interpret this correctly? You can add any pet to any race, even if it would otherwise lack biome tags or common domestic/mount tags? Could you post an example?
:o
Do I interpret this correctly? You can add any pet to any race, even if it would otherwise lack biome tags or common domestic/mount tags? Could you post an example?
You can add any specific caste of a creature as a pet, wagon puller, pack animal, mount, minion (trolls for goblins?), or exotic pet.
In the elf example, since they lack the pet tags, they show up as tame elves who are on the citizens list rather than the livestock list. If you make elves into wagon pullers or pack animals, they will do that task correctly, but may have trouble carrying a large pack load. If you give a civ its own creature as a mount, you can get attacked by piggyback riders during sieges.
The [PET] token actually has on-map AI, breeding, and interface uses, as shown by other people's testing.
The [WAGON_PULLER] token merely appears to add the creature to a list of possible wagon pullers. The special caravan AI appears to force whatever creature has the job to obey, regardless of tokens.
Dwarves claim bedrooms automatically, you dont have to asdign them to dwarves.
i'd like a plugin that listens the combat log and if an attack is made returns the weapon, the attacking creature, the attacked creature, and the armour the weapon had to go through
i'd like to make a script to add wear to weapons and armor based on their material properties, but i don't know how to do that first part
You can do this with a "dwarven ground radar/sonar", just designate a large farm and start scrolling. When the X turn green, even on the unreleaved tiles, you know that there is soil underneath = cavern.No, I meant something different.
for each tile in current_z_level_unrevealed_tiles
for z = tile.z to lowest_z
if (tile.x, tile.y, z) is revealed then break
if (tile.x, tile.y, z) is magma_sea then
blink green X at tile
break
I really wish there was something to designate tombs for the already deceased.Actually you can assign a tomb to dead dwarf. It's a problem to find that specific dwarf in the list, though.
i'd like a plugin that listens the combat log and if an attack is made returns the weapon, the attacking creature, the attacked creature, and the armour the weapon had to go through
i'd like to make a script to add wear to weapons and armor based on their material properties, but i don't know how to do that first part
I'd also like a plugin/script that showed you everything a particular thing was linked to. (So select a lever and it shows you the bridge, select the bridge and it shows you the lever.) Perhaps in a list with center-on-selection like the ordinary link screen?gui/mechanisms (https://github.com/DFHack/dfhack/#in-game-interface-tools) already does this.
Also, a nudge/cut/copy/paste designation tool would be awesome. (Especially if it included a mode to copy already-dug areas as "to be dug" - select the floor of the bedrooms that you already dug and copy-paste it a layer down, for example) If possible, including a way to copy buildings as "to be built" - as though you just built a new bed (or whatever) in the new location and am at the materiel selection screen. (So copy a furnished bedroom and paste it into an unfurnished bedroom and it displays the materiel selection screen for the bed, then the table, and the chair, and the chest, etc.)https://github.com/DFHack/dfhack/blob/develop/needs_porting/copypaste.cpp
gui/mechanisms (https://github.com/DFHack/dfhack/#in-game-interface-tools) already does this....How did I miss that?
https://github.com/DFHack/dfhack/blob/develop/needs_porting/copypaste.cppWow that's messy. (hardcoded commands, etc)
It's an old proof-of-concept for this, which needs to be updated to the current version. I know nothing more, but it does seem possible - and I'd also love to see this updated.
Also, a nudge/cut/copy/paste designation tool would be awesome. (Especially if it included a mode to copy already-dug areas as "to be dug" - select the floor of the bedrooms that you already dug and copy-paste it a layer down, for example) If possible, including a way to copy buildings as "to be built" - as though you just built a new bed (or whatever) in the new location and am at the materiel selection screen. (So copy a furnished bedroom and paste it into an unfurnished bedroom and it displays the materiel selection screen for the bed, then the table, and the chair, and the chest, etc.)
a plugin that has trees beget more trees (since tree growth rate can't really be controlled).We (and i mean mostly Quietust) thought of a great idea, using 1x1 farm with full fertilization as a trigger for tree growth. But we (probably just me :) ) wanted to somehow allow selecting which species of tree to grow and that is where we stopped.
So, a tree will have a random chance of spawning a sapling onto a nearby square.
Variable could be adjusted in the plugin.
Maybe even flags for modifying the age length of tree growth by randomly upgrading a few of the saplings on the map up a notch every month, the chance of a sapling being upped to a tree could be a variable set in the plugin.
Something similar for plants could be done as well.
I asked about modifying embark size after embark a while ago (maybe even in this thread). Hurmph!oh I'm asking is it possible to move a fort site than modifying the embark size in game, since any bigger and your pc will die... or well on lower end pcs
Here's another example of rendering pulled from another thread:Spoiler (click to show/hide)
Here's an idea: a plugin that allows nestboxes to be claimed by civ members (and then manages their eggs).a plugin that allows you to shove eggs created by reactions or bought, into a nestbox.
A plugin or script that could maximise the DF window, or some other method of starting DF maximised.
Fullscreen and maximised is different things.A plugin or script that could maximise the DF window, or some other method of starting DF maximised.
Already possible, just set [WINDOWED:NO] in the init file.
Fullscreen and maximised is different things.A plugin or script that could maximise the DF window, or some other method of starting DF maximised.
Already possible, just set [WINDOWED:NO] in the init file.
A plugin or script that could maximise the DF window, or some other method of starting DF maximised.Shouldn't that be a launcher feature? Like query window resolution, query tileset size and set WindowedX and WindowedY in the init accordingly?
A window the size of the screen is different to a maximised window, and different again to fullscreen mode. On Windows at least my tests with cmd scripts seem to indicate that dfhack launches DF, which thus isn't amenable to the simple "start /max" idea directly. So I thought it might make sense to do it through dfhack.both on windows and linux df lauches dfhack. Not the other way around.
I'm working on a UNIT_ATTACK event for lua. The idea is to make some sort of attack trigger script where you register weapons and/or materials of weapons or combinations and trigger scripts when a unit attacks someone with a particular type of weapon. What uses are there for this, if any?Spawn flows. Add syndromes. Temperature changes. That should give plenty of options. A firesword bursts a jet of fire when you strike, or a ice sword causes frostbite. A mace might knock someone unconcious by adding dizziness. Simple things. :)
e: hang on, does a projectile that misses and harmlessly hits the ground leave an exploitable mark you could hook effects to? That'd make explosive siege projectiles pretty great.
Yes it does. Explosive siege projectiles are already in Genesis and MDF.e: hang on, does a projectile that misses and harmlessly hits the ground leave an exploitable mark you could hook effects to? That'd make explosive siege projectiles pretty great.
I think projectileExpansion does this.
e: hang on, does a projectile that misses and harmlessly hits the ground leave an exploitable mark you could hook effects to? That'd make explosive siege projectiles pretty great.
I think projectileExpansion does this.
It's basically done. The only problem is that it doesn't distinguish between a dwarf holding a steel mace punching someone and a dwarf holding a steel mace actually hitting them with the mace. Hopefully that'll be close enough. It'll be in the next release.
https://github.com/expwnent/dfhack/blob/scriptOrganization/scripts/attackTrigger.lua
It's basically done. The only problem is that it doesn't distinguish between a dwarf holding a steel mace punching someone and a dwarf holding a steel mace actually hitting them with the mace. Hopefully that'll be close enough. It'll be in the next release.
https://github.com/expwnent/dfhack/blob/scriptOrganization/scripts/attackTrigger.lua
I notice you are able to get both attacker and defender unit ids, can something similar be done for interactions?
You guys want everything. :PWe really need a Modding Suggestion thread as well, so non-modders can make unreasonable demands of modders, just like you scripters/coders get. :P
It's basically done. The only problem is that it doesn't distinguish between a dwarf holding a steel mace punching someone and a dwarf holding a steel mace actually hitting them with the mace. Hopefully that'll be close enough. It'll be in the next release.
https://github.com/expwnent/dfhack/blob/scriptOrganization/scripts/attackTrigger.lua
I notice you are able to get both attacker and defender unit ids, can something similar be done for interactions?
You guys want everything. :P
I'll look into it.
You guys want everything. :P
A script that creates items on embark according to the starting dwarves' highest skill so the player doesn't end up with an absurd situation where profession dwarves have no equipment:Cant you simply take more points and buy those things?
- A dwarf whose highest profession is Miner should automatically start with a pick
- A dwarf whose highest profession is Woodcutter should automatically start with an axe
- A dwarf whose highest profession is *smithing should automatically start with an anvil
- Military dwarves should come fully armored and equipped
I have a partial solution, but it requires CDI:VERB and CDI:VERB_TARGET tags. I will include a way of optionally silencing them from the actual announcement log, but they have to be there for this method to work.
I have a partial solution, but it requires CDI:VERB and CDI:VERB_TARGET tags. I will include a way of optionally silencing them from the actual announcement log, but they have to be there for this method to work.
I am interested to see your partial solution. I had fiddled with CDI:VERB but was never sure if I was doing it quite correctly, I am sure your method is much better than what I was able to whip up.
Probably impossible, but it's related to TwbT so who knows:
Inplement Truetype in [print_mode:standard]
Less fiddling around when you want TrueType, Text will be Text, or Rendermax.
But truetype isn't supported on many screens, including dfhack screens, anyway, so what's the point? I thought my new idea of separate tile sizes for map and text is solving the problem of readability and truncation of long notifications, etc., isn't it?
But truetype isn't supported on many screens, including dfhack screens, anyway, so what's the point? I thought my new idea of separate tile sizes for map and text is solving the problem of readability and truncation of long notifications, etc., isn't it?
The only reason I care at all is the crash-to-desktop with stonesense, since without a way to disable the plugin I can't have both at the moment (else just add "multicmd TwbT disable; wait 10; stonesense overlay" as the activation command). Which in turn only matters to me because the isometric is a massive draw to new players; I prefer the 2D like most current players.
What build for win or os x has stonesense overlay working for sure? I have some builds of r3,4,5 for both systems for testing, but all of them either has no stonesense, no overlay, or it's crashing...From the dfhack-r5 thread (http://www.bay12forums.com/smf/index.php?topic=139553), I downloaded the windows-r5 Stonesense; I don't know what that's built from. As far as I know there's no working OSX release.
There are several things to think about regarding having twbt and stonesense together, especially if different tile sizes for text/map are used. Ideally, for better performance stonesense overlay should disable map rendering entirely when enabled.Yeah, I can see a lot of potential for clashes there.
Well, I was asking if there's any existing plugin:)
I had another thought, but it's escaping me right now...
You can butcher it: make a refuse pile and eventually dwarves will drag it to butcher shop and butcher it. A way to enqueue a job to specific corpse would be nice though.I had another thought, but it's escaping me right now...
Oh, right!
I'd like to be able to put my cursor on the corpse of one of my tame animals and get it swapped out for skull, teeth/horns, hair/wool, and bones. I don't know why we can't butcher a cow killed by a goblin. I can understand not considering the meat safe to eat.
Is there a plugin (or maybe I just missed some simple way to do that) to see what dwarves with particular labours are currently doing?Are you making creature graphics based on job?
I can't believe this hasn't been suggested already, maybe it's just me who's crappy at using the search function :pThat already exists. Roses made a script like that, except with the reload/question thing. But the rest pretty much works.
Something that would be really nice is if we could give ranged weapons delays and multiple attacks (alternatively shorter reload times, but I think that would be harder?) This way, we could design better weapons for modern-day mods. Preferrably, the multiple attacks shouldn't happen all at once, but rather be spread out throughout the attack delay.
I believe this should be doable, seeing as we can make spells that fire projectiles. If we could make the script read the tokens of the weapon used, we could add a new one like [EXTRA_ATTACKS:X], and then simply spawn the projectiles with intervals of (delay/(x+1)).
As for the weapon delays, it would be awesome if we could have two tokens, such as [PRE_DELAY:X] and [POST_DELAY:X], forcing the creature to wait X ticks/other time units before and after the attack. It could be further improved to take input after the shots have been fired, asking the player "Would you like to reload", and if the player selects "no", the [POST_DELAY] would be ignored, but the weapon would be unusable until it is somehow reloaded.
I have no idea if these would be possible, but I thought I'd just throw them up here. :)
I can't believe this hasn't been suggested already, maybe it's just me who's crappy at using the search function :pThat already exists. Roses made a script like that, except with the reload/question thing. But the rest pretty much works.
Something that would be really nice is if we could give ranged weapons delays and multiple attacks (alternatively shorter reload times, but I think that would be harder?) This way, we could design better weapons for modern-day mods. Preferrably, the multiple attacks shouldn't happen all at once, but rather be spread out throughout the attack delay.
I believe this should be doable, seeing as we can make spells that fire projectiles. If we could make the script read the tokens of the weapon used, we could add a new one like [EXTRA_ATTACKS:X], and then simply spawn the projectiles with intervals of (delay/(x+1)).
As for the weapon delays, it would be awesome if we could have two tokens, such as [PRE_DELAY:X] and [POST_DELAY:X], forcing the creature to wait X ticks/other time units before and after the attack. It could be further improved to take input after the shots have been fired, asking the player "Would you like to reload", and if the player selects "no", the [POST_DELAY] would be ignored, but the weapon would be unusable until it is somehow reloaded.
I have no idea if these would be possible, but I thought I'd just throw them up here. :)
https://github.com/Pheosics/DFHack_spells/blob/master/projectile.lua
PS: Mixing this with putnams projectileExpansion script allows even more fun.
https://gist.github.com/Putnam3145/7005764
Yo (https://github.com/expwnent/dfhack/blob/develop/scripts/modtools/item-trigger.lua).
I would suggest waiting until the new system is set up completely and DFHack is updated for the new version. Once that is done I can give you an example weapon and you can modify it how you like.
In the old version you would need to add an inorganic that specified the interaction for the individual weapons using itemSyndrome, and then had the syndrome from the interaction use syndromeTrigger to run the script.
Something I've been planning on for a while: set the mining glyphs (usually %) for unmined tiles to give an indication of what minerals are there. Configurable based on the skill of a unit or something like that to give a probabilistic in-game mineral prospecting tool. Something that gives much less information than reveal, but more information than just guessing where minerals are.a script/plugin that activates other script/plugins/syndromes(applied to the noble) based on the presence of a noble, so expwnent idea could be based on the mining skill of a noble called the "surveyor"
I don't know if this is the right place for this suggestion but what I'd really like to see is for designate command to show results for k-look command for the cursor position. One of the most annoying things in Dwarf Fortress is a layer of almost or completely identical stone (by color or tile) where you want to dig only one kind and not the other and constantly have to check with k-look which square is which.
I don't know if this is the right place for this suggestion but what I'd really like to see is for designate command to show results for k-look command for the cursor position. One of the most annoying things in Dwarf Fortress is a layer of almost or completely identical stone (by color or tile) where you want to dig only one kind and not the other and constantly have to check with k-look which square is which.
Isn't this what mousequery plugin "live query" mode doing?
I don't know if this is the right place for this suggestion but what I'd really like to see is for designate command to show results for k-look command for the cursor position. One of the most annoying things in Dwarf Fortress is a layer of almost or completely identical stone (by color or tile) where you want to dig only one kind and not the other and constantly have to check with k-look which square is which.
Isn't this what mousequery plugin "live query" mode doing?
Don't know since I don't use mousequery since I like to play entirely by keyboard. But if mousequery moves the ingame cursor to where mouse cursor is at any given time and displays the k-look info during designate command then I'd think that it would be quite easy to implement that same functionality without the need for mousequery. But again, I don't know what mousequery does exactly since I don't use it.
I don't know if this is the right place for this suggestion but what I'd really like to see is for designate command to show results for k-look command for the cursor position. One of the most annoying things in Dwarf Fortress is a layer of almost or completely identical stone (by color or tile) where you want to dig only one kind and not the other and constantly have to check with k-look which square is which.digv and digl (https://github.com/DFHack/dfhack/blob/master/Readme.rst#digv)
As useful as those are (and I swear to use them more when I get back to playing with DFHack I swear) it's not the functionality I requested for.I don't know if this is the right place for this suggestion but what I'd really like to see is for designate command to show results for k-look command for the cursor position. One of the most annoying things in Dwarf Fortress is a layer of almost or completely identical stone (by color or tile) where you want to dig only one kind and not the other and constantly have to check with k-look which square is which.digv and digl (https://github.com/DFHack/dfhack/blob/master/Readme.rst#digv)
for k,bed in ipairs(df.global.world.buildings.other.BED) do
bed.owner_id=-1
bed.owner=nil
end
A command to mark all water/ice tiles as Restricted. The intended use is for cold climes where you want to avoid drowning due to ice melting and death due to freezing.
Code: [Select]for k,bed in ipairs(df.global.world.buildings.other.BED) do
bed.owner_id=-1
bed.owner=nil
end
There's your "unassign all" script.
I'dDwarves shouldn't be claiming multiple bedrooms (unless they're married, in which case they should only own one room, while the other is owned by their spouse).killmaim for a command in DFhack that would unassign the beds in all bedrooms, and a second command to distribute all unassigned beds to dwarves without a room of their own... because after 200+ dwarves and the auto room assignments, I always end up with some random schlubs owning 2-3 bedrooms and robbing their kin of a decent sleep at night. Mostly because I don't know if babies and kids need their own bed assignments or not. :D
I haven't read any of the thread and honestly am not even fully fluent in all DFhack's tricks and functions, so.. Is it possible to make a command that gathers ALL items of a type and moves them to the cursor location?It sounds like what you want is a filter for autodump.
Sorry if this has been already suggested in the 40+ page thread, but being able to add search and filtering to the Slab Engraving menu would be nice.Doesnt that already exist?
So you could find the particular Dwarf you want, or only see those that are ghosts, those that are entombed but not memorialised, and so forth.
Sorry if this has been already suggested in the 40+ page thread, but being able to add search and filtering to the Slab Engraving menu would be nice.Doesnt that already exist?
So you could find the particular Dwarf you want, or only see those that are ghosts, those that are entombed but not memorialised, and so forth.
Sorry if this was suggested before; I tried searching the thread and came up empty.I was wondering, (http://www.bay12forums.com/smf/index.php?topic=121451.msg4203086#msg4203086) just as well, (http://www.bay12forums.com/smf/index.php?topic=121451.msg4203217#msg4203217) about my minimap idea as well. (http://www.bay12forums.com/smf/index.php?topic=121451.msg4207962#msg4207962) I kinda lost track and forgotten about working on it any further (the 1x1 minimap-friendly tileset). But I might try to find some time again to continue/finish it up. Real life distracted my tileset production to a halt, but I think I can find time again to do it.
I think it would be neat if the space for the fort mode mini-map could be re-used as a second viewpoint. I know that there is a way to render things "out of view" of the main window, and that it's possible to draw atop what DF want to put on the screen. What I don't know is how hard it would be to render an "off-screen" scene of the mini-map's dimensions and draw it in the mini-map's space.
The mini window would be a viewer only and not a real map in the sense of putting the cursor in it. A DFHack hotkey could zoom the main viewer to where the mini-window is pointing (and it would go nicely with a separate suggestion of having a "back" button to return to previous locations).
The mini window would be ideal for following a unit, and it could also be used to cycle through a series of static views (either checkpoints or hotkey zoom locations, whichever seems more intuitive). Note that it's using normal map rendering so unseen units won't magically appear on the mini window.
For example, some migrants arrive. You follow the first one in your mini-window to make sure they don't get eaten by a tiger, but can continue your megaproject in the main window.
I was thinking of creating a script, or perhaps an addition to copystock, that would let you export stockpile settings for reuse in other save games. This would let us share complex stockpile settings (such as separate stockpiles for High, Medium, and Low value gems).
Anyone interested?
If it doesn't exist already: the ability to inscribe a slab with more than one name, to get some sort of honor roll type building and remove the clutter of having 10000 slabs all over the place. Maybe have an (optional) limit to the number of names per slab.Maybe it should have to be an artifact. We can call it Lord Stanley's Cup. :)
Would really love to see that.
Have you seen autonestbox? It doesn't have all the features you're looking for, but is a big time saver nonetheless.
# # # #
# # # #
# # # #
# # # #
D D D D
################
################
###Pasture######
################
################
D D D D
# # # #
# # # #
# # # #
# # # #
Feature Request: Show an announcement (Similar to "You have struck granite!") if a civ-member is starving or dehydrated.
Reason: Many times miners dig themselves in, a locked door is forgotten, or a dwarf dodges up a wall and is found dead long after. This plugin would help avoid unnecessary deaths.
I don't know how trade is handled in the game, but I'm guessing it should be possible to find and reuse the in build "go home command"
you can do that in vanilla with the "automine gems and minerals" settingWhere do I find that setting?
Oh, is it working now? Are nemesis entries handled? It would be nice to (re?)-add that to DFHack, since a lot of people have asked about it.
taldarus - creating units is not a simple task, largely because DFHack doesn't have access to the code DF uses (and it's unlikely that DF has code to create units from scratch in arbitrary locations in any case).
Oh, is it working now? Are nemesis entries handled? It would be nice to (re?)-add that to DFHack, since a lot of people have asked about it.
taldarus - creating units is not a simple task, largely because DFHack doesn't have access to the code DF uses (and it's unlikely that DF has code to create units from scratch in arbitrary locations in any case).
Can't you use viewscreen_layer_arena_creaturest? It doesn't create hf/nemesis, but seems to do everything else much easier than doing it manually.
Oh, is it working now? Are nemesis entries handled? It would be nice to (re?)-add that to DFHack, since a lot of people have asked about it.
taldarus - creating units is not a simple task, largely because DFHack doesn't have access to the code DF uses (and it's unlikely that DF has code to create units from scratch in arbitrary locations in any case).
Can't you use viewscreen_layer_arena_creaturest? It doesn't create hf/nemesis, but seems to do everything else much easier than doing it manually.
I think the current version of the script is at least that functional.
The idea is to make it so that it works better, including nemesis entries. It just doesn't work yet.
There was a fairly recent version in the DFHack thread somewhere. I seem to remember that friendly creatures turn hostile after save/load with that version. I don't have a link, sorry.
Most recent spawn-unit as far as I know: http://www.bay12forums.com/smf/index.php?topic=139553.msg6197007#msg6197007
If you can make a fully-automated version of spawn-unit with viewscreen_layer_arena_creaturest which works in all cases I would jump up and down with joy.
Sorry, I have only been able to loosely follow what has been going on with the spawn unit script, so these questions may have already been answered.
1. Does it allow for spawning of both friendly and hostile animals?
2. Does it allow for spawning of hostile entity creatures (they don't have to be entity members, but just CAN_SPEAK or CAN_LEARN invaders?)
3. Does it allow for spawning of friendly civ members? (from what I have read this is still a no)
4. Does the friendly and hostile animals extend to semi and megabeasts?
I've been waiting for this about a year now. You truly are a wizard.There was a fairly recent version in the DFHack thread somewhere. I seem to remember that friendly creatures turn hostile after save/load with that version. I don't have a link, sorry.
I've created a dwarf and an aardvark with viewscreen_layer_arena_creaturest, the aardvark is still friendly after save/load, and the dwarf is still working in a workshop. Free workforce, yay!
I can confirm it doesn't add the unit to civs properly. I'll try stitching this together with the old version and see if it works.
I haven't done much work on it myself but I'm told that nemesis/histfig stuff is the hardest part to get working properly. As for code in the game you can use, there's always transformation + pregnancy, but that only works on races that can reproduce, it requires a unit to start with who isn't otherwise occupied with anything important, it can only be done across 3-4 frames, and if the game exits halfway through it might do horrible things to the save file.
I haven't done much work on it myself but I'm told that nemesis/histfig stuff is the hardest part to get working properly. As for code in the game you can use, there's always transformation + pregnancy, but that only works on races that can reproduce, it requires a unit to start with who isn't otherwise occupied with anything important, it can only be done across 3-4 frames, and if the game exits halfway through it might do horrible things to the save file.
Frames are just calls of viewscreen_dwarfmodest:logic(), we could call that from Lua.
Most recent spawn-unit as far as I know: http://www.bay12forums.com/smf/index.php?topic=139553.msg6197007#msg6197007I should come into this thread more often. That is the latest version of spawn-unit I know of except for fixing a typo in line 413, it should read
If you can make a fully-automated version of spawn-unit with viewscreen_layer_arena_creaturest which works in all cases I would jump up and down with joy.
I'd personally like to add a suggestion:Location is already one of the parameters. Equipment is beyond my DFHackery skills, though there are two or three create-item variants none of them seems to be able to put equipment on a unit.
Add equipment and location to the spawned unit.
This way we can fix/work around the lack of invaders in 40.24. We just spawn entire groups of enemies, complete with armor and weapons.
With viewscreen_layer_arena_creaturest approach it's very easy to add equipment.There are a number of issues with spawning intelligent creatures, at least if you want them to function as citizens of a civ. The script above (if hacked to allow it) can spawn a new member of the fort, but he/she has no preferences or dreams or relationships.
With viewscreen_layer_arena_creaturest approach it's very easy to add equipment.There are a number of issues with spawning intelligent creatures, at least if you want them to function as citizens of a civ. The script above (if hacked to allow it) can spawn a new member of the fort, but he/she has no preferences or dreams or relationships.
Spawned creatures can be adopted as pets, so they can make NEW relationships. The problem is that they start out with a slate that's a bit too blank.
Given those limitations, no one delved into equipment.
Ok, getting ready for bed, and figured I would look over the script. I can easily see why the new version of DF makes it so difficult to mod.
For my purposes, however, I see A TON of script that wont be useful/necessary.
Attributes->Will need em, but not randomized. Fixed works for me (again, uniform species pays out).
Identifying marks -> dont need em, every caste is uniform
Soul -> is it needed for something? I wouldn't know, but I don't need atm.
Modifiers-> Again, uniform. Don't need em imo.
Age-> Newborn, so..don't need?
500 lines of code, and no wonder you guys are struggling to make a working script :o
All I need
Race -> At first, I only need one, but I intend to add others (Like Meph, for hostiles). I have yet to 'complete' all of my goals on 99.9% of my 'projects' however. So... :P
Caste -> As specified by the reaction
EG -- Hatchery (workshop) - Reaction -> Hatch devolved worker (CASTE:T0WORKER)
Hostiles wouldn't need ALL of those details would they? I myself have never bothered to study the details of the corpses on my map. Beautiful script btw. Feels a bit overbuilt however.
I can clean it up, eventually, but was hoping someone else would have a simplified form available. Oh, is there a how-to-automate link out there?
I'm ok with hand-writing each one specifically. Lot of mass find/replace in the end, but that would finally give people some more progession, ranging from iron-clad goblins to heavenly-metal wearing angel/guardians in later stages.
DF2014 suffers from lack of sieges, and even 34.11 had the same-sized sieges after a while, so if you beat them in year 5, year 10, 15 or 20 will be trivial.
If a script can spawn progressively harder sieges over the years, either triggers by workshops, things that happen (X population, X wealth, X kills, X items), or time (year5- siege Y, year6- siege Z), that would help a lot of people. There were so many requests/complains all over the forum about lacking attacks, darkflagrance is even making a new Fortress Defense mod. ^^
Would it be possible to make a script that applies a syndrome or activates another script based on the number of kills made with a particular weapon?You should check out Roses' script system. (http://www.bay12forums.com/smf/index.php?topic=135597.0)
unless i missed something none of roses scripts have an argument for number of kills made with the weapon a creature is currently equipped with.Would it be possible to make a script that applies a syndrome or activates another script based on the number of kills made with a particular weapon?You should check out Roses' script system. (http://www.bay12forums.com/smf/index.php?topic=135597.0)
unless i missed something none of roses scripts have an argument for number of kills made with the weapon a creature is currently equipped with.Would it be possible to make a script that applies a syndrome or activates another script based on the number of kills made with a particular weapon?You should check out Roses' script system. (http://www.bay12forums.com/smf/index.php?topic=135597.0)
local syndromeUtil = require('syndrome-util')
local numberErased = syndromeUtil.eraseSyndromeClass(unit, 'name of syndrome class to be removed') --unit should be a df.unit, not a unit id
I was working on a plugin to do that at one point, but the main issue is canceling hauling jobs that have already begun. I can probably figure something out, though.Spawn magma on the hauler?
but the main issue is canceling hauling jobs that have already begun.
I'd love to have the ability to prevent certain jobs from being assigned to a specific Workshop. The Farmer's Workshop is the prime example -- I'd like to have each workshop specializing in one job and some of those jobs are best assigned via the manager rather than via a repeating workflow job (milking/cheesemaking for example).Actually a workflow-esque cron-ish setup for jobs would be nice. Every 3 months, enable any repeat shearing jobs in workshops. Once a year (in autumn) restart the brew fruit repeating job. No idea how you would setup a workable UI for that tho.
More verbose output when loo(k)ing at stones / ores / gems, like the material value, possible products, weight, melting point etc. Would help newbies a lot I assume, and would go well with the digv command.
You can already do that, sort of, using workflowI'd love to have the ability to prevent certain jobs from being assigned to a specific Workshop. The Farmer's Workshop is the prime example -- I'd like to have each workshop specializing in one job and some of those jobs are best assigned via the manager rather than via a repeating workflow job (milking/cheesemaking for example).Actually a workflow-esque cron-ish setup for jobs would be nice. Every 3 months, enable any repeat shearing jobs in workshops. Once a year (in autumn) restart the brew fruit repeating job. No idea how you would setup a workable UI for that tho.
I interpreted that to mean something in the sidebar, which would be somewhat difficult to fit in.More verbose output when loo(k)ing at stones / ores / gems, like the material value, possible products, weight, melting point etc. Would help newbies a lot I assume, and would go well with the digv command.
This already exists; it's the view-item-info script. Unless you mean before mining it out, which is harder to deal with well.
It might be possible to upgrade view-item-info with some sort of dummy object so that unmined tiles can have an info screen, but as PE said it is nontrivially harder to deal with.I interpreted that to mean something in the sidebar, which would be somewhat difficult to fit in.More verbose output when loo(k)ing at stones / ores / gems, like the material value, possible products, weight, melting point etc. Would help newbies a lot I assume, and would go well with the digv command.
This already exists; it's the view-item-info script. Unless you mean before mining it out, which is harder to deal with well.
This already exists; it's the view-item-info script. Unless you mean before mining it out, which is harder to deal with well.
A plugin that changes the background color of floor tiles relative to the ground type. Something would have to be done to retain the ability to discern floors from walls. Slightly darker, perhaps? Any object with a black background would need to inherit this background color. Not sure if the background of grassy tiles should take on a color similar to the grass itself or the hidden soil layer it covers.I'm not entirely sure what you mean. There are only 16 colors in the game, and it would only be possible to have dark but non-black backgrounds for floors that are 8 of those colors. It does seem to be possible to interfere with construction drawing easily, though.
Not sure if this is the right place to ask. But I would really like a plugin that properly disables labors in fortress mode, that haven't been permitted in entity_default.I'm not aware of anything that does that, although manipulator does respect labors in entity_default. Anything that interferes with the game UI has to be written in C++, although I could probably implement something like that (assuming it's small) in the tweak plugin.
I've got a custom civ of animal people who I want to gather plants (herbalist) but not grow them (planter). But during gameplay I can select "farming (fields)" even though it's not permitted in entity_default.
If this has already been created, or is not actually a plugin but something else, could someone please direct me. I'm a DFhack nub :-\
I'm not aware of anything that does that, although manipulator does respect labors in entity_default. Anything that interferes with the game UI has to be written in C++, although I could probably implement something like that (assuming it's small) in the tweak plugin.
(It's possible to implement in-game screens in Lua, actually, but not to interfere with existing screens.)
I didn't even know you could Shift+Enter to toggle whole groups in the first place :PBut... There's a manual...
But... There's a manual...
(Has anyone here ever seen The Greatest American Hero?)
QuoteBut... There's a manual...sometimes hit '?' by accident.
It was an early 1980's comedy series... might even have made it to Australia by now ;)Quote(Has anyone here ever seen The Greatest American Hero?)
No I have not, and I don't feel bad about it, mainly because I'm Australian 8)
It's also listed right at the bottom of the labor screen, except when you've highlighted Mining (no subcategories.)QuoteBut... There's a manual...
I have never read any of the manual. :D The only reason I know it exists is because I sometimes hit '?' by accident. I just watched a bunch of lets plays and tutorials and read the wiki, and now I'm dwarfing along just fine.
I'm not entirely sure what you mean. There are only 16 colors in the game, and it would only be possible to have dark but non-black backgrounds for floors that are 8 of those colors. It does seem to be possible to interfere with construction drawing easily, though.TWBT does it:
Is it possible to just add semi-transparency to the tileset's floor file?No, the floor symbols are used by various stones (http://dwarffortresswiki.org/index.php/DF2014:Stone#Stones_forming_entire_layers). The only thing that separates them is background color.
Oh, I thought you meant the constructed floor tiles. There isn't an easy way to change the color of natural floors, unfortunately, but I'm sure I've seen tilesets that use transparency to adjust natural floor background colors.Is it possible to just add semi-transparency to the tileset's floor file?No, the floor symbols are used by various stones (http://dwarffortresswiki.org/index.php/DF2014:Stone#Stones_forming_entire_layers). The only thing that separates them is background color.
Not sure if this is the right place to ask. But I would really like a plugin that properly disables labors in fortress mode, that haven't been permitted in entity_default.This is done now. I also fixed the issues with Shift+Enter and made categories display as fully-enabled even if they contain forbidden labors that aren't enabled.
I've got a custom civ of animal people who I want to gather plants (herbalist) but not grow them (planter). But during gameplay I can select "farming (fields)" even though it's not permitted in entity_default.
If this has already been created, or is not actually a plugin but something else, could someone please direct me. I'm a DFhack nub :-\
This is done now. I also fixed the issues with Shift+Enter and made categories display as fully-enabled even if they contain forbidden labors that aren't enabled.
An updated Windows build would be appreciated. The only Linux box I have access to right now is part of a high-performance computing grid at work. They probably wouldn't see the humor in me running by a fantasy world simulator on it.
Besides, DF is single-threaded and wouldn't get any real benefit anyway.
I've run into the df-structures problem, myself. So there are only two members of the dfhack team who even know how to update the structures? I tinkered with the df-structures git repository, but I'm pretty sure you need a linux box (vm or otherwise) to compile it. Not sure where it would go anyway...No you don't need linux box. There are some tools that only work on linux but those are for finding new offsets (and similar stuff). Else the dfhack compiles okay on windows (and Mac os(es?) ). The df-structures are not compiled - they are just a list of structures and some global addresses.
Has anyone tinkered with it?
I've run into the df-structures problem, myself. So there are only two members of the dfhack team who even know how to update the structures? I tinkered with the df-structures git repository, but I'm pretty sure you need a linux box (vm or otherwise) to compile it. Not sure where it would go anyway...No you don't need linux box. There are some tools that only work on linux but those are for finding new offsets (and similar stuff). Else the dfhack compiles okay on windows (and Mac os(es?) ). The df-structures are not compiled - they are just a list of structures and some global addresses.
Has anyone tinkered with it?
So there are only two members of the dfhack team who even know how to update the structures?
/snip... whenever I run df with dfhack enabled, I get tons of warnings that the plugins can't run because of missing globals.Assuming you compiled the latest dfhack source for 42.05: Try replacing df/hack/symbols.xml with this one (https://github.com/DFHack/df-structures/blob/dd3e9e7f47a7991e91d5188546be107fdb61015b/symbols.xml).
If you want DFHack to work with 0.42.05, you have to check out the develop branch and run "git submodule update" (this is in the latest compilation instructions).Don't forget to face East while maintaining the Chant. And sacrifice a live chicken.
/snip... whenever I run df with dfhack enabled, I get tons of warnings that the plugins can't run because of missing globals.Assuming you compiled the latest dfhack source for 42.05: Try replacing df/hack/symbols.xml with this one (https://github.com/DFHack/df-structures/blob/dd3e9e7f47a7991e91d5188546be107fdb61015b/symbols.xml).
It works! As you suspected, the symbols.xml file that was automatically installed didn't work, but the updated copy from the df-structures repo did. Thank you so much for your help.That's probably because you forgot to run "git submodule update". In some cases, forgetting to do that and just copying over the newer symbols.xml will crash, but I don't think there were any structure changes that would cause that to happen between 0.42.04 and 0.42.05.
Wonderful :)seconded
Not exactly a plugin, but it would be great if there was a tweak to change the zoom location for "could not reach item" announcements to the location of the item, as opposed to where the dwarf was standing.
It would be nice to be able to find out which civs have access to what when choosing the civ in the embark site chooser. It seems like a dfhack plugin should be able to determine this sort of thing and make a report about which civ has access to what materials and clothing/armor types.
Even if it's not, a terminal-based output like prospect would still be helpful. But we know it's possible because of the sand indicator.
It would be nice to be able to find out which civs have access to what when choosing the civ in the embark site chooser. It seems like a dfhack plugin should be able to determine this sort of thing and make a report about which civ has access to what materials and clothing/armor types.
the question is wether the gui for the world screen is accesible through dfhack? if so, this would be rather easy to do methinks.
I know that, ever since world activation, it has been impossible to spawn migrant waves out of the blue.
Is a 'prospect'-like report possible from the choosing embark screen?
Is a 'prospect'-like report possible from the choosing embark screen?Yes, prospect.
I'm almost positive it's not possible, but I would love to be able to select where a civilization starts. Not sure if this could be interjected into world generation somehow.Probably possible and might be even easy (except the part where we catch df before/in the middle of civ placing, maybe you can place them after even?) but the problem is that nobody looked at generation very closely (or at all?) AFAIK.
I'm almost positive it's not possible, but I would love to be able to select where a civilization starts. Not sure if this could be interjected into world generation somehow.Probably possible and might be even easy (except the part where we catch df before/in the middle of civ placing, maybe you can place them after even?) but the problem is that nobody looked at generation very closely (or at all?) AFAIK.
ferreting out the relevant tokens shouldn't be hard at all, the graphics replacement may be outright impossible given how raws work though; if one can, in fact, hotswap graphics raws (which is hilariously unlikely, mind) then yeah, it may be possible.
[CREATURE_GRAPHICS:FORGOTTEN_BEAST_0]
[DEFAULT:PHOEBUS_P:0:0:ADD_COLOR:DEFAULT]
ferreting out the relevant tokens shouldn't be hard at all, the graphics replacement may be outright impossible given how raws work though; if one can, in fact, hotswap graphics raws (which is hilariously unlikely, mind) then yeah, it may be possible.My understanding is that the game glues together all of the creature graphics into a single texture, and tiles are blitted from lookups to that texture. For example, a crundle might be the square from (128,256) to (143,271), and the creature raws somehow indicate if this is an AS_IS tile or not.
So is there someone who wants to actually try it?And I thought I was the last person on Earth still making Stonesense sprites :)
I could start making up "pieces" that could be put together.
All the body types come from body_rcp, right? I can just make a few layers that add things like shells or proboscises or stingers onto a few base bodies, along with a set of palette swaps and a "special attack" indicator, and wind up with a really large set of permutations of graphics.
(For that matter, what about Stonesense? I know they make dwarves with layers of images. Is there something like this in Stonesense for procedurals, now?)
And I thought I was the last person on Earth still making Stonesense sprites :)
EDIT: and I don't think it's worth parsing the RCP raws. There ought to be enough information in the description to pick out the important qualities. Not sure if the whole thing resides in the DESCRIPTION tag, or if some of it is generated from TLCM_NOUNs and such.
Just to be clear, I didn't do any of the core artwork for Stonesense, which increased a lot with the multitile trees. I just put a tutorial on the wiki and made sprites for my own mod. I'm just not noticing other modders doing that :'(And I thought I was the last person on Earth still making Stonesense sprites :)
Hey, I just took a... I-got-distracted-by-Crusader-Kings-II hiatus. (Although I only really did some icons... which I probably need to check and see if the new professions are represented...)
Could there be an interface hack to make it so you could designate for butchering from the animal's "look" page, or from a cage?Looks pretty simple.
For that matter, a way to estimate muscle mass of an animal from the animal's look page?I'm not sure how to go about calculating it, but displaying it would be easy enough.
Hopefully, I'm not repeating something...
Could there be an interface hack to make it so you could designate for butchering from the animal's "look" page, or from a cage?
For that matter, a way to estimate muscle mass of an animal from the animal's look page?
I had a discussion on the suggestions page, and it occurred to me that autobutcher really doesn't handle deliberate breeding programs well. (Although setting up a script for autobutcher to favor butchering the weak and skinny first could also accomplish something similar.)
--animalhusbandry.lua
local utils = require 'utils'
local arglist = {
'help',
'maxmales',
'maxfemales',
'fullreport',
'dryrun',
'dbg_force_egg_hatching',
'dbg_force_birth',
'run',
'bestworst',
}
validArgs = --[[validArgs or ]]utils.invert(arglist)
args = utils.processArgs({...}, validArgs)
helpmsg = true
for i = 1, # arglist do
if args[arglist[i] ] ~= nil then
--print('invoked '..arglist[i])
helpmsg = false
break
end
end
MAX_MALES = 3
MAX_FEMALES = 5
if args.help or helpmsg then
if helpmsg then
print('You didn\'t give any of the arguments. Displaying help message.')
end
print([[
Arguments:
-help This message.
-run Actually makes it do the thing. The killing of the undesireables.
-maxmales Sets maximum living males. Default is 3.
-maxfemales Sets maximum living females. Default is 5.
-fullreport Tells you stuff about animals even if it didn't kill any and none are pregnant and so on.
-dryrun Only pretends to slaughter them.
-dbg_force_egg_hatching Forces all the incubating eggs to hatch immediately, for debug purposes.
-dbg_force_birth Forces all the mothers to give birth immediately, for debug purposes.
-bestworst Displays the best and worst sizes for a species.
Ex1: animalhusbandry -run -dryrun -fullreport
Ex2: animalhusbandry -run -maxmales 1 -maxfemales 20
Ex3: animalhusbandry -run
]])
end
function pad(str, space, len, front)
str=tostring(str)
if front then
while # str < len do str = space..str end
else
while # str < len do str = str..space end
end
return str
end
function dumpobject(object)
for k,v in pairs(object) do
key=k
val=v
if k == nil then key='' end
if v == nil then val='' end
print ('obj.'..tostring(key)..'='..tostring(val))
end
end
function raceid2str(id)
return df.global.world.raws.creatures.all[id].name[0]
end
function pairsByKeys (t, f, sortfunc)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f, sortfunc)
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
end
end
return iter
end
if args.dbg_force_egg_hatching then
hatched = 0
for derp,item in ipairs(df.global.world.items.all) do
if string.match(tostring(item._type),'egg') then
if item.egg_flags and item.egg_flags.fertile then
item.incubation_counter = 9999999
hatched = hatched + 1
end
end
end
print('debug: forced '..hatched..' eggs to hatch')
end
if args.dbg_force_birth then
hatched = 0
for derp,unit in ipairs(df.global.world.units.all) do
if unit.relations.pregnancy_genes then
unit.relations.pregnancy_timer = 1
hatched = hatched + 1
end
end
print('debug: forced '..hatched..' mothers to give birth')
end
--this whole affair is kind of annoying-- but I can't find a method to look up items at a given coordinate w/out iterating all items.
eggs = {}
function buildegglist()
for derp,item in ipairs(df.global.world.items.all) do
if string.match(tostring(item._type),'egg') then
need = true
for k,v in pairs(eggs) do
if v.x == item.pos.x and v.y == item.pos.y and v.z == item.pos.z then
need = false
break
end
end
if need then
local pos = df.coord:new()
pos.x = item.pos.x
pos.y= item.pos.y
pos.z = item.pos.z
eggs[#eggs+1] = pos
end
end
end
--print('indexed '..tostring(#eggs)..' unique egg coordinates')
end
buildegglist()
function sitting_on_egg(unit)
ret = false
for k,v in pairs(eggs) do
if v.x == unit.pos.x and v.y == unit.pos.y and v.z == unit.pos.z then
ret = true
break
end
end
return ret
end
--dfhack.items.getPosition(item)
function runcull()
if args.maxmales and tonumber(args.maxmales) > 0 then
print('max males to keep is '..tostring(args.maxmales))
MAX_MALES = tonumber(args.maxmales)
end
if args.maxfemales and tonumber(args.maxfemales) > 0 then
print('max females to keep is '..tostring(args.maxfemales))
MAX_FEMALES = tonumber(args.maxfemales)
end
local species = { }
for fnUnitCount,unit in ipairs(df.global.world.units.all) do
if unit.race ~= df.global.ui.race_id and not unit.flags1.dead and unit.flags1.tame and not unit.flags2.slaughter then
if species[unit.race] == nil then species[unit.race] = {} end
species[unit.race][ # species[unit.race] + 1 ] = unit
end
end
for raceid,racelist in pairs(species) do
--racelist = v
--print('there are '..tostring(#racelist)..' '..raceid2str(raceid))
if racelist then
function sortfunc(a, b)
local amin = a.appearance.size_modifier
local bmin = b.appearance.size_modifier
return amin > bmin
end
table.sort(racelist,sortfunc)
--print('best '..raceid2str(raceid)..'='..tostring(racelist[1].appearance.size_modifier)..'; worst '..raceid2str(raceid)..'='..tostring(racelist[#racelist].appearance.size_modifier))
local malecount = 0
local femalecount = 0
local skippedegg = 0
local pregnant = 0
local mkilled = 0
local fkilled = 0
for i, v in pairs(racelist) do
v.flags2.slaughter = false
if v.sex == 1 then -- then gender = 'f'
if malecount > MAX_MALES then
if args.dryrun == nil then
v.flags2.slaughter = true
end
mkilled = mkilled + 1
end
malecount = malecount + 1
else-- gender = 'm'
if femalecount > MAX_FEMALES then
if sitting_on_egg(v) then
skippedegg = skippedegg + 1
else
if args.dryrun == nil and v.relations.pregnancy_genes == nil then
v.flags2.slaughter = true
fkilled = fkilled + 1
end
end
end
femalecount = femalecount + 1
if v.relations.pregnancy_genes and v.relations.pregnancy_timer > 0 then
pregnant = pregnant + 1
end
end
end
outstr = raceid2str(raceid)..':'..tostring(#racelist)..' m:'..tostring(malecount)..' f:'..tostring(femalecount)
if pregnant > 0 then
outstr = outstr .. '(' ..tostring(pregnant)..')'
end
if skippedegg > 0 then
outstr = outstr .. '(' ..tostring(skippedegg)..')'
end
if mkilled > 0 then
outstr = outstr .. ' m-'..tostring(mkilled)
end
if fkilled > 0 then
outstr = outstr .. ' f-'..tostring(fkilled)
end
if args.bestworst then
--print('best '..raceid2str(raceid)..'='..tostring(racelist[1].appearance.size_modifier)..'; worst '..raceid2str(raceid)..'='..tostring(racelist[#racelist].appearance.size_modifier))
best=tostring(racelist[1].appearance.size_modifier)
worst=tostring(racelist[#racelist].appearance.size_modifier)
outstr = outstr .. ' b:'..best..' w:'..worst
end
if pregnant > 0 or skippedegg > 0 or mkilled > 0 or fkilled > 0 or args.fullreport then
print(outstr)
end
--print(raceid2str(raceid)..':'..tostring(#racelist)..' m:'..malecount..' f:'..femalecount)
--[[
if malecount > MAX_MALES then
print('set '..mkilled..' males to be slaughtered for species '..raceid2str(raceid)..'.')
end
if femalecount > MAX_FEMALES then
print('set '..fkilled..' females to be slaughtered for species '..raceid2str(raceid)..'.')
end
if skippedegg > 0 then
print('skipped slaughtering '..tostring(skippedegg)..' females because they are sitting on eggs.')
end
if pregnant > 0 then
print('skipped slaughtering '..tostring(skippedegg)..' females because they are sitting on eggs.')
end]]
end
end
out='species:count m:males f:females(pregnant) m-slaughteredm f-slaughteredf'
if args.bestworst then
out=out..' b:largestsize w:smallestsize (in pop.)'
end
print(out)
end
if args.run then
runcull()
end
Would it be possible for DFhack to change possible embark size? nanofort hasn't been updated in forever and I'd like to play a 1x1 fort again.I thought this was now a vanilla feature?
oh is that what you were going for
df::global::world->raws is already a fully-featured complete corpus of all raws including generated raws in the save and there are a multitude of scripts and plugins that already use it.
The problem isn't a GUI that can call a script on a variety of units, that's easy. The problem is what specifically the conditions should be; appearance modifiers are hilariously obtuse, for example.
thats certainly possible, tho using this tool is likely only marginally less complicated than just writing the selection logic for each script that uses it. i dont think any script in existance has a reason to select units over appearance features, so writing a gui to do this selection would have little practical value.
current_year=df.global.cur_year
newbirthyear=current_year - 20
current_year=df.global.cur_year
(grow++ date)=current_year + 20
https://github.com/DFHack/df-structures has xml files detailing the layout of various struct types in the game, including plants:
https://github.com/DFHack/df-structures/blob/master/df.plants.xml
it does not seem to have an age field per se, but there is a grow counter that one could tinker with and also the twigs and branches and all the other stuff seems to be defined here. so my guess is, not having tried it, that you could beef up the original script/plugin fairly easily to do the thing you want to.
and, again, i recommend to you the gm-editor that lets you explore(and edit!) the very same structs in game.
command_result df_growage (color_ostream &out, vector <string> & parameters)
{
for(size_t i = 0; i < parameters.size();i++)
{
if(parameters[i] == "help" || parameters[i] == "?")
{
out.print("Usage:\n"
"This command grows additively all saplings on the map by 20 years of age.\n"
"With active cursor, work on the targetted one only.\n");
return CR_OK;
}
}
CoreSuspender suspend;
if (!Maps::IsValid())
{
out.printerr("Map is not available!\n");
return CR_FAILURE;
}
MapExtras::MapCache map;
int32_t x,y,z;
int grown = 0;
if(Gui::getCursorCoords(x,y,z))
{
for(size_t i = 0; i < world->plants.all.size(); i++)
{
df::plant * tree = world->plants.all[i];
if(tree->pos.x == x && tree->pos.y == y && tree->pos.z == z)
{
if(tileShape(map.tiletypeAt(DFCoord(x,y,z))) == tiletype_shape::SAPLING &&
tileSpecial(map.tiletypeAt(DFCoord(x,y,z))) != tiletype_special::DEAD)
{
tree->grow_counter = df.global.cur_year
tree->grow_counter = current_year + 20
grown++;
}
break;
}
}
}
else
{
for(size_t i = 0 ; i < world->plants.all.size(); i++)
{
df::plant *p = world->plants.all[i];
df::tiletype ttype = map.tiletypeAt(df::coord(p->pos.x,p->pos.y,p->pos.z));
if(!p->flags.bits.is_shrub && tileShape(ttype) == tiletype_shape::SAPLING && tileSpecial(ttype) != tiletype_special::DEAD)
{
tree->grow_counter = df.global.cur_year
tree->grow_counter = current_year + 20
grown++;
}
}
}
if (grown)
out.print("%i plants grown to 20 years of age.\n", grown);
else
out.printerr("No plant(s) found!\n");
return CR_OK;
}
GM editor too, only affects units but its very interesting to look into the peripheral guts of a unit.
QuoteGM editor too, only affects units but its very interesting to look into the peripheral guts of a unit.
actually no, tho the mode is different. you may be able to inspect other world-objects using the gm editor hotkey (such as furniture, ..). otherwise, you can call it from the dfhack console with the name of the target data structure as an argument.
for example: (not sure about the syntax but should be like this)
gm-editor df
gm-editor df.global.world.raws.inorganics
gm-editor dfhack
df is the root for all the original game data dfhack has access to. note that whatever entry point you choose is the root folder for this instance of the editor gui, so if you inspect a specific object (such as a unit), you cannot use the "back" operation to get to the field containing this object (also the same object may be contained in several vectors). so to just freely browse whats going on in df memory, use the df argument. most of the relevant game data including all raws is contained in df.global.world.
regarding changes to the plugin, ive never done any c++ coding with df so i cant tell you how to compile yourself - but you could try making a pull request on the github and that way possibly get feedback from the original author.
Bogus is also talking about gui/gm-editor. gui/gm-editor can access everything Lua can access, which is nearly everything.
tree->grow_counter = df.global.cur_year
tree->grow_counter = current_year + 20
Would it be possible to make a print-like command for Lua (or just its own script) that accepts markdown syntax? It doesn't need to be 100% faithful (maybe use colors for bold and italic), but something that could make sense out of the same markdown text used in the documentation on GitHub.
Mostly helptext, so that it can be formatted once and used in GitHub, script comments, and on-screen help.Would it be possible to make a print-like command for Lua (or just its own script) that accepts markdown syntax? It doesn't need to be 100% faithful (maybe use colors for bold and italic), but something that could make sense out of the same markdown text used in the documentation on GitHub.
What exactly are you proposing to convert to markdown?
local helptext = [[
=goto.lua=
Move the viewer to a bookmark or a set of coordinates.
Enter *goto* _#_ _#_ _#_ to move the screen to a set of XYZ coordinates.
Enter *goto* _foo_ to move the screen to be centered on bookmark _foo_.
*goto* _help_ prints this command summary.
]]
args = {...}
if args[1]=="help" then dfhack.printmd(helptext) end
but more geared to whatever the norms are for documenting DFHack on GitHub.
Mostly helptext, so that it can be formatted once and used in GitHub, script comments, and on-screen help.Would it be possible to make a print-like command for Lua (or just its own script) that accepts markdown syntax? It doesn't need to be 100% faithful (maybe use colors for bold and italic), but something that could make sense out of the same markdown text used in the documentation on GitHub.What exactly are you proposing to convert to markdown?
Also we could have a function that constructs a viewscreen from the helpstring. Then we could show (maybe interactive?) help screen.At that point it might be easier to just launch a URL in the default browser?
Yes, but not necessarily everyone has a web browser installed, or internet access, or bundled documentation. Also, getting a web browser to open on all systems is difficult (there's a good Python solution, but I haven't seen a Lua/C++ one).I was thinking browsing a local HTML file, but it sounds like even that would be difficult.
(like lua powered browser for wiki ;D)
And a directory navigator plus Nano text editor. (You probably couldn't mess with most DF files, but you could at least look at stuff.)(like lua powered browser for wiki ;D)Oh, that's my dream.
<enum-item name='NeedsUnfulfilled'>
<item-attr name='caption' value='after [varying]'/>
</enum-item>
<enum-item name='Prayer'>
<item-attr name='caption' value='after communing with [deity]'/>
</enum-item>
I'm not really sure what you're saying. Are you saying that you think there's a bug that's caused by DF converting an int32_t to an int16_t somewhere? If so, linking to the report on Mantis would be helpful. We definitely cannot create a patch to change the layout of a structure in DF. (We could change our version of a layout in the XML files, but then our version would be wrong and probably cause crashes.)
Edit: actually, no, I don't know what you're saying at all.
<int32_t name='local_feature' init-value='-1' comment='index into world_data.region_map'/>
<int32_t name='global_feature' init-value='-1' ref-target='world_underground_region'/>
<int32_t name='unk2' init-value='-1'/>
int_32t is a type defined in the C standard and does not have any emotion system defined within it. Your entire issue seems to be based on a fundamental misunderstanding of what enums are (https://msdn.microsoft.com/en-us/library/whbyts4t.aspx).
<enum-item name='NeedsUnfulfilled'>
<item-attr name='caption' value='after [varying]'/>
</enum-item>
<enum-item name='Prayer'>
<item-attr name='caption' value='after communing with [deity]'/>
</enum-item>
Trust me, if any problem you have is related to int_32t in particular then you're barking up the wrong tree. I'll try to address some grievances:
1. Emotions are felt due to thoughts. This is simply how the game works.
2. Needs (desire for prayer) are not thoughts. Thoughts can happen due to lack of need fulfillment, but being focused or distracted is not related to the thoughts system.
3. Animals and sentient beings feel emotions and needs identically, yes, but you're overcomplicating things heavily with all this talk of "enums". the problem is that animals and intelligent beings act the same as regards to thoughts. This has nothing to do with any types being used or anything, it's a problem with function logic. We can work around the issues by manually changing distractedness and stress.
They're not "sorted into the base type"--you're misunderstanding something pretty fundamental here and I'm not sure what. Location features and animal training have absolutely nothing to do with this.
By the "core" of the thought system, do you mean the structure that defines thoughts? That would be unit.status.current_soul.emotions (https://github.com/DFHack/df-structures/blob/d5036d8336d266bcb13e27e702a0acada01227a4/df.units.xml#L1689).
sub render_enum_core($$) {
my ($name,$tag) = @_;
my $base = 0;
my $count = 0;
my $base_type = get_primitive_base($tag, 'int32_t');
int main() {
int_32t array_size; //a new int_32t
array_size=5; //defines array_size to equal 5
int_32t[array_size] array1; //makes a new array made up of 5 int_32t numbers (well, pointers to 5 int_32t numbers, but that's overcomplicating things)
int_32t[array_size] array2; //completely independent of array1! will point to an entirely new data structure, despite being defined in an identical way
}
Another thing I think you might be misunderstanding is that the code you have referenced is not DF code but is simply the structures that DFHack has access to and the names that have been given to them. Each of those structures represent a unique memory reference that can be accessed by DFHack. Some of those memory address expect an integer, some of those integers are expected to be 32 bit integers. That is all the int_32t is representing. And the only thing the enum items are doing is providing easier DFHack coding abilities. Reading the structures can be a bit daunting, but just remember that each entry in the structure is a unique memory address.
That aside, you seem to be saying that you don't want creatures without the [INTELLIGENT] flag to experience emotions, is that correct? Or do you simply not want them to experience certain emotions?
enum items aren't "shared between" anything. df.world_population_type.Animal==0, that's literally all it is, it's more a code helper than something altogether meaningful, useful for forwards compatibility and compile checking but not actually something with special logic attached AFAIK.
I don't know why you seem to think that the emotion system is supposed to only apply to intelligent races. I don't think that was ever a stated goal. Emotions are not part of the [INTELLIGENT] or [CAN_LEARN] or [CAN_SPEAK] tokens, it's something all creatures without [NOEMOTION] will have.
Reading the structures can be a bit daunting, but just remember that each entry in the structure is a unique memory address.They're not unique, really. Most of them describe the layout of certain types of things in memory, and many instances of those things could exist. About the only "unique addresses" are the globals in symbols.xml.
Its anomalous (/badly implemented) behavior for the system, i understand that this is a memory repository for DFhack and imperfect to the final DF product (which dfhack draws and applies code from in order to get effects) but its as close to looking at the memory/code guts as we can get of the game.Memory, sure, but it's hard to infer much about the code just by looking at the memory layout.
Having intelligent units with the GUI and UI created for them (health screen, thought screen, posession screen etc) with the thought and personality system was a goal for intelligent creatures by Toady, the rest of the animal kingdom wasn't initially defined or expanded on, so you could reasonably say it was initially a low level concern (at the moment its not game breaking but pretty instrumental to lots of bugs/petty grievances) or Toady simply wasn't aware about it.
Spoiler (click to show/hide)
Having intelligent units with the GUI and UI created for them (health screen, thought screen, posession screen etc) with the thought and personality system was a goal for intelligent creatures by Toady, the rest of the animal kingdom wasn't initially defined or expanded on, so you could reasonably say it was initially a low level concern (at the moment its not game breaking but pretty instrumental to lots of bugs/petty grievances) or Toady simply wasn't aware about it.
GUI does not dictate behavior. There are many, many, many cases in DF where stuff is happening that you have absolutely no way of seeing.
Feature means terrain feature, not game feature. Stuff like magma pools and lakes. Features are not "counted into world population". the most you can really say is that they're adjacent.
In fact... you're reading the XMLs completely wrong. A line ending with /> means that the next line is independent of that one.
Also, naming variables the same between two independent data structures does not cause any issues with code. Please try to understand basic scoping before making grand suggestions, it relieves a lot of frustration on every side.
And what we do with the structures XML has absolutely nothing to do with what the game itself does. It's descriptive, not prescriptive. Changing around structures will make DFHack wrong, not make DF right.
Also keep in mind that some of the structures in the XML may be wrong - most of the names, whether type names (structs/classes), variable names (struct/class members), or value names (enum members), are our guesses, and some of those guesses are more accurate than others.
A very small number of things (such as all of the bits in unit_flags1 and unit_flags2) are named 100% accurately because Toady told us what they were named, and all classes that have virtual methods are also named accurately because they're visible within memory (via RTTI). Everything else is our best guess, and some of those guesses are already known to be wrong but we haven't gone back to change them because it'd be a pain (e.g. "timed_event" is almost definitely "world_event" based on the messages that appear during load/save, "manager_order" is likely "work_quota" for the same reason, and "ui" is probably "plot_info" based on an error message that never happens during gameplay but is visible in a disassembly).
They're not the same value. Why do you think they're the same value?
Also, intelligent creatures don't show emotions in dwarf mode unless they're citizens, not just intelligent, so the GUI argument sort of falls flat there, too.
Also, "where it pools into" isn't quite right; these structures are part of larger structures but that doesn't mean their behavior is inextricably linked with said larger structures. Just because unit.status.current_soul.emotions[0] is an emotion contained within unit doesn't mean that unit.animal.vanish_countdown is going to do anything to said emotion.
They're not the same value. Why do you think they're the same value?population_id is already claimed by entity_population at df.history.xml#L340
Also, intelligent creatures don't show emotions in dwarf mode unless they're citizens, not just intelligent, so the GUI argument sort of falls flat there, too.
Also, "where it pools into" isn't quite right; these structures are part of larger structures but that doesn't mean their behavior is inextricably linked with said larger structures. Just because unit.status.current_soul.emotions[0] is an emotion contained within unit doesn't mean that unit.animal.vanish_countdown is going to do anything to said emotion.
They're not the same value. Why do you think they're the same value?population_id is already claimed by entity_population at df.history.xml#L340
Also, intelligent creatures don't show emotions in dwarf mode unless they're citizens, not just intelligent, so the GUI argument sort of falls flat there, too.
Also, "where it pools into" isn't quite right; these structures are part of larger structures but that doesn't mean their behavior is inextricably linked with said larger structures. Just because unit.status.current_soul.emotions[0] is an emotion contained within unit doesn't mean that unit.animal.vanish_countdown is going to do anything to said emotion.
No it isn't. Names do not work that way. They are two independent but similarly-named parts of structures. Each unit has its own unit_id and historical figures also have unit_id, but that won't clash with anything.
We don't have to change DFHack's names at all. We just have to figure out how DF's and DFHack's names correspond.
Well, anon fields really ought to be renamed. Other than that, Toady's names can be under a separate pointer to the DF structure (such as DF_official).We don't have to change DFHack's names at all. We just have to figure out how DF's and DFHack's names correspond.
Not necessary to change names, but switching to the DF names might also make it more intuitive. Depending on what Toady has named things.
Who said anything about field names? This is about global addresses only. There are a couple ways Toady could have done it, and we're not sure if it even exposes the global names or not.Also we can have multiple names having same type and same address.
Renaming even one global in DFHack would be a huge amount of work. Aliases should be possible, but would probably be confusing.
So I've been looking into it a little bit and I think it should be possible, but it is outside my knowledge level. I would like to see the ability to choose on the world map where a civilization starts (and if possible put lairs and such). Basically pausing world generation right before the "placement" stage and then doing it manually. Any of the more technically savvy DFHackers want to help me with it? I can write code, but I have no idea how to inject something like that (or even how to pause world generation at the right time)We know very little about what goes on during worldgen itself, and have very limited access to the worldgen process. It is not really possible to do much, with DFHack at least, to alter the behavior of worldgen.
The combine_plants and combine_drinks utils are quite nice but it would be great if instead of a onetime action on a single stockpile they would setup a repeat action on a specific or all stockpiles.
There is a repeat script for that. (http://dfhack.readthedocs.org/en/stable/docs/_auto/base.html#repeat)After spending half a hour looking at the code, I'm left bit askance on how I'd use repeat script for this and decided to ask.
repeat -name food -timeUnits days -time 1 -command [ "combine-plants -stockpile 21" ]
Could somebody make me a script that could remove smoke from the world (I kinda broke a save trying to kill dwarves with exterminate, and now there's smoke everywhere (despite the fact that it SHOULDN'T be doing that, as the dwarves weren't undead))
flows = df.global.flows
for i = #flows - 1, 0, -1 do
if flows[i].type == df.flow_type.Smoke then
flows:erase(i)
end
end
function clearSmoke(flows)
for i = #flows - 1, 0, -1 do
if flows[i].type == df.flow_type.Smoke then
flows:erase(i)
end
end
end
clearSmoke(df.global.flows)
for _, block in pairs(df.global.world.map.map_blocks) do
clearSmoke(block.flows)
end
The entire fortress site starts out as Inside Dark Subterranean. After that, a ray for Outside and a ray for Light Above Ground falls straight down from the highest z-level for every (x,y) position on the local map, changing each tile's modifiers until something that blocks that particular "ray" is encountered.
I'd like a script similar to catsplosion but has only adult creatures give birth. I was looking at the rejuvenate script to see if I could do it myself, but I'm just not knowledgeable enough. Does something else already exist?If you want something similar to catsplosion, looking at catsplosion is your best bet. I don't know how rejuvenate is similar.
I have a fort from a dead/dying civ and the dwarves aren't getting "busy" enough fast enough.
I just found this thread, and it might be useful to know that power-using workshops are indeed definitely possible, as I have implemented them (as wheels) in the moving-machines plugin linked in my sig. Although, they suffer the same problem as steam engines, where they can only directly connect to machine components built after them.I think building-hacks implements power-using workshops already (although certainly not as advanced as those!).
I just found this thread, and it might be useful to know that power-using workshops are indeed definitely possible, as I have implemented them (as wheels) in the moving-machines plugin linked in my sig. Although, they suffer the same problem as steam engines, where they can only directly connect to machine components built after them.I think building-hacks implements power-using workshops already (although certainly not as advanced as those!).
Toady One made some functions virtual for that to be easier however i think because they are used in non-virtual context the compiler optimizes out the virtual indirection and replaces with simple call. Related issue: here (https://github.com/DFHack/dfhack/issues/861)Well, the compiler optimizes out the redirection in DF's calls. The vtable is still there, and I'm pretty sure you can call the method from DFHack, which is what you need (interposing DF's calls wouldn't work, though).
A plugin that seasonally (and selectively) turns location meeting areas off (unassigns and reassigns to location id if it can when re-enabled) because this is the only way im dragging my dwarves out of the tavern. I use other non functional furniture like rented rooms in order to keep their presence constantly within the fortress itself so the outside world isn't unaware of it or disrupt anybody like monster hunters and currently occupied long term guests.Does toggling the "active" flag do what you want? Reassigning zones to locations sounds a little hard, but if the active flag does what I expect it to (namely, disabling the zone while preserving its settings), that would be pretty easy to write a tool for - just toggle building.zone_flags.active on specific zones.
I unassign my main locations off for spring and summer, this means managing 10 different areas (4 main, 6 minor) of which im not finished building all my main sites yet fully, and it would be a great help to have this in the background for me as my fortress expands.
Re: machine connections.I don't remember clearly but the issue is that this function is not called at all because df thinks this machine "can not be connected at all" or something like that. And if you look into disassembly of the machine manager (IIRC) it had switch statement with all supported machines in there hardcoded. You could maybe change it's type to one of those for placement maybe...
Warmist, have you previously tried interposing canConnectToMachine() in this way?
1. If *this is a tracked machine component, then use the normal routine in determining whether it should be connected, already present in your code.
2. Otherwise:
2.1. For every tile in the machine:
2.1.1. If the tile contains the tracked machine component "other", then call other->canConnectToMachine() passing a df::machine_tile_set containing only *this's position.
2.1.2. If the call returns true, then return true.
2.2. Return the result of INTERPOSE_NEXT (assuming the function hasn't returned already in the for loop).
If you haven't, I could probably test it out myself.
2) a script that allows zooming to holdings of a dwarf from a "z" screen with a new keybind. Could be a modification to /gui/room-list which currently can be called for a room that is owned by a citizen, but not for a unit. Currently, it can be done by pressing R and filtering out the list of rooms by the name of the dwarf.I changed a few lines in room-list, it seems to be working now.
keybinding add Alt-R@dwarfmode/ViewUnits "gui/room"
save it as a gui/room.lua, so you don't lose access to original room-list (although modified script seems to be working just fine for both modes - when called on a building 'q' and when called on a unit from 'v')1) similar to other auto-x scripts, a script that would assign a set labor to a dwarf who wants to craft something, and disable the labor as soon as he got a happy thought out of it. Currently, it's a micromanagement nightmare. The idea is that player will set up a dedicated workshop with a recurring task limited to dwarves with a level 0-1 skill before enabling the plugin.Autolabor can be modified to monitor and auto-satisfy substantial part of needs (http://dwarffortresswiki.org/index.php/DF2014:Need#Diversity), if player would dedicate special zones and workshops just for needs.
Autolabor can be modified to monitor and auto-satisfy substantial part of needs (http://dwarffortresswiki.org/index.php/DF2014:Need#Diversity), if the player set up zones and workshops accordingly.
Is it cheating? Dwarves with less unmet needs are more happy, basically making tantrum spiral less likely and removing substantial part of gameplay that connected to it. If it's done by a script, it's basically a happiness boost for free.
Hi everyone,
<... threading, lua, performance...>
Thank you so much for the feedback. I do appreciate it. It definitely helps me understand the issue better.Hi everyone,
<... threading, lua, performance...>
The age old problem: you think something is slow. Solution: never theorize always profile!
AFAIK: the slow part is accessing a lot of data and/or accessing data that is scattered. This is not lua performance issue. We could read from other thread but then it would probably corrupt the data in process. Also if lua was slow part we could move to luajit with INSANE speed gains.
That out of the way there is already at least 2 threads and you can use more if you want to. The two threads are DF and the console. However if you used it e.g. during world gen you can see how it hangs until DF does reaches a point where it updates the view. So if you want to you can use however many threads you want but only in C++ plugins and usually plugins that do a lot of work are written in that way.
TL;DR: threads are complicated. Stuff is slow because it reads/writes a lot of memory, not because computation.
Plus, if your separate thread modifies game memory at all, then you’d either need a mutex for the entire DF core, nullifying all the performance bonuses you get from multithreading, or need many mutexes for different parts of DF memory, which would be difficult to set up and difficult to make consistent across many plugins by many authors.
I fail to see the connection between shearing and slaughter. While slaughtering an animal that has shearable wool does provide wool as well, shearing doesn't harm the animal, and I presume my dorfs shear the wool producing pets migrants brought to the fortress when I order my yearly wool shearing repeat action. Relying on chance to provide the fortress with wool also means relying on chance when it comes to the ability to not fail moods (on top of the shells you can't secure when embarking).
Butchering trolls, if you've hacked that in, ought to produce wool (I've never tried). If you want to decouple the product from its source, I don't see why you wouldn't just spawn it instead of going through some hacky middle route.