Bay 12 Games Forum

Dwarf Fortress => DF Modding => Utilities and 3rd Party Applications => Topic started by: Meph on January 08, 2013, 02:08:00 am

Title: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 08, 2013, 02:08:00 am
I would like to invite everyone who has a basic understanding of modding to come by and post his ideas about possible DFhack plugins. Lately there have been some changes that modders benefit from, the two plugins in question are the steam engine and spatter_add. Another one, autosyndrome, is in work, done by expwnent. Now, what could modders use most? What has always been your dream project, or what restrictions do you need to circumvent?

What I want to collect here are suggestions by modders, as well as feedback by dfhack programmers. What is possible, what is too much work... suggestions by programmers are also welcome. If you think you can write a certain plugin, but dont know how it should best be set up, post it here. Say: I could do this or that, dont know if anyone would need it. All ideas are welcome.

PLUGINS ALREADY DONE


Triggering of sieges, megabeasts, titans, fbs or ambushes
 - Possible: YES
 - Helps boring forts that receive no outside threats.

Runnings dfhack commands by reading out the gamelog
 - Possible: YES
 - For example a dwarf transforms into a new creature called "dwarf using elven magic to grow the crops" just for 1 tick.
 - The gamelog shows this, and the plugin "grow" will automatically be activated.
 - Allows for powerful magic
 - Allows to run convenient plugins, like siren, directly by dwarves.
Notes: Expwnent already wrote a test-version of this once.

Coat items with materials, which affect the wearer
 - Possible: YES
 - 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.

Power-generating Workshop
 - Possible: YES
 - Steam Engine, needs fuel and water
 - Produces power
 - Gears can be connected to the workshop

Poison Coatings
 - Possible: YES
 - Coats weapons, ammo or traps
 - Can use any material
 - Enemies hit with coated material are affected with a syndrome

Autosyndrome
 - Possible: YES
 - Affects creatures inside a workshop area with a syndrome
 - Replaces boiling rocks

PLUGINS THAT PROBABLY WONT WORK OR ARE A TON OF WORK


Creature creation
 - Possible: PROBABLY NO
 - 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.

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.

SUGGESTED PLUGINS

Removal of vanilla DF jobs from unmoddable buildings
 - Possible: YES
 - 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: YES
 - This allows giving useless or barely used buildings more jobs.
 - Fore example woodburner or ashery.

Portal buildings. Enter building #1, worker is teleported to building #2
 - 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.

Ouside only buildings, like the windmill.
 - Possible: YES
 - For example special farms, or for total conversions using solar panels.

Cavern Embark
 - 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.

Liquid generation by workshops
 - Possible: YES
 - Spawn water/magma on a nearby tile.



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.



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.

Magma Aquifer
 - Possible: ?
 - Assign a magma-source to an inorganic material.
 - Should work like an aquifer, but spawn magma instead.
Title: Re: Modders Suggestions and Requests for dfhack plugins
Post by: smakemupagus on January 08, 2013, 02:17:18 am
* Autosyndromes! 
* Power dependent workshops!
* Reliable create other-race creature that joins your fort/military
* Reliable create other-race creature as pets
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 08, 2013, 02:21:52 am
Added smakes suggestions.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Askot Bokbondeler on January 08, 2013, 04:52:38 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on January 08, 2013, 06:11:07 am
Well, the Fallot Equestria mod has a building with a water talisman, that can produce a single tile of 7/7 water after running a reaction and being deconstructed. It would help if workshops could execute dfliqids commands, relative to where they are located.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 08, 2013, 06:31:51 am
Genesis and Masterwork both have these buildings, for water and magma. But I know what you mean. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Deon on January 08, 2013, 06:43:21 am
We already have a steam engine which is cool, but ability to make any workshop to produce power while it's being operated would be nice (like pumps work now). Or a workshop which takes an item and produces power for some time after (like the steam workshop without the water/fuel part) to make generators for mods like Wasteland mod.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on January 08, 2013, 10:48:36 am
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.

Should be possible. I think I heard warmist talking about it.

Quote
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

Quote
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.

Shouldn't be too hard, actually.

Quote
Ouside Outside 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.

Quote
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.

Not sure.

Quote
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.

I guess it's possible. I'm just trying to think of a better way of doing it than just checking every frame if somebody equipped a special weapon.

Quote
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.

Difficult. Early experiments are being conducted.

Quote
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.

Should be possible. There was a similar "friendship" plugin/script at some point.

Quote
Adding wear to armor and weapons
 - Possible: ?
 - Items get worn out by use.

Should be possible.

Quote
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.

I hesitate to call something impossible, but I don't know how I'd approach this.

Quote
Cavern Embark
 - Possible: ?
 - Wagon, pets and the 7 embark dwarves spawn in the first cavern instead of the surface.

It's certainly possible to teleport them down and then revflood. That would be cool. It'd be annoying to have find a place for the wagon but it should be doable.

Quote
Liquid generation by workshops
 - Possible: ?
 - Spawn water/magma on a nearby tile.

Already covered by autoSyndrome and minimal scripting.

Quote
Magma Aquifer
 - Possible: ?
 - Assign a magma-source to an inorganic material.
 - Should work like an aquifer, but spawn magma instead.

I've been trying to trick the game into thinking that a tile is part of a volcano, but I haven't gotten it working yet. May or may not be possible, but it really should be.

I mean, it's certainly possible if you do dumb things like checking every frame, but that'd be an inelegant solution and might impact framerate slightly.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 08, 2013, 12:15:30 pm
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
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.
As for the rest of it i'll try to give some implementation examples later (both for modders and dfhackers)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: peregarrett on January 08, 2013, 12:51:55 pm
Plugin that makes any skill moodable. That is, the artifact cheese with the spikes of quarry bush leaves.
Or at least widen moods to potery, waxworking and such.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bloax on January 08, 2013, 02:03:46 pm
Plugin that makes any skill moodable.
Quote
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!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on January 08, 2013, 02:38:32 pm
Custom siege engines / workshops that function as siege engines.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falconne on January 08, 2013, 02:56:30 pm
Quote
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.

Shouldn't be too hard, actually.

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.

Quote
Ouside Outside 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.

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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on January 08, 2013, 03:17:18 pm

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.

I was thinking it would be a custom job thing.

Quote
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?

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 08, 2013, 03:54:12 pm
Quote
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?

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.
or interpose building.isUnpowered()
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 08, 2013, 05:40:53 pm
Already possible with scripting. See http://www.bay12forums.com/smf/index.php?topic=91166.msg3934299#msg3934299
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.
As for the rest of it i'll try to give some implementation examples later (both for modders and dfhackers)

Yes, this is the main point of this thread. I saw the code in the dfhack thread as well, and might be able to copy an old lua script and add these lines and get it to work. But only as a dfhack command. The imporant part is to run it ingame, simply by running a reaction with a dwarf. A template would be very helpful, in which we could see how it is set-up. "Plugin checks for reaction-example-name-here and runs script-name-here"... Modders know the raws, and coders know the plugins, we just need a connection between the two. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 08, 2013, 05:44:33 pm
Well, I'm working on that connection being me.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 08, 2013, 05:53:26 pm
Quote
Portal buildings. Enter building #1, worker is teleported to building #2
 - 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.
This 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.

Quote
Cavern Embark
 - 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.
A 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.

@Putnam: Good to hear :) Me too, although probably in different ways.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 08, 2013, 06:41:39 pm
I'm pretty sure that changing race is fully possible--in fact, Friendship is in the current version of DFHack and it works in full. You just have to edit the txt file included with it, races.txt.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 08, 2013, 06:51:24 pm
But how to target creatures with it? It would need to be triggered by a dwarf in fort mode, and target a specific creature in a cage. I know you can use full cages for reactions, but as soon as the dwarf picks up the cage, he releases the prisoner...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 09, 2013, 01:37:21 am
https://github.com/warmist/dfhack/blob/master/Lua%20API.rst#id56

I'm thinking triggering on specific reaction (it has limitation that reaction must produce something (e.g. something worthless)) and then searching a cage near to the building and then running some lua that would change civ (maybe modify hist fig so it does not have "enemy to this group" entries and add "member of this group"). "Friendship" is required for different races to do jobs in fort, but e.g. catching trolls and using them as cannon fodder is possible without using Friendship (which btw needs some work >.>)

onProjItemCheckImpact-> allows exploding (or something other you could think of) on hit of any projectile (including siege weapons)
onItemContaminateWound-> allows triggering on weapon contaminating a wound (which is afaik almost always it hits) so magical weapons are possible and/or weapon wear.

https://github.com/warmist/dfhack/blob/master/Lua%20API.rst#id61

This is added by ag and is the way you could "bind" those triggers to actions (i could help tweak, explain and write some of the effects). The mod should have it's own init.lua in raws dir (thus get copied when you create a world. It allows automatic loading/unloading of triggers/actions etc... (you would not want them to mess up the worlds without mod or with different mod)

edit: forgot this one:
onReactionComplete -> allows detecting/editing when reaction finishes thus allowing optional items based on skill, failing based skill (or lack of) transmuting materials in some strange way (e.g. if reagent A is mat X and reagent B is mat Y make the product mat Z), also messing with unit making the reaction (adding skill, changing traits, adding syndromes, killing/healing, making him a ghost etc...)

And other note: ghost can do jobs according to testing in advfort so using expwnent event system, when a new job is created you could check reaction name and assign a ghost to it. It might work in fort mode too.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: CheatingChicken on January 09, 2013, 05:24:42 am
What about buildable Aquifers? For example constructions from specific materials, that act as an aquifer once built (Or even a magma aquifer, if that is even possible at all)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 09, 2013, 05:30:41 am
We have a big list already, and some things apparently work quite easily, since code has been posted already.

How about we take one item from the list, lets say the "triggering megabeasts/titans/fbs", because the lines of code are done, and put them in a plugin that checks for any reaction with a keyword to be run. Whenever REACTION:MEGABEAST_name is run, you trigger the script. Then we could test it out in fortress mode, and see the code behind it that links ot to buildings ^^
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: narhiril on January 09, 2013, 04:52:25 pm
Here's one I'd really like: something that checks a material for a contact syndrome of [SYN_CLASS:/EQUIP] and then - 1) applies it whenever an item of that material is equipped by a valid target - 2) removes it when the item is no longer equipped.

In case this (http://www.bay12forums.com/smf/index.php?topic=121500.0) isn't ever implemented.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 09, 2013, 07:34:29 pm
Quote
Coat items with materials, which affect the wearer
is in the first post. I guess your solution is the better one, directly making the item from the material. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 10, 2013, 06:35:27 pm
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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: peregarrett on January 11, 2013, 02:10:04 am
Oh. How I could forget?
A workshop to replace lost limbs with artificial ones! Urist McSteelHands, aint that great? Or Urist McRubyEye.

Could be possible with transformation syndrome into castes DWARF:MALE_STEEL_RIGHT_HAND/STEEL_LEFT_HAND/etc, but it's not elegant solution.
I guess it should consist of reaction that makes a gas with 1-sec transformation into something and back to heal lost limbs, and a plugin that remembers the lost limbs before and changes the material of restored limbs afterward.

Is it possible to affect speed, strength and such depending on quality of artificial limb?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 11, 2013, 04:19:09 am
@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.

@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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: peregarrett on January 11, 2013, 04:59:50 am
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.
Also, the creature that can "dig" its way through stone - it spatters surrounding walls with special slime, and script auto-replaces them with floor tiles.


Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 11, 2013, 05:03:28 am
@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.

@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.
first one might not be possible (same race unit can't have different materials for it's body parts) might be wrong though...
second one: i was thinking of a shrine to the god that regrows some veins around him. Or an evil (maybe unminable) veins that grow if something bad happens (trapping everything inside)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on January 11, 2013, 05:14:06 am
A plugin to list all citizens who can do interactions and what those interactions are. There is currently no way to see that information in df and it is useful for mods with spells.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 11, 2013, 05:32:08 am
@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.

"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 ?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 11, 2013, 06:17:32 am
@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.

"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 ?
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...).
Your idea is totally doable. Although it would induce some (unwanted?) complexity. Maybe it would make sense for more valuable things than granite?
And yes we can make a maze out of slade with adamantine in center.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 11, 2013, 06:54:26 am
Warpstone are veins that make dizzy, but contain two types of gems: Stable and Unstable warpstone. Unstable can kill, stable is used for warpstone landmines, turrets and the upcoming warpstone lab. You can avoid these by stop digging as soon as you see the "you struck warpstone" message. Usually you find veins first. You only loose a miner if you are careless and dont read your announcments. So much for the theory at least. ;)

Yeah, without moveable workshops my idea wont work too nicely. It was just brainstorming, I made it up as I wrote.

The second idea was just because people like the curious underground structures, but there is no way of modding anything into the game that acts like one. I added "ruins"-veins for example, and made gems called "relics" and "treasures" that only appear in them, and your acheologist can identify/restore them. But I cant make actual ruins you discover. But I guess all this is fairly complitacted and far in the future.

I would rather like to see some progress on the easier suggestions, then speaking theory about even more... ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 11, 2013, 05:29:21 pm
Got another idea: Is it possible to use revflood or something similar to simulate the adventure-mode view (with fog-of-war and hidden areas) for each dwarf in fortress mode ?

Have the surface all revealed, but add a fog of war to mining and caverns, reveal only what a dwarf really sees, 20tiles wide around him... or would that kill FPS ?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on January 11, 2013, 08:57:18 pm
Well, when uncovering an underground or interior space, you already have to send dwarves further in to get it more revealed in the vanilla game, but the range is something like 30-40 tiles iirc.

On your earlier note, what about requiring a certain quality or material of pickaxe to dig certain veins?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 11, 2013, 09:01:59 pm
Yes, but you will always see all enemies. Once revealed, you dont need to scout, set watchtowers or do anything else but scroll there and have a look. You can see enemies even if no dwarf is nearby. Fog of war in fortress mode would be amazing, all other RTS have it, DF is missing out ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 11, 2013, 09:18:39 pm
I don't consider DF an RTS. (Thus why I don't play Masterwork much, hehe. Seems to gamey for me.)

Fog of War could be doable, I think, considering reveal, unreveal etc.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on January 11, 2013, 09:50:40 pm
Perhaps hiding all units more than 20 tiles from a fort member?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 11, 2013, 10:44:04 pm
Isnt there fog of war in adv. mode? I dont want to unreveal to already scouted terrain, I would just like the enemies to be invisible that are outside of any dwarves/pets view-range. And I completely treat DF as a RTS, hence my disinterest in adv mode ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 11, 2013, 11:42:15 pm
Yes, there is, but I think that may be a special case.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 16, 2013, 01:30:51 pm
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"
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: peregarrett on January 16, 2013, 01:48:28 pm
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.
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 16, 2013, 02:31:09 pm
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?

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 16, 2013, 05:36:09 pm
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.
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.
need to write this down, it might be possible.

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?

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.
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...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on January 18, 2013, 12:45:57 am
Messages for loading / random other screens, selected randomly from a txt file.

Not that many loading screens right now, so maybe whenever someone goes to unit screen, etc, the tip shows? Would be useful for mods.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on January 18, 2013, 05:00:03 pm
I think I mentioned it elsewhere, but a workshop material re-claimer/de-forbid/de-dumper.

When doing a mass-dumping or mass-forbid of materials, workshops and other structures made of said material are reclaimed, as to not affect dwarven behaviors. Especially craftdwarves, masons, and carpenters.

What initially happens is that workshops tend to be rendered essentially forbidden when mass-dumping materials (especially from the stocks screen but also when covering a large swath of area in said commands/designations), and are highlighted as forbidden or dump-in-progress; thereby preventing dwarves to make use of them; a rather odd bug. My suggestion is somewhere in the DFHack suggestion board somewhere that talks about it more in-depth.

Considering the Minecart Quantum Stockpiler, this is rendered a thing of the past, but still lingers anyway for those unaware of MC-QSing, and still doing things Quantum-wise the classic way.

EDIT:
Another one I cooked up in another thread. Burrow specialization/exclusiveness. A plugin that automatically produces a primary burrow for all dwarves (which also takes over the entire map on all Z-levels on all tiles), and then erases portions that are claimed as "exclusive" (by highlighting a burrow in the list, and using a function in DFHack to tag a burrow as "exclusive" (all burrows are "shared" by default (can co-exist in the same areas)).

Simply put:
-Initialization assigns every dwarf to a Primary burrow that covers the entire map, top to bottom, all tiles on every Z-level. (Initialization can be it's own separate function to re-do that step, if you want to "clean slate" the burrow assignments)
-IF any other burrows exist that are tagged as "Exclusive" exist, subtract the claimed areas by the burrow from Primary (or universal, or whatever label you want it to have). So now that area(s) is now completely separated from the rest of the fort, and can be assigned to nobles, or as an evacuation zone or something.
-ADDITIONAL FUNCTIONS: Assign burrow for only (under/above)ground. Does a similar function to Init's, but excludes anything tagged with (Above/Under)ground. Great for separating classes of residents between serfs that mine the underground, and the elites living in aboveground condos and palaces.
-ADDITIONAL FUNCTION: Auto-assign residents of burrow by: (age, gender, profession, Wave-# (with Most Recent, and Initial Wave (starting 7) being special functions) etc.). Really useful if you have an immigration center made, or want to give your original 7 special treatment, and you want all new migrants to be moved in there, or you want burrows to be more automated, and not have to keep tabs on them all the time.
-ONE MORE FUNCTION: Panic Mode. Temporarily assign all non-military dwarves to a burrow; an undo function will revert burrow assignments back to previous setup.

That's all I can come up with. But this is according to my rather limited experience/knowledge of burrows and how to use them. Feel free to improve on my idea if you know better. At least, the burrow functions that already exist, and whatnot could be refined a bit more. The assignment by certain factors and whatnot can help. Especially if you want to sort your fort by gender/age/profession and etc. and the exclusive-tagged burrow could be useful for making noble-exclusive, or high-security sectors. The UG/AG burrow assignments could also make some roleplaying elements work out better, like with the scenario I illustrated for it before.

Auto-immigration assignment would work very well as well to keep them out of everyone else's business when they first enter. Especially useful for sorting them out and working on them; especially if you're not using DwarfTherapist to do the job.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on January 26, 2013, 05:33:52 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on January 28, 2013, 11:07:33 pm
Suggestion: a command that claims all flasks in the fortress and which is eight letters or fewer so that I can bind it to one of the in-game hotkeys.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on January 28, 2013, 11:36:05 pm
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 29, 2013, 04:22:56 am
Something preliminary:
here (https://gist.github.com/4662735) put it into scripts folder as e.g. thoughts.lua and type "thoughts" in dfhack.
Gui and sorting to be done later. Also there is severity (don't know if needed to be factored in) and this gives one thought type per dwarf (dwarf could have more than one thoughts of same type).

Thanks to Japa for testing.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on January 29, 2013, 01:20:39 pm
SWEET
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: zach123b on January 29, 2013, 01:38:31 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 29, 2013, 06:40:23 pm
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()
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: zach123b on January 29, 2013, 07:06:50 pm
that's awesome, any way to force a certain kind?

could you make the wilderness spawn stuff? i remember starting a new fortress and there being 3-5 or so groups on the surface but after a couple seasons there would be only 1 or 2 (damn thieving creatures..)
maybe certain kinds such as forcing sharks or lions to enter the area :o   then we might be able to use puppies/kittens as shark/lion bate >:D

another suggestion: how about super traps or something cooler sounding that'll spring on trapavoid creatures? like a trap with a web on it does

now to learn how to use dfhack..
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 30, 2013, 01:27:36 am
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()
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 30, 2013, 01:41:56 am
Perfect, let's see if I/someone else (whoever gets to it first :P) can get a script set up for all that...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on January 30, 2013, 02:08:38 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: TwilightWalker on January 30, 2013, 05:06:52 am
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.

Quote
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Triskelli on January 30, 2013, 05:34:58 am
I know the Steam Engine plugin already exists, but how much more difficult would it be to create a Water Reactor workshop with the same dimensions and requirements as the real thing?  Provides 170 power, needs to be "primed" with water, requires the pumping labor and all the same materials, but doesn't actually have moving water inside of it?  I know I'd definitely appreciate it, because it maintains the spirit of vanilla mega-constructions without the same FPS requirements.

(on that note, if anyone manages to crack workshops that require power, compact logic gates would be a natural first step)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 30, 2013, 05:56:53 am
(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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 30, 2013, 11:28:24 am
Also allowed to have different type:
  • Caravan
  • Migrants
  • Diplomat
  • CivAttack
  • FeatureAttack - unused, does nothing
  • Megabeast
  • WildlifeCurious
  • WildlifeMischievous
  • WildlifeFlier
  • NightCreature
Might need to set up entity for those entries that need it (civ attack/caravan/diplomat etc...) or other fields that are unknown.

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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 30, 2013, 12:14:35 pm
<...>
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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 30, 2013, 01:10:26 pm
I saw some of the table stuff, and... haha, I'll learn that later :P
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on January 30, 2013, 04:02:14 pm
Can dfhack affect pathfinding in any way?

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 30, 2013, 05:06:56 pm
Can dfhack affect pathfinding in any way?

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.
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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on January 30, 2013, 07:04:34 pm
Can dfhack affect pathfinding in any way?

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.
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)
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?

Think of it like how the (D)epot Access key can show the pathfinding range of wagons accessing the fortress (to the depot, at least). But that's only scaled to the wagon's width. In a way, it would be a way of seeing the path that migrants and kobolds would likely take; and depending on how you're building your fort or the walls, a way of seeing if there are any holes in the system (besides the entrances) that they can sneak through that you overlooked. Would be especially useful for multi-Z-level defense building.

It would also be a good way to see if the path to your base is truly airtight, and the only way through (besides the front door) is the gauntlet of death in an alternative entryway. I dunno. Kinda sounds noobish, now that I look back at it.

EDIT:
Considering you can choose the 2 points for it to pathfind ("open spaces only" being optional; as well as building destroyer pathfinding)), it could alternatively help as a way of optimizing military pathfinding to good defense points and such, especially if you have a fancy layout (planned (registers designations like open spaces (up/down, ramps and etc. could be included)); sounds more useful than before)) for your fort. It could even tell you how many tiles (best case scenario) are being traveled. But I think it would be more of a hindsight tool, unless you can use an overlay mode for when you set a designation (but then you would need more points for it to map out with, since you're testing a pathfinding on designated squares for mining), and want to see the distance traveled between points; which alternatively can work as a measuring device as well.

EDIT EDIT:
Alternatively, to save on processing power, the pathfinder can choose the nearest available corner (in case you have rivers cutting off portions of the map), and project a line towards the pointer, drawing a pathfinding vector similar to military waypoint pathfinding (unless those are direct vector paths, then nevermind; but have a similar style of projecting overlay), or something. It can even be integrated with the Depot Access screen to make that function a tad more flexible. Actually, while on Depot Access, hit TAB to change display modes (Merchant, Invaders, Dwarves (which displays the pathfinding you assigned in D-O mode). Personally, it's better than getting a visual by watching migrants reach your fort interior in order to find the leaks.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: wierd on January 30, 2013, 08:05:40 pm
I'd really like to see some additional options to the prospect function.

Specifically, prospected a flood selected region, (such as through the dbc type flood selector) and an option to have it report types and depths of grass tiles.

I recently did some soil and mud experiments, but was unable to accurately get counts on grasses in arbitrary locations, and had to go through convoluted methods to selectively hide and reveal map areas to prospect for other plant types and numbers in arbitrary locations.

Something like:

PROSPECT FLOOD

And

PROSPECT FLOOD GRASS

Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on January 30, 2013, 08:44:10 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: McGrog on January 31, 2013, 10:04:33 pm
I am very interested in workshops that require power, as already mentioned. The ability to get rid of vanilla buildings is also cool, does this consider moods?

The other idea was allowing shops to use water and/or magma the way the Steam Engine does, perhaps through a <wateruser> and <magmauser> tags in the building RAWs? Hopefully could be combined with power use?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on February 01, 2013, 01:31:18 am
the ability to initiate "some migrants have arrived"
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 01, 2013, 01:34:09 am
the ability to initiate "some migrants have arrived"

I posted that script just a few posts ago.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rumrusher on February 01, 2013, 10:50:34 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on February 01, 2013, 05:03:58 pm
But can you select off-map units for flag changing, if you know their id?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 01, 2013, 06:34:20 pm
Actually, I think I'd better ask this here...

Any way to detect a creature's body size?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: peregarrett on February 03, 2013, 12:46:21 am
A plugin to export the description text of item/engraving/creature you're watching, is it posible?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on February 03, 2013, 02:50:44 pm
Also allowed to have different type:
  • Caravan
  • Migrants
  • Diplomat
  • CivAttack
  • FeatureAttack - unused, does nothing
  • Megabeast
  • WildlifeCurious
  • WildlifeMischievous
  • WildlifeFlier
  • NightCreature
Might need to set up entity for those entries that need it (civ attack/caravan/diplomat etc...) or other fields that are unknown.

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

I get an error when trying to run this script
"no unit selected in ui"

I tried viewing a civilization... what I really want is a caravan to show up at the moment...

update:
ok I tried viewing a unit in the unit screen.  no error, but no caravan
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 03, 2013, 02:52:55 pm
You select a unit, not a civilization.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on February 03, 2013, 02:53:21 pm
updated, did, but no caravan

worked for migrants tho
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 03, 2013, 02:57:41 pm
Yeah, it's a bit finicky. Try with some other civs, see if those work. I have a feeling that it may not "force" so much as "coax".
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on February 04, 2013, 09:22:58 pm
a plugin to allow dwarf's with the cleaning labor to also autodump rotten meat!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on February 05, 2013, 12:25:56 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: evictedSaint on February 05, 2013, 12:56:42 am
I would appreciate the ability to turn off ghosts.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on February 05, 2013, 04:06:27 am
An unstacking utility for seperating stacks of coins/bones/etc
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 09, 2013, 01:42:00 pm
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. I have a bit of a thing I'm planning to do with Fortbent that requires reassigning a creature's soul's race ID, then checking that for various stuff, and...

i want to implement Lord English possession in the game and need DFHack to do it and I don't want user input to be required at any point
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on February 09, 2013, 01:50:25 pm
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.

Isn't that what Autosyndrome will do?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 09, 2013, 02:14:03 pm
Autosyndrome appears to rely on boiling stones, as far as I can tell. That's what I meant.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on February 09, 2013, 02:43:25 pm
I thought that the purpose was to apply syndromes without dwarves having to get caught in clouds. If not, there's no difference to vanilla and it would do nothing, so it must be that it applies syndromes directly during reactions.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 09, 2013, 03:22:31 pm
yes, reactions. I don't want it to involve reactions at all.

What I basically want is something that will allow this to be possible:

Code: [Select]
-- 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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on February 10, 2013, 02:24:47 pm
Should be possible without all that much work. I probably can't get to it any time soon, though.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on February 10, 2013, 03:19:33 pm
After struggling with a Kea and Minecart problem that repeatedly crashed my game (until I decided to bury the damned (in many ways) minecart once and for all in a puddle, avoiding the bug initially, and then sealing it inside an obsidian black-box (DFHack, Liquids-made monolith), to prevent the bug once and for all); I thought up a good couple more plugins.

A Thief's Eye kind of plugin. Simply put, it lists your most valuable, or most-likely-to-be-taken items (or children or animals), be it by kobold or kea, or any other kind of theif. And if possible, also markup the odds of a child thief and/or the intended target child, along with the items. If possible as well, find a way to clear the "attraction" to said item of the creature in question hunting it down. kill their interest in the item in question so they can stop pursuing it, even if it means they'll still be hanging around idly as if they were scared off from the steal.

I don't think it's possible, especially since I also don't know enough programming to know how it would work or be developed, but an error-checker of sorts to scan all items and characters for any gamebreaking flaws/bugs (like my minecart that kills my game anytime it goes missing/destroyed/deleted (via DFHack)). It's mostly informative, But it can also auto-dump (or auto-assign dump/forbid) any problem-items so they can't be tampered with further. Autodump can also be given a problem-item autodump function as well, though it would have to work in tandem with the scanner to work properly.

And one more comes to mind, but a siege/ambush heads-up plugin would be interesting, as if your dwarves (especially in aboveground forts) can see the armies coming in from over the horizon. Basically, it would tell you at least the chances of it happening, based on your fort value, or whatever values either ambush or siege responds to. Of course, it doesn't need to be a HUD or sorts, but a DFHack command. Especially also helpful if you want to know what faction is coming after you if there's more than one civ pissed off at your mere existence. Prepare accordingly.

EDIT:
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. Named after Death-Note, since it's mostly by heart-attack the creatures in question are killed by. Death may not be immediate for some, and I am uncertain about the undead, and how it may affect necromancy. Nonetheless, I think this would be a fun, yet exploitable, plugin. Gore can be an option, which explodes the creature on the spot, as if they ate a full serving C4-potato salad.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on February 10, 2013, 03:23:50 pm
I just thought that thieves went for the nearest target available
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on February 10, 2013, 03:29:35 pm
I just thought that thieves went for the nearest target available
If 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.

On that note, a Heads-Up-Display plugin that can tell you what item/unit units are going after, be it a dwarf building something (or an artifact), or a thief targeting something to steal; it could be viewed by the (v)iew unit on map, or (u)nit list screen options. Maybe even see the target of intent for anyone going berserk, hunting, or assault. I'm getting tired of guessing the items/targets that those damned birds/berserkers were going after to find the source of my problems. Lotta trial and error, and checking logs, until I found it out.

A pathfinder/path-seer tool could also be of interest. It basically shows you the path a unit is taking to reach it's desired destination (task, target, or otherwise (idle/partying/going to bedroom/dining hall)); being a highlighted Point-A (unit) to point-B (destination point) path, and the course they're taking to get there. See what crazy path they're going to get their job done. Also helps where sieges and ambushes are concerned as well; although exploitable when it comes to placing military to defend. Or as a means of faux-hindsight when placing a gauntlet of death for invaders. Knowing where they come from, and taking care of it accordingly.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: RickRollYou2 on February 12, 2013, 08:18:40 am
...
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.

"slayrace him" already kills a singular particular creature (IIRC by setting the blood level really low so that it "bled out") so...  :P
Exploding in gore on the other hand... I'd like to see that too  ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on February 12, 2013, 05:57:10 pm
Maybe set all their body parts to evaporation temperature?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 12, 2013, 06:02:02 pm
I'd say setting blood_count to 0 is good enough, hehe.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on February 12, 2013, 06:06:31 pm
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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on February 13, 2013, 02:03:22 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on February 13, 2013, 02:36:04 am
Just make sure to set the velocity to something like 15km/s, wouldn't want bronze colossi getting off easy now would we?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on February 13, 2013, 02:38:04 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falconne on February 13, 2013, 02:46:56 pm
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.

I have a WIP plugin that does this but I put it aside because I thought people wouldn't care for such statistics. I could finish that if there's enough interest.

Edit: I've published it here: http://www.bay12forums.com/smf/index.php?topic=123279.0
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 16, 2013, 05:15:04 pm
RISE, O GREAT THREAD, FOR MY CREATIVE BANKRUPTCY DEMANDS IT.

Quote
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.

Itemsyndrome (http://dffd.wimbli.com/file.php?id=7471) does something similar to this; the difference is mostly in the spatter, which I didn't think of. I think I could add that to itemsyndrome...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on March 16, 2013, 05:19:49 pm
Something to fix the caverns in adventure mode so you can actually encounter creatures in them
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 16, 2013, 05:25:03 pm
Something to fix the caverns in adventure mode so you can actually encounter creatures in them

My instant transmission script for the DBZ mod showed me that there are creatures everywhere in the caverns--it's just that they're damn hard to find because the caverns are so difficult to see in. Here, try it out:

Code: [Select]
-- 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)

Some info is superfluous, but it's all harmless.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on March 16, 2013, 05:53:21 pm
I've been walking around spamming reveal in all my test explorations, haven't seen any creatures. Additionally, the brand-new region-pops indicates 0 for all cavern creatures except the animal people (who are still absent).

Hmm, your script isn't turning up any either, but it's certainly disconcerting to know that at any moment there's about 2-12 demons far below me :D

EDIT: Strange, I generated a new world and now all three plugins show the existence of cavern creatures. Scanning down in the caverns in both adventure mode and fort mode shows cave critters. Huh. I wonder why all the other worlds I've had so far don't have any?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: narhiril on March 20, 2013, 07:10:32 pm
I noticed the "add wear to armor" idea, but what about removing wear from clothing?  The latter would be more fun, in my opinion.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: D_E on March 20, 2013, 08:16:34 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 20, 2013, 08:18:15 pm
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?

1. Yes
2. Yes
3. Not really, no.

There was a script earlier in this topic, I think, or the main one, that does all that.

Also: yes. (https://github.com/peterix/dfhack/blob/master/Lua%20API.rst)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: D_E on March 20, 2013, 09:46:26 pm
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?
1. Yes
2. Yes
3. Not really, no.
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on March 20, 2013, 11:24:40 pm
Very interesting. It's hackish, but it should work. Any one unit could be used to spawn any unit type that can be created via pregnancy and live birth. Maybe eggs but don't count on it.

You might have to manually put in a few syndromes. I don't know if those can be created on the fly in DFHack, but it probably wouldn't be TOO hard.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 20, 2013, 11:25:50 pm
I don't know if those can be created on the fly in DFHack

Knowing the syndrome structs, I don't see why not.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 20, 2013, 11:53:11 pm
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: D_E on March 21, 2013, 03:16:56 pm
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

Here's the outline of the technique I had in mind:
Step 1: Workshop reaction induced transformation
This is the step I'm most unclear on. An exploding rock could definitely be used, but I think I saw someone say the DFHack could be used to inflict syndromes in response to reactions and was much more reliable than exploding rocks.

The target creature should be transformed into the unit type we want to spawn. The transformation should last for ~10 ticks or so.
Step 2: Transformation induced pregnancy
DFHack should induce pregnancy in response to the transformation beginning. The truetransformation (https://github.com/peterix/dfhack/blob/master/plugins/trueTransformation.cpp) plugin responds to syndromes beginning, and can probably be adapted. The Catsplosion (https://github.com/peterix/dfhack/blob/master/plugins/catsplosion.cpp) plugin demonstrates how to induce pregnancies with DFHack. The pregnancy should be set to finish in one tick.

So, to summarize, the pregnancy induction code from catsplosion should be hooked into the syndrome response code from truetransformation.

If all goes as planed, the dwarf completing the reaction will transform into the target creature type, give birth 1-2 ticks later, and then turn back into a dwarf after a total of 10 ticks or so.

I just hope that syndrome-transformed creatures give birth, and give birth as their transformed unit type and not as their true unit type.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 21, 2013, 04:48:07 pm
...D_E, you may want to look at the post I was quoting for context...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on March 21, 2013, 04:55:29 pm
Here is an idea:

Write catsplosion for different pet types, with a lower outcome. Not a petplosion, maybe just a petburb or so... then hook it up to a workshop reaction and call it "elven magic". Fast breeding for warbeasts, nice. ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: D_E on March 21, 2013, 10:04:03 pm
...D_E, you may want to look at the post I was quoting for context...

Whoops! Sorry, I thought you had replied to his most recent post (which was a reply to my post).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 21, 2013, 10:21:52 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on March 23, 2013, 10:14:08 pm
autoSyndrome lets you pass the location of the reaction to a DFHack command. Many dfhack commands are set up to work by the user moving the cursor somewhere then running the command, rather than typing in the coordinates manually.

What sorts of existing commands would be useful to tweak to allow you to type in coordinates manually, and thus use them from autoSyndrome?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Heimdall86 on March 23, 2013, 10:19:14 pm
I mentioned this in the official dfhack thread but ill repeat it here. I would like to see a gui for tiletypes like there is for liquids. I think being able to change any floor or wall to whatever material we want could be really cool.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on March 23, 2013, 10:22:13 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on March 23, 2013, 10:58:59 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 23, 2013, 11:00:23 pm
I skipped that part because my hypotheticals always assume something-or-other can happen anyway.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on March 23, 2013, 11:25:17 pm
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.

removebadthoughts should probably take a unit id, not a location, in case there are multiple units in the same location.

The others make sense. I'm hesitant about the +1 in each direction thing. It seems like there should be a better way of doing it. I'll think about it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on March 23, 2013, 11:27:13 pm
PS: I implemented outside only buildings. Was pretty easy.

https://github.com/expwnent/dfhack/blob/outsideOnly/plugins/outsideOnly.cpp
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: D_E on March 24, 2013, 11:49:26 pm
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?

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?

Quote
[SYNDROME]
[CE_BODY_TRANSFORMATION:PROB:100:START:0:END:5]
[CE:CREATURE:RABBIT:MALE]
[SYN_CLASS:\PERMANENT]
[SYN_CLASS:HUMAN]
[SYN_CLASS:MALE]
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: D_E on March 25, 2013, 12:55:16 am
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...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Symphorien on March 25, 2013, 06:46:41 am
I was fiddling around with some temple type workshops and was annoyed that I counldn't increase the chances of a reaction working by the users skill level. I don't know if that is possible with a plugin, but either way it led me to another thought:

Could reactions be limited to a certain skill threshold. For exemple only legendary smiths could create certain weapons, or only skilled cooks could make a certain meal with high value.

But another interesting possiblity would be to restrcit construction of a workshop to a skill level also, permitting a sort of technological progression.

Any of these ideas possible?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on March 25, 2013, 07:37:48 am
trueTransformation doesn't work in the arena because arena mode doesn't have a "clock".
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Spish on March 27, 2013, 05:58:16 am
How about a way to toggle the vampire identity label in fortress mode? Presently, it automatically labels someone who drinks vampire blood, and that just ruins a whole lot of potential community fortress murder mystery fun.

Also, is it feasibly possible, through hacks, to allow any item to be placed inside weapon traps? Like say, loading one  with furniture, statues, bits of corpses, old socks, doors, water and vomit, live vermin, so on and so forth. In other words, turning them into prank traps ;D
Perhaps by temporarily adding the weapon label to everything? On a more practical note, this would be neat for arming recruits, too.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: robertheinrich on March 29, 2013, 10:35:19 am
Quote
Adding wear to armor and weapons
- Possible: ?
 - Items get worn out by use.
Not 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.

Quote
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.

Quote
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.
Definitely 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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Askot Bokbondeler on March 29, 2013, 10:43:14 am
Quote
Adding wear to armor and weapons
- Possible: ?
 - Items get worn out by use.
Not 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.
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: robertheinrich on March 29, 2013, 11:19:00 am
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

Well I'm assuming that "wear" is an attribute for all items (like material, weight, temperature etc). If that's the case it should be no big deal to write a plugin which adds wear to certain items every couple of ingame months. Destroying them however might be much more difficult. It would be necessary to clear all references to be on the safe side. Items can have owners, be used for jobs, be inside a container, be a container which holds things, ... I can try to look into it when I have some time.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Askot Bokbondeler on March 29, 2013, 11:21:44 am
i'd be very grateful if you did
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on March 29, 2013, 05:01:27 pm
Suggestion:

getbloodcount

For knowing just how much bleeding-related punishment a creature can take.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 29, 2013, 05:11:13 pm
Suggestion:

getbloodcount

For knowing just how much bleeding-related punishment a creature can take.

Easier n' pie.

Code: [Select]
-- 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))
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: IamanElfCollaborator on March 29, 2013, 05:17:19 pm
Two things;

1. A plugin that spawns a particular creature's corpse?
2. I asked this in the main thread, but how do you activate friendship, embark, and migrant functions in Dfusion?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on March 29, 2013, 07:20:48 pm
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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: robertheinrich on March 29, 2013, 07:37:17 pm
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).

Try this instead (tested it and it works):

Code: [Select]
-- 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))
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 29, 2013, 07:45:12 pm
yeah, sorry, forgot an end in there :x
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on March 29, 2013, 07:49:15 pm
Much obliged.

Now, to figure out how on earth a child can have more blood in him than all but a very few of the adults... Just four more years until he reaches full size.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on April 01, 2013, 07:45:59 pm
Is it possible to make children follow around a specified dwarf in the same way that trained animals follow their trainer?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on April 01, 2013, 09:43:41 pm
With the triggering, is it possible to trigger a specific megabeast, or specific race to attack?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 02, 2013, 12:27:36 am
Specific race yes, but the triggers in the entity have to be met. For example a certain amount of dwarves or fortress wealth. The siege hits instantly when you run the script. All others have a change of appearing, but sieges do work flawlessly.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on April 02, 2013, 12:57:30 am
With the triggering, is it possible to trigger a specific megabeast

I wish.

or specific race to attack?

Oh yeah. The version I posted in my modder's scripts topic has that.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on April 02, 2013, 12:56:00 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on April 02, 2013, 02:28:35 pm
Oh, derp. I remember that when I was playing Dwarf Fortress for once (the Dragon Ball mod), I had a saiyan give birth on the full moon--when all saiyans are Oozaru. She gave birth to two golden oozaru, who then proceeded to kill half the fortress. (They have [CRAZED] as a tag). Not sure if they'd be hostile without the CRAZED tag, though :P
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sorcerer on April 02, 2013, 04:20:09 pm
How about a reaction with a more controlled output, would that be possible?
So instead of having a reaction with:

   [PRODUCT:80:1:STUFF:RUINED_STUFF:NONE:NONE:NONE]
   [PRODUCT:20:1:STUFF:REFINED STUFF:NONE:NONE:NONE]

you would have a reaction output which actually has a 20% chance of getting one item and 80% of getting the other.

Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Lav on April 02, 2013, 05:23:13 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: robertheinrich on April 02, 2013, 07:30:44 pm
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.

What exactly would you want to search for?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Lav on April 03, 2013, 05:54:10 am
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.

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on April 03, 2013, 10:03:30 am
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.

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.
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)?

And if you want a preview of the site using Japa's IsoWorld, exact coordinates of the region tile to look for. Of course, Japa will need to toss in a coordinate feature to his program to make it most useful. Way easier than using references from the overworld map, and scanning region tiles for reference when searching for a specific region to get a better idea of how it would look.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on April 05, 2013, 06:24:29 pm
Is it possible to force selling an artifact?  I know there worth a ton, but sometimes I just don't want/nor need one.  It would be nice to somehow mark the item as a regular masterwork item inside the trade screen.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rumrusher on April 06, 2013, 06:01:52 am
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?

uhh I worked on that back when I was researching if love can bloom in the battlefield.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on April 07, 2013, 11:59:00 am
What were the results? Anything interesting?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on April 11, 2013, 11:49:35 am
A search plugin for the pasture / cage menu, similar to what Falcone added for other things.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: robertheinrich on April 11, 2013, 12:54:29 pm
A 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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rumrusher on April 11, 2013, 01:24:05 pm
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)
(http://i488.photobucket.com/albums/rr244/dangdoodle/olonwut2.png) (http://www.bay12forums.com/smf/index.php?topic=50383.0)
click the image for the thread. Olon Toolpalace is Half-Dwarf half-cat hybrid made to prove that this is true.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: D_E on April 11, 2013, 02:01:17 pm
What were the results? Anything interesting?

Transformed creatures give birth as their current creature type, I believe.

The proof-of-concept is as follows:
1) Give dwarves a vapor-breath weapon that turns dwarves into female cats.
Code: [Select]
[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 location
3) Draft a dwarf into a squad and send him to attack an animal somewhere.
4) Once the dwarf turns himself into a female cat, run catsplosion from the DFHack prompt
  a) The dwarf will give birth to one or more kittens.
  b) These kittens are treated as pets, although the Animals list available off the 'z' menu will claim that they are "not tame," whatever that means.
     i)Only kittens born from transformed dwarves are listed as such, kittens birthed from actual cats as a result of catsplosion are listed as tame.
  c) Once the dwarf reverts back into a dwarf, his relasionships list can be checked. This will show that he considers the kittens to be his children.
    i) As the kittens initially have no names, the description screen will give a mangled sentence when describing the dwarfs offspring.
    ii)Once the kittens adopted an owner they receive a name, which is used on all screens from then on.
  d) Male or Female dwarves can be used. The game did not crash.
  e) The dwarf parent will receive the usual negative thought if one of the kittens dies (lost a child to tragedy recently).
    i) On a totally unrelated subject, the kittens can still be designated for slaughter from the 'z' animals menu despite being listed as "not tame."
________________________________
In conclusion:
1) DFHack can apparently be combined with regular Syndrome-induced body transformations to spawn arbitrary units.

2) Due to the fact that body transformations cure all physical wounds, as well as the risk of strong negative thoughts from the death of the offspring, it would be better to use some creature other than the dwarf performing the reaction as the parent.
  2a) DFHack can read the global units list (I believe). It could therefore scan the list for a standard 'homunculus' pet (for example), and use the body transformation/impregnation trick on the first such creature it locates. Obviously, I have not done a proof-of-concept for this idea.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on April 11, 2013, 02:38:40 pm
That homonculus is a great idea...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on April 11, 2013, 03:37:44 pm
So this means that "spawning" creatures is possible, could you then use the makeown dfhack script to turn them into a member of your civ?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 11, 2013, 03:44:29 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on April 11, 2013, 04:49:02 pm
A 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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: robertheinrich on April 11, 2013, 04:59:15 pm
Thanks, another one I'd find very useful is either search function for workshop profiles, or just sorting everyone alphabetically.

I think that's already possible as well. Try pressing Alt-Shift-N (for alphabetic sorting) in the workshop profile menu. I can't verify it right now but it should work in most screens where you get a list or your dorfs/units. Requirement is dfhack 34.11.r3 and having the stuff from the default dfhack.init active.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on April 11, 2013, 07:41:17 pm
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.

But any dwarven caste will still have a chance of naturally occurring correct? Or has the 0 pop ratio been fixed?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 12, 2013, 01:05:03 am
No, it has not. So you might end up with one of your "slave caste dwarves" as a migrant.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: RickRollYou2 on April 12, 2013, 04:54:16 am
Is it possible to create a plugin to make bridges longer? Much like falconnes' construction helper?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Trapezohedron on April 12, 2013, 07:00:25 am
Is it possible to make a reagent-product simplifier? Or better illustrated:

Code: [Select]
[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]

Basically, it accepts any weapon for input materials, and produces an output of the same type of object, albeit in adamantine form.

If I put an axe for the weapon, it will output an adamantine axe.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Greiger on April 12, 2013, 08:40:38 am
Is it possible to have a plugin run during worldgen and prevent carnivore civs from starving?

- I can't be the only one with a carnivore fortress race that forgets to remove [NO_EAT] and [NO_DRINK] from the race until half a year after embark.


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?

- I'm tired of my metalworkers studding my bolts with gold just because the ammo stockpile is 2 floors up, while the finished goods stockpile is a whole 3 tiles east.  I could set the workshop to take from the pile, but then they wouldn't take bars directly from the neiboring smelter.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on April 13, 2013, 04:40:38 pm
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falconne on April 13, 2013, 07:56:31 pm
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?

That is already in DFHack: https://github.com/peterix/dfhack/blob/master/Readme.rst#guiworkshop-job
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on April 13, 2013, 10:55:23 pm
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

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on April 14, 2013, 01:57:06 pm
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
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.
Since pathfinding is mentioned, I just wanted to refresh my old idea of a Pathfinding GUI plugin.


For a moment, I thought the GUI/Guide-Path was a pathfinder tool that did similar to what I was suggesting; but it could work as a decent reference to what I was suggesting earlier (arrow markers and all). If you look at what I'm currently doing with the Bloodaxe megaproject, as well as what I did with TamedEarth (pretty much the same system), instead of trial and error when the traders or migrants or invaders arrive to find any holes in the pathfinding system (or making a burrow in an arbitrary spot, and sending a dwarf to those coordinates and following them), I get a GUI overlay similar to GUI/Guide-Path that can work alongside the traffic designator (make that more efficient/effective) that can show me the most likely/shortest path dwarves and wagons (especially the wagons) would take. GUI/Pathfinder could be a good name for it.

We can either select 2 different spots, and estimate the pathfinding from those two, or if you already have a Depot, choose choose the depot (if you have more than 1; in case you have decoys, or more secure ones, or specified ones for elves and such), and from there, choose a point of origin, and then observe the path (more reliable than Depot Access's blots of colors, now you see a likely path most-all would follow from a common origin; We know the Depot can be accessed, but since we carved out some moats and a trap gauntlet, what's the shortest path the wagons and invaders would take?) in free-look mode to find any holes in a runaround system. This can also help out for any trap gauntlets you make, to see if the enemy will even bother going through it all, and instead take a different one you made, or an unintended backdoor you forgot about.

This could also help for establishing an efficient goblin grinder without needing to make an overly-complicated pathway. That is, if you want to keep a simple looking fort.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on April 20, 2013, 03:19:56 pm
I could use a plugin that lists syndromes with "Can do interaction" on all citizens. This would be cheaty in vanilla, with listing of vampires and werebeasts and what have you, but would be useful for mods. I play a mod where we have spells that are syndromes / interactions and there is no way to list who has what. It would also help with autosyndrome plugin, listing all the buffs from Power armours, amulets and what have you.

> Those are itemsyndrome
Those aren't just from worn items. (I can figure out the equipment just fine :)) The main problem here is that spells are learned at a workshop and give the citizen a syndrome "can do interaction". This is listed in combat {r}eports, but I don't have a list of spells this citizen can cast or a list of spells everyone can cast, which would be useful. Otherwise I need to be very watchful and have a spreadsheet. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on April 20, 2013, 03:21:26 pm
Those are itemsyndrome :P

I think this could be doable.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on April 24, 2013, 11:02:02 am
Copy - paste for stockpile settings or workshop profiles.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on April 25, 2013, 01:19:50 pm
Just started a thread that led to a pretty intriguing idea. DF-Enhanced Minimap:
1x1 Pixel Tileset for mapping and fortress megaproject referencing (http://www.bay12forums.com/smf/index.php?topic=125463.0)
Enhanced Minimap Ideas based on thread (http://www.bay12forums.com/smf/index.php?topic=125463.msg4203032#msg4203032)

The other feature ideas I listed in the second link have not been illustrated yet, but I think you'll have a good idea of what I think is possible.


Naturally, the pixelated minimap would generate pixels according to data on the map and so forth, instead of just being a tileset and everything like I provided in the thread. That way, it can be most user-friendly between tilesets from Curses to Graphical ones like Phoebus and Ironhand and classic Mayday (as well as user-friendly to the End-User and Programmer); even different mods will work just fine between uses, since it's raw data being read and rendered, instead of being interpreted from screenshots periodically made and interpreted (which sounds more resource-costly); hopefully debugging would be much easier to handle as well basing off raw data and modder/user input, instead of interpreting pixels. Generating the map based on the individual cells should be much easier to generate, than having it auto-screenshot a pixel version of the map every time; and all cells will be accounted for in the process, since it's a code interpretation of the game generated, instead of just being a screenshot at a time. Considering the pixelated nature of the minimap, it shouldn't be all that resource-intense, seeing as we also have a minimap in-game (albeit, not as useful detail-wise).

If you really want to go nuts with the idea; make a GUI/Minimap-to-Fullscale-Overlay function to render an overlay of what's on the minimap into DF at beast interpretation of what's visible. Good for if you want to designate more precisely and such, I guess.

EDIT:
The unit-tracker idea came from playing some Rollercoaster Tycoon, and making good use of that minimap. Actually, some of the ideas are somewhat based on that concept. I'm just elaborating it a bit more for the sake of DF-players. Especially if you have a huge region, several dozens of dwarves, and so on, and you want to simplify things, or curiosity piques, and you want to know exactly what is where without having to guess with a prospector tool (which the minimap can use reveal or not as an assisting hand), or without having to use loo(k) or (v)iew creature everywhere.

This also would help in case you think you got every invader during a giant siege, but the label is still up, and you don't know exactly where they are and how many of there are there; and zooming from the unit list is getting tedious or not helping as much as you'd think.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 25, 2013, 02:00:33 pm
Hey, thats something I havent seen before :)

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. :)

(http://i.imgur.com/1NdKkR2.png)

Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on April 25, 2013, 02:16:17 pm
Hey, thats something I havent seen before :)

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)
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.

Just thought up another Dorf-Tracker 3000 idea for the minimap. Working alongside Falconne's Dwarf Monitor; track dwarves according to happiness value (color-based tracking using the table as reference); make sure those axe-crazy rageaholics aren't near anything you don't want dismantled piece by piece. Moodable/moody dwarves could also be tracked this way. Make sure the nobility isn't worth making sure accidents *don't* happen to them. While on topic of nobles, nobility and merchant tracking. Best use for trade depots, and finding your broker while the merchants patiently wait.

What I wish was also possible was to be able to generate a detailed minimap of the area you plan to embark in this way; just to ensure its the kind of landscape you want (volcano is in the right spot; good exposure, and the waterfall is plenty wide and tall, and so on. Even make sure the game wasn't kidding about being heavily forested ahead of time). Of course, we can still probably do something similar, if possible with the general landscape, as an alternative to Isoworld; since this is more of a top-down map.

EDIT:
Another idea, similar to prospecting. Aquifer-mapping. For players that don't want to use reveal, but also want to avoid aquifers. Whether map is revealed or not, highlight in mini-map, and maybe even overlaid full-scale where aquifers are, without needing to dig, designate dig mode, or whatever, and especially, without spoiling what's beneath with reveal. Magmaproof material prospecting can also be done, in case you want to tap magma and control it with floodgates and pumps, but don't have the supplies, and don't know where to look for magma-proof stuff.

HFS tracking and such when you visit the carnival finally, and fetch some cotton candy, along with forgotten beasts and such can also be a tracking feature that can work alongside the unit tracker. Tasks and such can also be highlighted accordingly (all haulers are highlighted, as well as their targeted hauling item on minimap (great for diverting dumbass dwarves from walking right into a siege, because you forgot to forbid certain items). The trade depot idea can even use the hauling task highlighter as well to track all depot-based items (in transit to, and maybe from depot).

EDIT EDIT:
The minimap will have to be expandable, according to various map sizes and dimensions.  Not everyone plays on tiny (1x1-3x3) maps, some may even risk mapping an entire region (16x16 usually as a preview of what can be selected (excellent for Worldgen Cookbook threads)). But just in case, it will have to adapt, or the menu will have to extend with it accordingly. Just a heads-up. I suppose, while the minimap is generated by code, we can even overlay a view-box (like Photoshop), similar to how some paint programs have an overview function, and you're zoomed in and the bounding box highlights the area you're looking at (adapts with hitting TAB). Easier to keep track of than a single tile in Vanilla.

The histogram can also work similarly to how histograms work in art programs as well, but for the features I mentioned before (dwarf happiness, minerals, wood types, # of creatures, etc.; Customizable, if possible. The possibilities are endless. Histogram according to particular [raw] data or syndrome effect/affected.). Of course, customizing views will require more direct interaction in DFHack, and can be bypassed, if it begins to get tedious, by including it in the code like the Syndromes plugin.

In case the user hasn't used my pixel-tileset, there can always be an export minimap function (also great for worldgen cookbook threads), which would be capable of exporting similarly to worldgen history exports (Flatmap (like the first screenshot, minus the sky shadow and building plans), heightmap (greyscale, color(by hue), color overlay on flat map (like the full-color + shading image)), vegetation+histogram (trees highlighted by color they appear in stonesense), aquifer overlay, magma, prospects+Histogram (color-coded according to mineral, ore, gem, sand, clay, etc.), etc.). Reveal (all) are optional, naturally (use actual reveal plugin for those settings to take effect). Prospect-all+Histogram can also work. Does a hidden reveal function, maps it, generates a histogram, and exports it, and unreveals as to not affect the gameplay. Histogram data is mostly based on the prospector tool's data extraction. It can also highlight by hue or raw data assignment.

Can't really think up any other plugins (and viewing modes that involve raw data; and maybe even DwarfTherapist) that can also interact with this minimap idea, along with it's alternative extraction methods (for use with other programs like Paint.NET and so forth as well (mostly for megaproject planning and such, pixel-by-pixel, which was my original intention/function with said program(s) anyway; which also led to implementing this idea.) right now. Feel free to add to the idea list. To be honest, I don't know how much of this is actually possible, but as long as I've been churning out ideas, why not? It's worth a shot. I'm just throwing ideas at the wall now to see what sticks. My brainstorm has just about calmed down now.

I'm gonna see what I can do about committing to the 1x1 tileset in the meantime, and see what I can do about the graphical sets, and in the future, even mod tilesets (maybe start off with the Fallout Mod first to convert to 1x1 when I get around to it).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 25, 2013, 02:54:30 pm
I am no programmer, so I can only make odd suggestions and see what the people come up with. I am however very good at making good use of the tools I am given. I think the best idea would be talking to falconne, he is a boss when it comes to UIs and overlays. I just see this as a clear improvement on the existing DF version, and I have the means to easily bring this to thousands of people. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on April 25, 2013, 04:46:27 pm
fastdwarf can teleport. how bout a plugin for teleporting bad guys.

i can see a teleporting gremlin being a nightmare during an invasion.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: sayke on April 25, 2013, 05:02:19 pm
i think it would actually be pretty doable to have a "semi-reveal" dfhack command that only revealed certain kinds of tiles a certain distance away from the workshop where the command was run. that would allow you to, say, pray to armok for the location of gold, and eventually... armok might reveal some to you!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: gzoker on April 26, 2013, 02:17:23 pm
Is it possible to create a plugin, that would shuffle the active civilizations at the beginning of the season, or according to a predefined pattern?

Say you want a caravan to appear only every other or third year, or you have twenty civilizations in your mod and want a bit of randomization in the caravans/sieges.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on April 27, 2013, 11:56:57 am
fastdwarf can teleport. how bout a plugin for teleporting bad guys.

i can see a teleporting gremlin being a nightmare during an invasion.

That would be pretty easy. See the way fastdwarf does it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 27, 2013, 01:31:02 pm
I have a suggestion as well. Having recently found the "rename profession" and "rename building" scripts, It would be awesome if people could rename pets.

Thats it. Nickname for pets. Or changing pet names.

Instead of Imgur Jadedbriefs the dog, you could do "Fido the dog". Fido bites the kobold thief in the torso, shakes him around, the parts fly off in an arc. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on April 27, 2013, 02:49:58 pm
You can nickname pets in vanilla, I'm pretty sure.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 27, 2013, 02:54:27 pm
No, you cant. They will get a random name, but thats it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on April 27, 2013, 03:26:10 pm
I improved the pixel-tileset a bit more. It's still a fair distance from complete, but here's a much better idea of how a good minimap should look.

Here are some new screens of my progress so far:
Before and after 1: Layer above river. (Before: Spring of 51, Just arrived at embark)
1:(https://lh5.googleusercontent.com/-viTIaxkBft0/UXs43CelVgI/AAAAAAAAB-k/eP1AYGuiQN0/s800/Pixel-Before-After-1.gif)          2:(https://lh6.googleusercontent.com/-1vh_lqMaEsc/UXs43GCq8dI/AAAAAAAAB-g/Y-gjKNGjAkk/s800/Pixel-Before-After-2.gif)
Before and After 2: +1z above the front gate of the fort. (After: Autumn of 55, post-siege, and successful defense.)

NOTE: Varied Ground is still active in both images; for consistency.

Reason the trees are highlighted is due to the seasonal difference. However, you should easily be able to spot the farms and the backbone of my drop-bridge system (since we're above it in that image; It's a better way to showcase the land difference between z-levels). Obviously, darker land is below us, lighter land is current layer. I haven't adjusted the tree-top blocks yet, so they still stick out like sore thumbs.

My next work, since I got the text part knocked out of the way, is going to be making the world map easier to interpret all kinds of extra and some shared characters, and then extra items in the tileset. And then one final adjustment to the main fort/adventure mode portions of the set that may no longer look right post-processing of the prior.

Once I'm done overall, then it should make an excellent frame of reference for anyone willing to tackle the minimap idea, and it's extra features.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on May 02, 2013, 08:17:18 am
Some mods have turrets and robots with miniguns and similar creatures that use material emissions to hit their targets with globs of something. A problem with that is that those globs sometimes stay on the map, accumulate in the fat stockpile or do other such undesirable things. The success of the itemsyndrome and ammunition exploding into magma mist suggests that there should be some way to make the material emissions interaction ammo to just disappear when no longer needed.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kurik Amudnil on May 02, 2013, 01:28:06 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Greiger on May 02, 2013, 01:50:19 pm
A less 'cheaty' version of the tile cleaner, that either generates a clean tile job at the location or does whatever needs to be done to the tile to make it eligible for dwarf cleaning.

I like keeping the outside of my fort clean, but magically cleaning a 30x30 swath of blood seems a little cheaty.  Unfortunately it seems tiles outside never get cleaned by dwarves, relying on weather to do it.  But at the same time if the tile is outside, but has a roof the rain can't get it either.


2nd, A full map tileclean that only targets tiles that shouldn't be able to have blood spatter at all.  Blood spatter in open space from flying limbs for example.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on May 02, 2013, 08:14:20 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on May 02, 2013, 08:14:45 pm
Yeah, but that requires modder effort :P
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on May 02, 2013, 08:26:20 pm
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. ^^
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bludragon on May 03, 2013, 12:47:15 am
I would like to see a way to edit the number of dwarves you can have on embark, please
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on May 03, 2013, 08:01:07 am
skillsyndrome script: Every 8400 or so TUs reads the skills of all dwarves, then gives them syndromes based on that. Then the modders can write interactions that check for these syndromes. The script should be easy enough to customize for just what the mods need and follow some rules:
* Four levels for skill syndromes (including none) and only give the best one. It should be easy to add more "levels" if the modders want it. For example with mining:
Code: [Select]
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.
* There should be a possibility for combining skills. For example all weapon skills should just add XXXXX_WARRIOR and only the highest should count. So:
Code: [Select]
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.

With this script, things like guilds only accepting dwarves of certain skill, or magic spells levelling with Alchemy would be possible with simple checks for syndromes.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on May 03, 2013, 10:14:58 am
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. ^^

That's actually pretty simple. I already have something similar written. When I get a sec I will change it to do size.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Broken on May 03, 2013, 12:07:17 pm
skillsyndrome stuff

This is awesome and have to be done.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Demdemeh on May 03, 2013, 12:27:01 pm
An expansion of building planner to do the same thing for constructions, so that I can map out entire levels of above-ground fortresses, independently of whether or not I currently have materials.

Edit: Also, a gui tweak to show the name of an item in the color it should be based on material. Cabinet for a microcline cabinet, for instance.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: 0x517A5D on May 03, 2013, 06:44:24 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on May 04, 2013, 01:24:31 am
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.
It got lost during the rewriting. There will be a ruby script that does this in the next release.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on May 04, 2013, 09:28:39 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: fricy on May 05, 2013, 01:04:01 am
I have one feature request: a search plugin for the burrow interface to filter by name or profession.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falconne on May 05, 2013, 03:46:38 am
I have one feature request: a search plugin for the burrow interface to filter by name or profession.

That's already in the current version of DFHack.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on May 05, 2013, 04:01:06 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on May 05, 2013, 07:28:21 am
I meant that itemSyndrome would not need to be changed. Assuming it already does what I think it does.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on May 05, 2013, 10:53:43 am
It's slow enough as is. It checks every item on every creature and every contaminant on those items and applies the syndrome on the item if the item passes the affected/immune class/creature checks and item position checks.

I could get skillsyndrome to work in such a way that it would require minimal (I.E no) lua skill to get a modder to run properly. Arbitrary raw arguments like SYN_CLASS are very helpful.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on May 05, 2013, 12:17:52 pm
I'm not averse to modifying scripts in unknown languages by copy-paste, modifying text strings and changing if conditions. I can do that, I just need some place to start. For general usage, yeah, making the script apply things from RAWs is probably a better idea.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on May 05, 2013, 12:47:48 pm
It might not be that hard with ruby or lua, but a C script for a .dll that needs to be compiled would be bad. ^^

Skillsyndromes sounds very useful for balancing :) Have a dwarf have lvl15 of MAGIC_NATURE before he can become a real mage, or having legendary skill before someone can run the reaction to transform into a guild master. its nice. :)

It only works on syndromes and interactions, not in reactions, correct? It would be amazing if a reaction could be restricted to a certain skill level.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on May 05, 2013, 12:53:35 pm
Not sure about the reaction thing.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on May 05, 2013, 01:34:37 pm
Well, once you have skill syndromes and a reaction that produces a boulder with a syndrome, you can make the effects apply to those that have the correct skill syndrome. Preventing the wrong dwarves from running the reaction and wasting resources is easy enough with profiling the workshop.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on May 05, 2013, 01:38:58 pm
I know, but that still does not limit the reaction. I meant it for item production, for example only your legendary weaponsmith can do a specific reaction for a special weapon, or your legendary alchemist can create a build-mat that you need for a new magical building.

That would make balancing techtrees and a slow, steady advancement a lot easier to write.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on May 06, 2013, 07:41:12 pm
OK, I see your point now. The closest thing I can imagine is periodically iterating over all active jobs and ejecting the Dwarves who aren't qualified, but it wouldn't be fully foolproof.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kurik Amudnil on May 10, 2013, 03:17:17 am
A script/plugin to prevent dwarfs from choosing food/drink for eat/drink jobs from inappropriate sources.
may need to mark which food/drink stockpiles as being an appropriate source for eat/drink jobs.
may need to select an item from the appropriate source (search stockpile for first available food/drink item inside/outside container?).
may need to account for when appropriate sources are empty, or not so that new food/drink has a chance to get transported to the stockpile.
may need to make decisions on proximity to dinning area (more than one food pantry? if so, closest to the intended dinning area? closest to the dwarf?)
should allow dwarfs to keep food they are already carrying/eating/drinking

Why?  so that dwarfs will use the food stockpiles next to the dinning room rather than the food waiting for transport by minecart, or food waiting to be cooked at the kitchen, and use designated drink stockpiles rather than newly brewed drink at the still
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: sweitx on May 22, 2013, 09:51:48 am
Several burrow related suggestions.
1. Dwarf Manipulator style interface for burrow assignment
Basically, use the interface we have for Dwarf Manipulator. But instead of having labors have columns, have burrows.
Obviously, we're going to have issue with that burrows can have arbitrary names and it will be difficult to fit into a single character (unlike labor, which can fit into single character column by having 2 letters representing the labors).
A solution would be to use the burrow symbol as column headers, and display the name of the highlighted burrow (like how Dwarf Manipulator displays the full name of the labor when the column is highlighted).

2. Extension to above, profession based auto-burrowing.
Allow automatically assign burrow based on activated labor.
For example, if a dwarf has the "weaver" labor active, he/she is automatically assigned to the weaver burrow (to prevent him/her from grabbing spider web from unsecured regions in the cavern).

Current DFHack capability to search for dwarf in the burrowing window is very helpful already. But I believe that my first suggestion would be helpful in giving an "at-a-glance" status on your fortress' burrow statuses. Also, since currently you cannot check which burrows a single dwarf belongs to by just looking ('v') at a dwarf, the above suggestion would be helpful at "debugging" burrow assignment.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on May 23, 2013, 09:33:25 pm
Ideas for UI plugins, roughly in ascending order of difficulty. 

1. DFHack GUI:  keybinding for a popup where commands can be typed, instead of finding another window.  Good for immersion, and makes fullscreen less of a pain.  Maybe Ctrl-Alt-H to open, and close with Esc?

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. 

3. Clickable menu options.  Falconne's mousequery plugin apparently makes playing on a windows 8 touchscreen possible, and this would make it even cooler.  Besides a step toward a mobile edition, it could also be pretty helpful for getting people into the game when the key mapping is most intimidating. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on May 24, 2013, 11:29:43 am
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. 

Would be relatively simple, actually. I'll add that to my to do list. The same interface would work for autodigging obsidian farms. Unless burrows automatically remove new obsidianized walls, which I don't think they do.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on May 24, 2013, 07:50:09 pm
2. Automate tree farming
I'll add that to my to do list.
Awesome! 


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. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kurik Amudnil on May 25, 2013, 02:18:52 am
2. Automate tree farming
I'll add that to my to do list.
Awesome! 


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.

I was recently thinking about how I would go about doing an export of all maps.  My thoughts on how to do it went something like this:

psudeo lua code

I don't know if lua can send key presses to a df viewscreen or be able to successfully wait for dwarf fortress to do its stuff.

*edit: inspired to work on this some more and found that yes I can send key events .. took some time to find the right ones.  Now I am having trouble figuring out how to let the game process while waiting for the new viewscreen to popup

*edit2: Ok, I think I have this working now.  I think it has some room for improvement (such as not exporting all, but a subset, or cancel after starting, or not starting if already in progress) but it seems to do the job for me.  Place in hack/scripts/exportmaps.lua

Code: ( "hack/scripts/exportmaps.lua") [Select]
-- 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

to run:
[DFHack]# exportmaps
then go grab a sandwich or two

* uploaded to DFFD http://dffd.wimbli.com/file.php?id=7696 (http://dffd.wimbli.com/file.php?id=7696)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on May 25, 2013, 07:19:44 am
Semicheating mod: get rid of machine delays. Pressure plates reset instantly, bridges activate instantly, etc. I'm not quite sure what I want, but the most I'd do is make everything instantaneous. This would allow for repeaters up to 50 times faster (assuming you can design one), faster dwarfputing, more reliable pressure plate detection of units / flow, etc. Thoughts?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on May 25, 2013, 09:47:06 am
[DFHack]# exportmaps

Legendary.  (he he he)

Edit: tested it, and it works beautifully.  Thanks!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scamtank on May 25, 2013, 09:50:54 am
I'd still give my left kidney for the ability to alter/replace vanilla reactions.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on May 25, 2013, 10:41:53 am
I'd still give my left kidney for the ability to alter/replace vanilla reactions.

I think warmist had something kind of like that. It was related to adventure fort. Could be remembering wrong.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kurik Amudnil on May 25, 2013, 12:51:21 pm
I'd still give my left kidney for the ability to alter/replace vanilla reactions.

I don't know if it is applicable here, but according to the dfhack lua api (https://github.com/peterix/dfhack/blob/master/Lua%20API.rst#functions)
Quote
2. removeNative(shop_name)

    Removes native choice list from the building.

  3. addReactionToShop(reaction_name,shop_name)

    Add a custom reaction to the building.

In any case, I doubt it removes a moods choice of output
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: drayath on May 27, 2013, 03:50:24 pm
Allow a stockpile to automatically dump any items added to it.
Can then use various stockpile filters to select garbage items, and them automatically dumped to a garbage disposal system.

Working proof of concept below. Modified version of autotrade plugin.
Have some concern about performance with large forts with lots of items (checks items each 500 ticks)
Idealy: Monitor completed jobs, if a haul job to a tagged stockpile then mark the item to dump. Then remove the ontimer code.
Note: Enabling dump on a stockpile will immediatly mark all items, disabling autodump ona stockpile will remove the dump flag from items unless a dwarf is already on the way to dump them.

Download: www.brightsoft.net/autostockdump.plug.zip

Spoiler (click to show/hide)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Brilliand on May 29, 2013, 12:51:07 pm
Quote
Portal buildings. Enter building #1, worker is teleported to building #2
 - 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.
This 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.

The portals would probably be more useful (particularly for sending out the military) if they teleported all dwarves in the vicinity (probably within 3 tiles, since that's the precision of a move order).  Or rather, teleport all units within the building, and leave it to the modders to make their military teleporters 7x7.

Also, for multiple buildings: It should be possible to ignore forbidden buildings when choosing a destination portal - that would make having more than 2 portals workable (just forbid any portals you're not using at the moment).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on May 29, 2013, 02:57:26 pm
> Allow a stockpile to automatically dump any items added to it.
Automelting items would be at least as useful. The timer doesn't need to be 500 TUs, even 5000 would work just fine for me.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: whitecold on May 31, 2013, 02:46:00 pm
I don't know if this has been suggested before, I did not find it.

Duplicate commands for military uniforms.
Duplicate commands for hauling routes/ stops.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on May 31, 2013, 04:33:15 pm
And maybe one to fix pathfinding for flying pets.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: sweitx on June 01, 2013, 05:17:44 pm
Is it possible for the Workflow plugin to trigger a job based on input count?
Basically have an option for a "push" based workflow to compliment the current "pull" based workflow.
For example:
A Mill Rocknut task will auto-resume if the number of rocknuts (input) is > 120, and auto-suspend if its < 100.
A Dye Thread task will auto-resume if there's > 10 powder of dye, and auto-suspend if its =0.
This would be helpful in automating, say, soap production with plant goods in the first case, and dyed thread/cloth production in the second case.


Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on June 01, 2013, 05:20:21 pm
That would be great. Currently clothes and soap production are almost too tedious to bother with, despite tantrum spirals and disease outbreaks.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Aquathug on June 03, 2013, 02:09:25 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scamtank on June 03, 2013, 02:18:24 pm
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 documents
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Aquathug on June 03, 2013, 02:21:57 pm
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 documents
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.

I can't even come up with a witty remark scolding my own inattentiveness... this is very helpful. Thank you.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on June 03, 2013, 02:31:51 pm
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 :(
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Aquathug on June 03, 2013, 02:39:57 pm
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 :(

It's handy in my situation, where I have embarked in a terrifying biome and the dead units tab filled up with various body parts, disallowing further migrants to come by. Granted, this is by design, but to go out in a blaze of glory I have planned I will need more minions.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kurik Amudnil on June 03, 2013, 04:25:35 pm
Unit Info Viewer (http://dffd.wimbli.com/file.php?id=7717)

Provides information in a lua gui window about age, average max age, shearing products, milking products, grazing hunger info for your civilization's animals and dwarfs (or whatever race your civ is).  Also some body size info for living units (includes units influenced by cloud syndromes such as murk zombies, excludes undead raised by necromancy/biome), and if used from the units->dead/missing tab, displays death info (unless missing).

Does not work on vermin (they are not a unit object)

works from nearly every unit context, not just the ones getSelectedUnit() supports.

read the description on dffd for more details
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: dimondmine2 on June 03, 2013, 05:36:44 pm
Some sort of get-info command for an item, specifically armor and weapons. The command would look at the item and spit out the items properties such as weight, attack type(s), skill used, size, contact area, etc. As well as the items material properties such as density, shear yield, impact yield, etc.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: UberFuber on June 05, 2013, 02:06:17 pm
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.
1. Forbid some tallow from being cooked in the kitchen menu (or not, if your output is frequent enough that soap making production will get some sooner or later).
2. Set wood burner to maintain 3-6 ash bars (small enough to not require a large inventory, large enough to have a small buffer when new soaps are required).
3. Set ashery to maintain 3-6 buckets of lye (same number as above).
4. Set soap maker to maintain 8-10 bars of soap (hospital stockpiles about 3-4 barsof soaps, leaving 4-7 bars of in a stockpile near my "washing station" for dwarfs to wash themselves).

You CAN technically setup your presser to maintain 3-6 jugs of rock nut oil for soap making, since soap making probably don't require that much in the first place. Of course, you then need to make sure to have a constant supply of rock-nuts to make sure that you don't accidentally press all of it.

The auto-dying one would be really helpful.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kurik Amudnil on June 06, 2013, 07:42:29 pm
I fixed a bug in unit-info-viewer and updated my body size estimator, link in sig

My attempts of simplifying the determination of weather or not a unit was alive or dead was not as thoroughly tested as I had thought, therefore I had to revert that determination to the more complicated method so that vampires are not revealed as dead (unless they are dead-dead)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scamtank on June 06, 2013, 08:04:12 pm
I like your tool a lot. Is there a way it could work in arena mode?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 06, 2013, 08:53:02 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on June 06, 2013, 11:44:04 pm
Certainly possible. Probably easier than the existing unit labor management screen. I personally have no idea how to do it, though.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kurik Amudnil on June 06, 2013, 11:50:36 pm
I like your tool a lot. Is there a way it could work in arena mode?

I haven't used arena mode before.  Looking into it, all I needed to do was remove the requirement for dfhack.isWorldLoaded().  So updated to version 1.02
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scamtank on June 07, 2013, 01:21:43 pm
Fantastic! :) This will be a big help to my personal science. I've always lacked a proper bodysize probe.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sergarr on June 07, 2013, 01:34:05 pm
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 it semi-crazy liberal?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Maklak on June 07, 2013, 01:53:31 pm
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 it semi-crazy liberal?

Really? That's great. Please give me a link to that script and info about it.

EDIT:
> It's called SkillSyndrome IIRC.
I know what's it called, I suggested the name. I just wasn't aware that it was written and is available. Give me!

EDIT2:
Oh well, just add syndromes from attributes to the TODO list for skillsyndrome then.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sergarr on June 07, 2013, 02:01:13 pm
It's called SkillSyndrome IIRC.

EDIT: Uh, I for some reason thought you have already made it. Me fail at life forever.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on June 07, 2013, 02:56:22 pm
I started then, uh, stopped, because I realized that lua isn't the best way to go about writing something like that.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rogue Yun on June 07, 2013, 03:29:33 pm
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....
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 13, 2013, 12:04:47 am
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....

I was thinking something more along the lines of the various hack/script/gui things, so it would blend in with the game - well, as much as a command line can, which in DF seems more reasonable than usual. 

Edit:  something like the gui/rename popup, but 'input dfhack command' or something. 
(https://raw.github.com/peterix/dfhack/master/images/rename-bld.png)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Brilliand on June 13, 2013, 04:19:04 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rogue Yun on June 13, 2013, 05:56:02 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Brilliand on June 13, 2013, 09:45:18 pm
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.

Auto-dump plugin (http://www.bay12forums.com/smf/index.php?topic=121451.msg4276352;topicseen#msg4276352)

Haven't seen any auto-melt, but I think it has a good chance as well.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dwarf Kitty on June 14, 2013, 01:13:19 am
I have a couple ideas for you coders:
 
1.  Rain barrels.  (workshop/building)
Build these with one empty barrel and maybe a log for rain catchers.  These, of course, must be outside.  In biomes with rain, they'd fill with rain as ponds do.  This would be a nice watersource for an early fort, working like designated zones and wells do.  They'd have clean water to prevent absolute dehydration, and for reactions.  You could use a bucket to retrieve the captured water.
 
 
2.  Water barrels (workshop/building)
These, of course, are related to the above.  All you need is one empty barrel to build.  While you'd need a bucket brigade to fill them and keep them filled, they'd make a nice handy water source for hospitals, et cetera, without the need to dig a well nearby or channel water.
 
Hmm, you could also do this with booze.   :)   Dwarven water alcohol cooler!  They already gather at the barrels to drink straight from them.  Nice way to distribute alcohol without dealing with stockpile management.
 
 
3.  Museum (room and items)
This one's for the mods with display cases.
 
First, I'd like not only cases, but pedestals (just a block will do), too.  Both are built especially to display artifacts and other interesting things.  The difference is the cases provide theft deterrence, and the pedestals can't.  Cases would be good for the small things, pedestals for the large and heavy stuff that no one tries to steal.
 
Either on build or post-build query, have filter option to see artifacts only, so you can put up your useless priceless items up for display.  (That is, if this isn't in the display case code already.  Haven't tried them yet.)
 
On query, you can set up a Museum room, which would work just the same as a Sculpture Garden.  Hopefully the parties thrown there won't break stuff.   ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Hommit on June 17, 2013, 11:13:07 am
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...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: CaptainArchmage on June 17, 2013, 12:45:18 pm
Two much needed plugins:

1) Plugin that gives the ability to (d)esignate an area for cleaning.

2) Plugin that lets vampires drink blood from barrels, and allows creatures to have [BLOOD_GUZZLER] tag. [BLOOD_GUZZLER] acts as [GUZZLER] for alcohol.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rogue Yun on June 18, 2013, 03:45:45 am
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...

Agreed x 100%

I also thought that it could be handy if workflow was set up to dump, melt, or trade if it got to a certain stock level. Dump plump helmets after attaining 75, trade leggings after it got to 30, etc.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dwarf Kitty on June 19, 2013, 11:46:52 pm
Heh, noticed that my ideas for water barrels are already in the Orc Fortress part of Masterwork.  I'd like something like that in Dwarf Mode.
 
 
Speaking of liquids and vampires, make vampires use blood the same way dwarves use alcohol, as an energy boost.  When they have just fed, vampires become strong and fast.  When they are starving, they become slow and weak as dry dwarves do.  For dwarf vampires, swap out the alcohol effects for blood; immune to the effects of alcohol, only blood gives a similar bloost.
 
For the non-dwarf civ mods, consider a similar energy drink to be brewed.  High tea with the elves!  Tea or coffee for humans!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on June 20, 2013, 03:44:14 am
Or, make dwarf vampires require BOTH :D
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dwarf Kitty on July 08, 2013, 01:14:12 am
New idea:
 
A plugin that allows the player to rename stockpiles and workshops, and the new nicknames show up in the jobs list.
 
It'd be really nice to see at a glance that something's being hauled to my food stockpile that's reserved for seeds versus the prepared meals one versus the booze one versus the one for everything else.   :)
 
More important for stockpiles than workshops.  With workshops, the pending jobs are a big clue most of the time.  Still, sometimes a mason gets a fey mood and I need to figure out if he's taken the main one by the furniture and stone, or the one mostly reserved for coffin making by the graveyard.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: fricy on July 08, 2013, 04:09:12 am
New idea:
 A plugin that allows the player to rename stockpiles and workshops, and the new nicknames show up in the jobs list.

Get PeridexisErrant's LNP. (http://www.bay12forums.com/smf/index.php?topic=126076.msg4250423#msg4250423) Then when in the game use (q)uery mode, and "Ctrl-Shift-N" to rename units and buildings.
The script can rename workshops, stockpiles, levels and powerplates. Maybe more.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 08, 2013, 04:10:48 am
That's in DFHack normally, so you really don't need LNP.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: fricy on July 08, 2013, 04:18:04 am
@Putnam Oh, that explains why I couldn't find a standalone rename plugin package on the forums. Thx. Anyway, for some people it's easier to download something that works out of the box.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Pie Maker on July 08, 2013, 07:05:54 am
Would it be possible to make a script/plugin to be able to name items and/or rename artifacts? It's a pretty trivial thing, but it might be useful in certain community games.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on July 08, 2013, 07:57:15 am
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. 

Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Brilliand on July 08, 2013, 09:27:38 am
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.

Normally the item's contents go there, so this would need to be reconciled with container items.  Also, on the more technical side, IIRC the description doesn't actually exist until you view the description page, so DFHack would need to run the code to generate it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dwarf Kitty on July 09, 2013, 11:59:03 pm
Fricy and Putnam:  Thanks!   :)
 
I use Masterwork DF, which includes DFHack.  The rename script is included, but no hotkey was listed.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: evictedSaint on July 10, 2013, 01:23:51 am
I tend to keep my fortresses small to prevent fps death, but that places a limit on the number of artifacts you can make (one of the limits is the number of revealed subterannean tiles divided by 2300). 

I would like a plugin that could remove this limit.  I looked around, and I can't find any threads pertaining to this besides using a reveal-all command, which decreases the fps anyways.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 10, 2013, 04:50:06 am
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dwarf Kitty on July 14, 2013, 12:47:06 am
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

ANY unit on the map, actually.  Including wild animals, caravan units, pets, and ordinary citizens.  Haven't tested with invaders, though.  ;)
 
Does work on workshops, zones, and stockpiles.  Not on individual pieces of placed furniture such as tables or statues.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on July 18, 2013, 01:46:33 am
Would anyone be up for whipping up a script like soundsense-season, to add information to the gamelog on load that can identify the world?  I'm thinking of something like "Loaded RegionX, [dwarfname] [translatedname]".   

There's a nice little utility called Story Maker (http://www.bay12forums.com/smf/index.php?topic=128570.0) which could take advantage of something like this in the next version, but it would also be nice for flavor and tracking activity across different forts manually.  It would also potentially allow someone to build a plugin that lets DF show gamelog info from previous sessions, which could be nice for people who play in short bursts. 

Update:  Done. (http://www.bay12forums.com/smf/index.php?topic=91166.msg4435181#msg4435181)  Thanks to those who helped; it's included in my LNP or available at the link. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Laggy on July 18, 2013, 12:23:10 pm
Quote
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.

I'm just now seeing this, but why is this supposedly impossible?  You can have reactions trigger dfhack scripts now, correct?

I wrote a script months ago that removed the wear from all of the items in the fort just because I was tired of constantly making clothing.  To me, it seems that if you can target all of the items with wear, then targetting one item with wear should be pretty simple?  Although it might be hard to target a SPECIFIC item, it just seems to be like a "Hey, burn any clothing with wear > 3" should be perfectly possible.

For reference:

Spoiler: removewear.lua (click to show/hide)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 18, 2013, 12:31:11 pm
Targeting clothes should be easy, since they're all contained in the unit's inventory.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 18, 2013, 01:36:00 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kurik Amudnil on July 18, 2013, 01:37:43 pm
could also use a two job cycle, where the first job runs the script that selects the damaged clothing for the second job which it creates (would want to have a free job slot in the workshop for the new job).  This way it can exclude the clothing worn by the worker.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 18, 2013, 01:43:40 pm
I'm not sure if jobs like that preselect job items before they are started. If not, you'd just have to swoop in and change the job item every time such a workshop job is initiated and change the job item to something appropriate by doing an annoying pathfinding thing to locate all worn clothing, and cancel the job nicely if there is no worn clothing. It's possible, just more difficult than it seems at first glance. Framerate would only be a minor issue, because the percentage of frames on which the slow part of the script runs would be small, but of course, if there are a lot of different scripts that each have only a minor impact on framerate, the slowdown would add up over time.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Laggy on July 18, 2013, 01:58:50 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on July 18, 2013, 07:29:44 pm
auto-dump items that produce miasma?  Preferably items that are not alive (mwmod has miasma producing rotten limbs that are attached to dwarfs)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 20, 2013, 03:30:51 pm
Rotten limbs still attached to dwarves can happen in vanilla, too
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on July 20, 2013, 08:02:29 pm
Has the OP been updated? I thought that power-dependent workshops had been confirmed to be possible.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on July 20, 2013, 08:04:47 pm
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. ^^
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on July 21, 2013, 05:35:20 pm
auto-explore plugin for military dwarf's.  I could use my vampires to explore the caverns without me needing to constantly reissue stationary orders
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on July 21, 2013, 10:58:39 pm
Workshop profile saves.  I.e. I'm playing mwmod and a lot of the libraries are only useful to specific group of dwarf's.  It would be nice if I could say, create a military grouping of dwarf's for the Profile, and then just load it while I'm inside the tavern's profile...  Hope that makes sense, would apply to other buildings as well.  Seems like something Falconne would be great at...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 23, 2013, 04:50:04 pm
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. ^^

Already been implemented for the next release.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on July 23, 2013, 07:13:22 pm
I'd like something that allows animals to be treated medically the same way dwarves are treated. A manual switch between 'treat as animal' and 'treat as dwarf' would be fine.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on July 31, 2013, 10:55:47 pm
A script or plugin for autowoodcutting. 

If you're using workflow, autolabor, autobutcher, autonestbox, and seedwatch one of the only things that needs regular player input just to keep functioning - rather than set up or expand - is cutting wood and mining stone.  A way to designate an area for repeated woodcutting would be really useful. 

There are two possible ways I thought of to set the area (since eg going outside during a siege would be a bad idea, if there are tree farms underground): 
1. Hijack the activity zones - either by creating a new one, or aggregating sand and clay gathering zones.  Some kind of GUI hint would be very useful here. 
2. Watch for burrows with eg "CUT_WOOD" in the name, and designate that area with d-t monthly.  It could also check the name for a configurable delay; and is potentially extensible to gathering plants or auto-mining mechanised obsidian farms (I have no idea how this could be made to work reliably, but someone suggested it).  Better yet, act on a name "auto_designate-<key,key2,...>-<delay>", which would be insanely powerful for fortress automation. 

Of the two, the zone would blend into the game better but the auto_designate burrow would be way more powerful and I'd think easier to code.  Thoughts?  Is this even reasonably possible?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falconne on August 01, 2013, 02:54:02 am
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 with the ability to designate specific dwarves for woodcutting (so they get their woodcutting labour automatically toggled when the log counts go beyond the thresholds).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on August 01, 2013, 04:00:33 am
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

Yay! I hadn't even dared suggest a quota system, but this is going to make total automation possible.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on August 03, 2013, 08:25:44 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on August 17, 2013, 10:00:48 am
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.
#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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on August 17, 2013, 01:27:47 pm
what the heck do you want me to do for that???
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on August 17, 2013, 10:17:52 pm
Ehm... we talked about the script you posted on reddit, and how I tried it ingame, and how I ended up with endless repetitions of "is a dubious worshipper of", every time the game starts. The script must only be run once per created world, but there is no way to automate that.

The animal train script that adds a skill-point to a pet does not work either... I cant get it to run, not with reactions/autosyndrome, nor by direct input into the dfhack window.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on August 18, 2013, 05:36:55 pm
It should only be run once per world, I thought. I guess I forgot to include that...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Quarterblue on August 21, 2013, 12:33:02 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on August 21, 2013, 12:43:04 pm
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
it replaces dwarf jobs with targeted race's units. This is done because it's way easier then creating new jobs (well creating them is easy, but creating them depending on what needs done). DISCLAIMER: this is just a proof of concept script. Somebody should do something more useful for general public.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on August 22, 2013, 05:17:30 pm
I utility that would be awesome to have is one where you could track how many creatures a specific unit has killed, and be able to run an interaction if they reach a certain amount. Or if not an in game interaction at least another DFHack script.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on August 22, 2013, 05:28:56 pm
COMBATHARDNESS is a good fudge for that, but I could take a look.

EDIT: The kill counters are stored in the fig, and the way figs are found from units can take a while, depending.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on August 26, 2013, 06:14:01 am
Idea/Request: When you look at a "shrub" with 'k' the menu should show which type of plant it is. Currently you have no way of identifying the plants that grow naturally all over the map.

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: howitended on August 27, 2013, 12:35:04 pm
Should be simple enough AND fix the annoying issues with building in advfort mods:

A script that simply enables all of the stones that are set to economic in the stocks for building use.

Currently, you can't build ANYTHING with stone in MW or (probably) Genesis. There's supposed to be a way to fix it by using mode set 0, save and reload, opening stocks, enabling the stones for building use, mode set 1, save and reload. But that doesn't work for me, I've tried it something like 15 times and my stocks menu just won't open.

If there were a script to automatically do that, it could be run as soon as an adventurer game is started in either of those mods and fix the issue without having to figure out a way to enter the stocks.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on August 27, 2013, 02:35:26 pm
A plugin for picking shrubs in adventure mode would be nice. It's so frustrating to die of starvation while surrounded by bushes.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: narhiril on August 28, 2013, 01:55:53 pm
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.

Now if only I could make it rain ice boulders with a reaction...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on August 28, 2013, 02:08:23 pm
If its cold and you have my waterlings outside, you can. Otherwise it just rains liquid water. If its not cold enough for ice, it wont work.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Quarterblue on September 08, 2013, 12:18:25 pm
Suggestion: make invaders able to be assigned jobs - for instance, to make them build siege engines.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Hague on September 13, 2013, 01:00:56 am
Could you make a plugin that periodically reverts wear on any cloth items made of thread metal? (the obvious being candy) Seems simple enough, and fixes a logical error that limits a potential use for the best material. Something about having the end-all of game development be a set of clothes that never wears out. Candy thread robes and hoods for all your dwarves.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on September 13, 2013, 01:01:48 am
You could even make a plugin that reverts wear on thread metal as it happens.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Hague on September 14, 2013, 02:33:17 am
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?

You could combine the concept and make holy months/seasons where special reactions are available to represent sacrificial rites. So for instance a mountain god has a festival in Granite and you can sacrifice a buncha raw stone for a mist of some permanent beneficial syndrome.

If you can heal with reactions you can make faith healing. Perhaps a purity god can cleanse infections. A god of rage or war could grant temporary [NOFEAR]. Gods of Madness grant temporary CRAZED status but a large but temporary bonus to talents and skills related to art and artwork. So you have the lock the madmen away to work on their art or they'll slaughter everyone.

Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on September 14, 2013, 02:39:03 am
1. Yeah, should be possible.
2. Yeah, should be possible.
3. There's already a heal script lying around, so yeah.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on September 14, 2013, 04:45:08 pm
How about custom reactions that can only be used in certain seasons or during certain months?

You could certainly make a reaction that refunds its components if run in an incorrect season using scripts and a few dfhack plugin interfaces. You could probably enable/disable them in the desired months if you tried hard enough.

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.

Same as above.

Not sure, but is it possible to heal dwarves with reactions?

Already possible and already done. Transform them into something for one tick then transform them back. Combine with autoSyndrome for extra reliability.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on September 15, 2013, 01:35:55 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on September 15, 2013, 02:28:46 am
Request - lua scripts to export everything from legends mode, and process those exports (http://www.bay12forums.com/smf/index.php?topic=131141.0)

I've tried and failed to get anything usable. 

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. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: ab9rf on September 20, 2013, 08:14:25 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Button on September 27, 2013, 04:36:34 pm
Something to help with worldgen crashes. I've lost at least 24 hours to worldgens that ultimately crashed  in the last year.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Mohreb el Yasim on October 19, 2013, 04:45:45 pm
i think it might already exist (i remember having seen it but can not find it):
Is it possible to make a workshop reaction that transform a creature (the one doing the job and only him/her) to an other cast inside the same race?
if it is already possible excuse me to post it here, and share me where it was discussed ...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on October 19, 2013, 04:52:22 pm
You can use a boiling rock syndrome with a transformation effect. If you combine it with autoSyndrome, you can make it more reliably affect the unit that you want and only that unit. If you combine it with trueTransformation, the resulting unit will not be untransformable.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Mohreb el Yasim on October 19, 2013, 05:14:47 pm
ah yes that is the trueTransformation i was looking for, but yep i fear i'll need to use syndromes (i want only one creature to be affected for sure ... migth not be possible to restrain in this case)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mc876898 on October 20, 2013, 01:18:13 am
Adventure mode inventory sorting.

The sort-items function doesn't seem to handle adventure mode. It says I'm in the wrong UI.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kyphis on October 20, 2013, 04:32:32 am
I'm currently working on reliably and quickly creating plants in any tile I want.

I've already published my current results so far here (http://www.bay12forums.com/smf/index.php?topic=132221.0). Essentially what I aim for is to expand the Tiletypes plugin.

My current obstacle is reliably finding the tile that contains the plant data pointing to my target tile - there are 625 possible tiles to search through, and it looks like each tile has six data entries as well, giving a grand total of 3750 data entries to search through.

What I currently need is a script that , when given (x,y,z) coordinates, searches through the "tile.plants[ x].pos" entries for a coordinate match with the input coordinates. Since the maximum variance is +/- 12, that means that what I need is a script that begins checking on x,y coordinates of -12 and continue through until it reaches x,y of +12. Ideally it would also stop if it found a match. If it fails to find a match print something like "No matches found", if it finds a match print something like "Tile Coordinates (x,y,z), set [ x]".

Anyone know how hard this is going to be to do? I am not a coder - I can read it, but I can't really write it easily :P
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on October 20, 2013, 09:08:48 am
Can we propose dfhack patches in here?

Id like to see a fix for the miner, woodcutter,abusher, miltia weapon dropping/equipment mismatch issue.

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 fixed
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kyphis on October 20, 2013, 05:44:47 pm
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 fixed
I 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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on October 20, 2013, 07:28:21 pm
Sounds halfway fixed. I could write a simple plugin to check the levels and repopulate as needed.

Of course i dont think ive ever ran out of fish.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: CaptainArchmage on October 24, 2013, 09:40:48 pm
Suggestion for partial bar readings at smelters and magma smelters: This should give you a readout of what percentage of a bar or wafer of which materials you have at the smelter. This should help with designating melt jobs.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on October 25, 2013, 09:34:20 am
I assumed it was pre installed.

oops wrong thread
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Vattic on November 20, 2013, 08:00:51 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on November 25, 2013, 01:18:42 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rumrusher on November 26, 2013, 10:17:36 am
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.
that or say make a site and embark as an adventurer directly under the ground and using revflood would also work.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on December 04, 2013, 02:51:51 am
a plugin to mark all ore's as flagged for mining
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on December 04, 2013, 05:30:34 am
I'd love a script that could export all the information that it's possible to export from legends mode - and if at all possible add a GUI hint for it.  This should be fairly easy to do the basics for, since "exportmaps.lua" (http://dffd.wimbli.com/file.php?id=7696) already handles all the detailed maps.  All that needs to be added is the XML, sites/pops/map, and site maps.  I tried, but I don't actually use Lua and I kept running into errors - xml worked alone but not combined, and the others stuff I never got. 

I've already got a batch script that processes a complete set of exports (http://www.bay12forums.com/smf/index.php?topic=13130), and I'm in the process of porting it to Python 3 (as a learning exercise, and for cross-platform availability).  If a dfhack script could export everything, I could then append a call to the processor for the LNP and everything would be super-easy for newbies; exploring the worldgen is a massively underrated activity that could be made way more accessible. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: gzoker on December 06, 2013, 08:49:32 am
Could someone write a script, that would spawn a fixed amount of meat when a type of animal was being butchered? If it would be settable in the raws it would be perfect. Adjusting the amount by relative creature size is optional, but would be welcomed.

Trying to mod how much meat an animal gives is a nightmare.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on December 06, 2013, 10:03:03 am
a plugin to mark all ore's as flagged for mining

Already done. See digtype.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on December 07, 2013, 05:36:33 am
I am still big in support of a power-plugin for workshops... even if its only workshops and the axles and building have to be build in a special order... power-needing workshops would be so awesome. Machinery has so few uses atm.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on December 12, 2013, 12:16:34 pm
Workshops that can use up fluids from a square below would be awesome as well...


Since the steam engine can do both of those things it surely couldn't be too hard to make plugins to allow both behaviors.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on December 12, 2013, 03:10:02 pm
No it's not too hard.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on December 13, 2013, 11:03:54 am
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 ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on December 13, 2013, 11:45:17 am
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
Although currently working on multiplayer...
Also there is uglyish thing with not knowing which version to compile to (because this will have to be compiled to .dll/.so) and other small stuff (e.g. how to signal if it needs power, how to signal if it eats lava/water?, maybe add generic tick function that you would then add with lua? but then how the performance will suffer? etc...)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on December 13, 2013, 12:04:17 pm
Could water/magma eating be a command? then you could use autosyndrome to call a command like this "eatfluid magma 3 3 2 2 /LOCATION" (where the "3 3 2 2" part is the building size and work location, for determining where to take fluids from)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on December 13, 2013, 12:41:40 pm
I am more interested in the buildings that need power.

If you just want a workshop that uses up water, copy the steamengine, add the reactions you want, and then use that.. yes, it might create power, but you dont need to tell people that. Just call it a water reservoir and done. As long as no one builds axles underneath it, it will use up the water and no one will be any wiser. (ok, maybe the reactions will still work if the water is empty, I havent tested that.)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on December 13, 2013, 12:54:19 pm
That would probably work, but I am more interested in using magma (without also using water)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on December 13, 2013, 01:10:18 pm
Might I ask what for? Using up magma seems a bit pointless, considering that magma pools, lakes and volcanos refill themselves. Using up 1/7 or even 7/7 will have no bigger consequence as the NEEDS MAGMA tag. Because a magma-using workshop which such a plugin would remove only a tiny part of an endless resource.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on December 16, 2013, 12:11:07 pm
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.

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on December 16, 2013, 12:19:04 pm
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.

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.
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on December 23, 2013, 01:52:44 pm
I just downloaded the latest DFHack source, so providing I don't run into weird issues I should have something that "just works" for liquid consuming workshops :)

Don't expect it to be perfect though...

I may also make an attempt to do something about power using workshops as well, but C++ is not my main language so I may not be able to.

Please not that my dev system WILL NOT be able to compile DFHack, so I will be providing the result as UNTESTED source code :(
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on December 30, 2013, 10:25:00 am
OK, I have something that should work, but it is very basic (only handles magma in 3x3 workshops). I do not want to do more work on it until I know if it will compile, but seeing as I do not have the required C++ compiler some one else will need to do that step.

I will upload the code as soon as I can get to a real computer (which may be few days)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on December 30, 2013, 05:03:51 pm
No matter what, its good to see that someone is doing something with the suggestions in here. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on December 30, 2013, 05:42:32 pm
Faster than I thought :)

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?)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on December 31, 2013, 10:29:33 am
(http://i.imgur.com/80rlUez.png)
Just something i was working on...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on December 31, 2013, 04:03:16 pm
(http://i.imgur.com/80rlUez.png)
Just something i was working on...
:o

YEAH!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 01, 2014, 10:28:23 pm
(http://i.imgur.com/80rlUez.png)
Just something i was working on...
:o

YEAH!
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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 01, 2014, 10:34:13 pm
Animation would be nice (even for workshops without power), but its graphical only. The important part is the use, the functionality. :)

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 02, 2014, 04:48:56 am
Animation would be nice (even for workshops without power), but its graphical only. The important part is the use, the functionality. :)

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.
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!).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 02, 2014, 05:15:39 am
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. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 02, 2014, 08:16:53 am
So sort of done with it. Need use case examples/ideas, will try to make using it more sane... currently e.g. soapmakers shop that needs power at (0,0) (top left corner):
Code: [Select]
blds.addBuilding(soapmaker.id,5,0,{{x=0,y=0}}) -- uses 5 produces 0 mechanical energy.
fps hit would be ~0
with fancy stuff:
Code: [Select]
blds.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.

something like this would be best imho:
Code: [Select]
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: narhiril on January 02, 2014, 11:00:36 am
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. :)

(http://gifrific.com/wp-content/uploads/2013/02/Leonardo-DiCaprio-Django-Unchained-You-Had-my-Curiosity.gif)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 02, 2014, 11:11:00 am
Faster than I thought :)

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?)
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.

With your script idea, which takes actual liquids, people could build a filling station for drinks. For example you build the water-station over a river, fill up as many barrels as you can, before the river freezes again. You can now carry barrels of water underground and use them in winter as backup. I would totally add that. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on January 02, 2014, 11:45:47 am
Has anyone tried to run that plugin through a C++ compiler? I would really like to know if it compiles without error so I can work on a more usable version...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 03, 2014, 10:49:47 am
Straight from crazy dwarf scientists:
 a satellite observation of some weapon test site (http://mkv25.net/dfma/movie-2609-dragonenginefirsttest)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on January 03, 2014, 01:49:32 pm
Now THAT could come in handy!

Can you say "roast goblin"?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 03, 2014, 01:54:37 pm
Didnt come in handy for the dwarf that operated it. ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on January 03, 2014, 02:02:08 pm
That's just bad engineering :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 03, 2014, 02:32:35 pm
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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 03, 2014, 08:06:21 pm
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)
Warmist: "Mh... maybe I could work a bit on powered workshops"
 - Makes powered workshops
 - Makes custom siegeengine
 - Makes custom atom-smasher
 - Makes custom display case

Any chance for the "uses water/magma" workshops, the code milo christiansen posted? (once you are at it :P)

The display case does look like something every player could use, regardless of mod or not. I would let Peridexis know, maybe he wants it as an option in the extended LNP. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 03, 2014, 08:33:17 pm
atom-smasher is still not made, i'm reluctant to do it, coz is much work to figure out all that stuff with materials (well maybe not that much). We could see what is the performance drain though, coz it would need to iterate through items (in 16x16 area) and units (all?).
btw the dragon breath shooting mechanical workshop uses magma (or water if that is available, but then it's not that impressive...)
next up: remote controlled golems? too much work
Of course workshop "using" magma water is hard-ish. Because a) it's easy to make workshop require magma/water (but at which tile?) b) what will use that magma/water, usually reaction, so reaction, not workshop is magma using c) usual raw-reactions will get more and more complicated when you want to type out: allow this reaction only when water/magma is at x=<> y=<> z=<> and then remove X water/magma.
btw in lua this is magma/get set function i'm using:
Code: [Select]
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 03, 2014, 09:14:29 pm
A filling station would be nice, because you probably have done all the work already, just have to delete some parts. Some workshop that takes magma/water and uses it up in the reaction. The product would be a container with magma/water in it.

I currently use just reactions, and people can fill unlimited containers with 1 tile of 7/7 magma under the workshop.  :-\

The atomsmasher sounded nice, because you can just dump stuff on it, but its not a new game mechanic to destroy items. It can be done with reactions, just slower. Or with actual atom smashers. If its a lot of work, I would rather focus on something were the people will say: Wow!, I always wanted one of these. (Like the dragonfire engine)

But the biggest thing is the powered workshops. IndigoFenix will love those, and Deon for his fallout mod as well. And Narhiril for the tech-tree of LfR. :)

EDIT: Just saw your edit: I thought the code for that was already done? Because the steam engine uses up magma with each reaction. ? I honestly thought you would just have to delete the "create power" part and recompile it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 03, 2014, 09:34:20 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on January 03, 2014, 09:35:46 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 03, 2014, 11:09:47 pm
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. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Urist Imiknorris on January 04, 2014, 01:32:19 am
I've looked for this everywhere but can't find it. Has anyone made a way to make melting of objects return their full metal quantity?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 04, 2014, 02:55:57 am
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. :)

It's not so much about the C++ as the game's data structures, which are in XML here (https://github.com/angavrilov/df-structures).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 04, 2014, 06:49:58 am
Warmist, I found something that you could do, if you wanted to:

Change the createitem plugin to accept coordinates/location, so that people can call it with autosyndrome in a workshop. Yes, it only creates items, which is things you can already do in workshops, but hear me out. McTeellox has written probability-syndrome, which allows things like this:

PRODUCT:100:1:probability-syndrome
PRODUCT:50:1:x
PRODUCT:50:1:y

This reaction would create EITHER product x OR product y. Not none, one, or two of them. But it cant affect the items ingame, only autosyndrome. Its a bit hacky, but if probability-syndrome calls autosyndrome that calls create-items, we would get a new function for all reaction that create items. In all mods. We can finally do a IF/ELSE in reactions. IF product 1 is created, do this, IFELSE make product 2, ELSE make product 3.

And all it would require it the createitem plugin that accepts \LOCATION when called with autosyndrome. I so hope thats possible.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 04, 2014, 10:09:38 am
i think new version will have position, though not sure.
also useless stuff continues (http://mkv25.net/dfma/movie-2611-bulletingtesting)

Edit: playing with it enabled it's not so great, needs a lot more work to be nice. But it's test/demonstration of few ideas: autogenerated jobs, maybe praying could be like that, you can't order dwarves to pray. Also it could be used in many other places because it's not limited to dwarves (any unit can do those jobs). Another test was about holding info in buildings and displaying it. And third was history writing idea pre-test, main idea being dwarves writing pages of history events/facts, and player composes books, then places in bookshelves which you can look over or export.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on January 04, 2014, 02:28:33 pm
We could use a plugin that allows doctors to treat patients with specific substances, making syndrome-based medicine possible without complicated setups.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 04, 2014, 04:27:32 pm
We could use a plugin that allows doctors to treat patients with specific substances, making syndrome-based medicine possible without complicated setups.
Code: [Select]
--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")
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 04, 2014, 09:32:01 pm
Quote
autogenerated jobs, maybe praying could be like that
Or, 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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 06, 2014, 06:16:44 pm
Quote
autogenerated jobs, maybe praying could be like that
Or, 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.
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):
Code: [Select]
        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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on January 06, 2014, 10:40:51 pm
sorry for any deralings...

a dfhack plugin that would zero out artifact values.  That way I can play longer without epic sieges.

uPDATE:
I do see a feature to disable artifacts in d_init.txt...

although I did like the benefit of legendary (skills &) equipment.  I just hated I couldn't sell it off.  Trying to atom smash them is difficult as I cannot build an artifact item on top of a bridge or under an open one...  but this should suffice
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 06, 2014, 10:45:56 pm
No. Value looks like some sort of function of quality and material.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on January 06, 2014, 11:09:12 pm
thanks, I know browsing the dfhack gui I didn't see hard codes values for artifacts...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 07, 2014, 02:34:56 pm
How does this look?:
Spoiler (click to show/hide)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 07, 2014, 03:39:58 pm
Is that an ingame UI for enabling and disabling scripts/plugins? (How many different things are you doing at the same time? ^^)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 07, 2014, 04:11:09 pm
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...
Anyway here is example mod definition:
Spoiler (click to show/hide)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rogue Yun on January 07, 2014, 04:22:38 pm
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!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falconne on January 07, 2014, 05:29:27 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rogue Yun on January 07, 2014, 06:08:02 pm
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.

I am your biggest fan!!! This is not the first time you have made my day. Thanks for all you do :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on January 08, 2014, 09:59:45 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on January 11, 2014, 03:23:06 pm
is there any way to port the unit creation section of the arena into a dfhack module?  couldnt some code be injected using a dissassembler somehow?  that would be sweet if i could bring up the unit creation skill set as well as equipment sections of arena into a game to "test" my defenses.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 12, 2014, 02:27:32 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 12, 2014, 05:26:14 am
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.
Code: [Select]
dfhack.maps.spawnFlow(pos,type,mat_type,mat_index,dimension)
pos would be somewhat troubling. Not sure how the syndromes give it out.
Code: [Select]
one param: dfhack.maps.spawnFlow(xyz2pos(
then \LOCATION OR STH...
),type,mat_type,mat_index,dimension)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 12, 2014, 05:39:56 am
He's talking about the types that creep across the map, the freaky weather.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 12, 2014, 05:57:24 am
ah that i don't know.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 12, 2014, 07:42:09 am
What about rain? Like "it rains dwarf blood", just with a custom material you can define?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on January 12, 2014, 02:45:46 pm
I have an easy suggestion for a dfhack plugin.

set artifact flag to false for all artifacts
remove the artifact list from the ingame gui and hotkeys...

voila...

that's it.

I'd love such a plugin so I could trade my artifacts away without having to do it manually.  But... it is quite easy to do with dfhack.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on January 12, 2014, 11:59:00 pm
EDIT: Wrong place, sorry.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 14, 2014, 02:25:23 pm
Extirpate turns all trees into ashes... would it be possible to change it to logs? A extirpate that goes by location, has a radius and turns all trees into fitting wood. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on January 14, 2014, 08:06:58 pm
this may involve a trifecta of collaboration.

But using the database that jodgap made

and warmists script for creating units...

and the ability to create items via dfhack.  (I have the notes somewhere, Q was telling me how it can be done, it's kind of a pane, but if it were coded once then it wouldn't be a pain, the only knowledge that would be needed would be in game scanning of possible items, shouldn't be too hard (simply enumerate each array for items/names), but this would be crossing over into jodgap's database)

Couldn't an arena like query/script be made to ask a player what unit and what items he wants to give those units, etc be made...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on January 14, 2014, 08:12:32 pm
The ability to create items via DFHack? You're in luck, dude, I've already done that!

It even has a GUI (https://gist.github.com/Putnam3145/8207480)! You could very easily reappropriate that entire script into some other function that creates a unit and equips it by adding another list prompt using the item_inv mode enums and using dfhack.items.moveToInventory instead of moveToGround.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on January 14, 2014, 08:33:31 pm
or run 'createitem' ^^
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: JodGap on January 15, 2014, 08:52:08 am
I'm about to finish an interactive dwarf script for DFDB which can be equipped with database items.

If we find a way to connect DFHack with DFDB (FTP?) i can make a realtime interactive armory for military dwarves that could be used to gear dwarves in your game...

I had in mind something like that using an IRC bot so my viewers in twitch.tv can have realtime information about their dwarves and buy / choose items for them with points given to the viewers of the stream. Then command me orders or whishes ingame. Like if a Siege happens they could choose to attack or hide from it.

Is this remotely possible?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on January 15, 2014, 10:46:28 pm
I just realized, skills would also need to be adjustable for the unit.  So another script for that...  but your hackwish is awesome!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Nopenope on February 09, 2014, 09:38:04 pm
How about a script that allows mounts for dwarves (or in adventure mode)?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 09, 2014, 10:05:29 pm
Mount.lua (https://gist.github.com/Rumrusher/6903877)

and in case you really want it

unMount.lua (https://gist.github.com/Putnam3145/7005495)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Severedicks on February 16, 2014, 04:46:14 pm
Is there some kind of plugin that adds natural disasters such as storms, tornadoes, eruptions, floods, cyclones and the like out there? Would appreciate.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on February 16, 2014, 08:16:29 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on February 21, 2014, 08:04:58 pm
Been awhile since I last stopped by. How's the suggestion list going? Which ones have been made so far?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: IndigoFenix on February 24, 2014, 03:56:50 am
How abou a split stack reaction?

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on February 24, 2014, 06:24:48 am
How abou a split stack reaction?

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.
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: IndigoFenix on February 24, 2014, 06:51:57 am
So basically, I'd need to make a seperate deep copy script for each type of item.  Well forget that.  Making a reaction that simply respects the item or stack total volume would probably be welcomed though.  Then you could make a fake bone splitting reaction using a bone tool...

At least, once I work out how subtypes work.  I don't suppose there's a way of reading if an item has a subtype field, aside from giving it a list of item types that have subtypes?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on February 24, 2014, 07:53:29 am
Don't have an access to headers to check but there might be enum attributes (e.g. how tile types have more info in their enum) for item types. If that is not the case then you could try (a bit ugly?) safe call variant to e.g. build the list or just check if the field exists.
Code: [Select]
local ret,err = pcall(function() return item.subtype end)
if i remember the syntax correctly.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 24, 2014, 09:59:20 am
item:getSubtype() (returns -1 if no subtype, returns other number if it has) works too.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Urist Mc Dwarf on February 24, 2014, 06:08:57 pm
Could someone make something to change the effects of a biome?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Vattic on February 25, 2014, 03:34:35 pm
Conveyor belts: Single tile buildings which when receiving power move items in a specific direction. Items sat on them should be automatically forbidden, once moved off a conveyor belt they should be unforbidden.

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Nopenope on February 27, 2014, 09:47:20 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on February 28, 2014, 10:24:03 pm
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?

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Vattic on March 02, 2014, 10:58:56 pm
Can't this be done in-game, especially if you're willing to use power?

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.
It would need to be hauled back up to the top of the shaft right?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on March 03, 2014, 01:20:25 am
Can't this be done in-game, especially if you're willing to use power?

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.
It would need to be hauled back up to the top of the shaft right?
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Vattic on March 03, 2014, 01:52:27 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on March 03, 2014, 01:56:08 am
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. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Chaos17 on March 03, 2014, 05:05:32 am
Make a plugins for Workflow to be able to craft set of equipements/cloths ?
I'm asking this because at the moment I've to enable one by one each piece of equipement that I wish to craft on the workshop.

Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Vattic on March 04, 2014, 04:17:52 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on March 04, 2014, 05:06:39 pm
A script that would trigger only when a certain square is walked across.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on March 04, 2014, 09:48:19 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Vattic on March 05, 2014, 04:15:01 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Nopenope on March 05, 2014, 12:58:33 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sutremaine on March 05, 2014, 07:06:28 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Vattic on March 06, 2014, 04:08:24 am
This (http://www.bay12forums.com/smf/index.php?topic=119430.5) is an efficient powered setup.
Bookmarked. Cheers.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Quietust on March 06, 2014, 11:44:59 am
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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on March 06, 2014, 12:07:08 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Nopenope on March 06, 2014, 02:47:29 pm
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).

Forgive my ignorance, but what do you mean by "custom logic"? And won't dwarves use buckets if they have to fill a pond?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 06, 2014, 03:14:49 pm
Custom logic meaning replacing the normal reaction function with one that removes water salt for that particular reaction.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kyphis on March 15, 2014, 04:54:11 am
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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Nopenope on March 17, 2014, 08:26:19 am
Is there a way to trigger a party at a given date and customize the announcement? For instance, the dwarves would throw some sort of New Year's Eve party every 1st of Spring or something.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on March 17, 2014, 10:45:00 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on March 17, 2014, 01:44:24 pm
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.
Or figure out the named weapons/armor?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Quietust on March 17, 2014, 02:28:46 pm
There are only two ways (that I know of) that an item can have a special name:

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on March 17, 2014, 04:44:08 pm
There are only two ways (that I know of) that an item can have a special name:

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.
Are those named-weapons (i.e. the ones that dwarves give names to) done through artifact records?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 17, 2014, 04:48:22 pm
That would be why they show up in the artifacts list, wouldn't it?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kyphis on March 19, 2014, 09:32:25 pm
Welp, after much testing that does indeed look like the only way I will be able to give generic items names. Sadly that doesn't work very easily for things like Bolts. Thanks for your help!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rumrusher on March 30, 2014, 03:01:23 pm
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 who chop 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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Frango Nicolbidok on April 03, 2014, 08:15:59 pm
Suggestion: A plugin that makes it so that you can trap things that normally TRAPAVOID (http://www.bay12forums.com/smf/index.php?topic=137064.msg5084328#msg5084328). Somebody suggested it would work better if it instead made the creature Webbed and just walked over the trap. I'm talking about things that you cannot change their Raws (clowns)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on April 03, 2014, 08:46:35 pm
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 who chop 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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rumrusher on April 04, 2014, 03:46:22 am
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 who chop 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.
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.
wait warmist made a channel command for companions so there's possibility for an invader leader and his lackys to do fort mode jobs. the only issue I have is that I really don't know how to write an ai to build another fort.
pretty much need some kind of auto fort builder with tree designations and what not and hope I can feed it into warmist adventure fort.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on April 04, 2014, 12:21:33 pm
diggingInvaders assigns jobs to nonfort units, so that part's fine. It's the AI that's the hard part.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 07, 2014, 09:36:14 am
Honestly, I dont think it will be worth the trouble. The idea is neat, but if your fort can handle 50-100 armed units, it should be easy to butcher invading settlers, long before they have any infrastructure to defend themselves.

I would be more intersted in custom attacks in general. If x happens, spawn y units with z equipment on xyz map-edge/cavern... it would be a lot of fun to simulate little bandit attacks or adventurers or any equipped unit that ist not in a civ. A cult, a megabeast with followers, a group of plaguebearing traders... anything thats more interesting than ambush/siege.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on April 07, 2014, 09:37:57 am
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 :D
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rumrusher on April 07, 2014, 10:07:21 am
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 :D
or hell with all these new building types having a resident gnome villa in a Dwarf fort won't be so bad.
then again df-ai led to 3 pages of merchants willing to trade with the AI so who knows
(http://www.truimagz.com/host/fortcrush2/de/this-is-one-serious-Dwarf-Con.png)
Then I realize the Gobbo hate the humans and Drow so Dwarves kinda sat there watching 2 factions Go ape shit and murder each other.
I guess I could just figure out how to target a merchant caravan and expand from that.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Nopenope on April 08, 2014, 05:17:26 am
Is there a way to make driftwood harvestable?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: magmaholic on April 10, 2014, 12:09:48 pm
Why wont anyone make a GUI for stonesense?
MOR GRAFIX!
NO NEED FOR ALT TAB ALL TE TIEM!
OR TWO MONITORS

lul go team caldfir
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: SeelenJägerTee on April 11, 2014, 05:17:59 am
A script to save your embark party would be nifty.
I tend to design my embark pretty carefully.
When I load an embark scheme the skills are assigned according to the dwarfs list place in embark screen. However now the dwarves are diffent ones from when I created the embark scheme so it basically becomes useless as I have to do it all over again.
Usually I play with the startdwarf 10 command and it gets pretty annoying to review EVERY dwarf and reassign all the skills to the most fitting dwarf.

If there was a script to save your starting party and load it at a later timepoint this would come in really handy.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: magmaholic on April 11, 2014, 03:18:09 pm
parralel processing?
maybe utilizing the graphics card?
Would be neat.It does not have everything that is parralel-processed,only the hardest tasks.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on April 11, 2014, 03:20:38 pm
We're not adjusting the source here and there's really nothing that can be parallelized that would have quite the FPS effect people like to imagine.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: magmaholic on April 11, 2014, 03:39:53 pm
Oh,fork.
eternal suggestion voting it is.
Tis` already in the 9th place.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 11, 2014, 03:58:22 pm
Here a suggestion: A way to force a specific plant, material or pet/mount on a race.

Ignoring all biome tags and COMMON_DOMESTIC etc, you could add these with the script. For example give goblins only access to Wargh-mounts and war-trolls. And the elves suddenly trade lembas plants, which you can only get from them and no matter the worldgen, they would always have access to it.

I know some things can be done with biomes and entity tags, but its unrelyable to impossible, at least when you have 10+ races as MDF has.

I would love to have Automatons attack with clockwork spiders, while humans ride steelclad horses and kobold traders arrive on pack-pigs. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on April 11, 2014, 04:11:59 pm
...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.

I'll see what I can do after my volunteer work.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 11, 2014, 05:45:31 pm
...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.

I'll see what I can do after my volunteer work.
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. ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on April 11, 2014, 06:10:26 pm
Well I know you can see what animals a race has access to with;
Code: [Select]
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.

There is also wagon_races, pack_animal_races, wagon_puller_races, mount_races, minion_races, and exotic_pet_races.

Also under resources there is options for metals, stones, items, plants, etc... Also have not tried adding or subtracting from these lists.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 12, 2014, 02:44:32 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on April 12, 2014, 11:41:28 am
Name a file "onLoad.init" and put it in your raws folder and it'll run scripts juts like dfhack.init, but when a save is loaded that has onLoad.init in its raws folder.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 12, 2014, 12:22:06 pm
Thats a new dfhack r4 feature? The script works and removes specific woods... i dont know about the rest. I couldnt find it with the search function, but i know that urist davinci wrote it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: DVNO on April 15, 2014, 01:21:36 pm
So I came across a script that putnam put together called advslab (http://dffd.wimbli.com/file.php?id=8398), it creates a slab with custom text from the player that an adventurer could read later on.

I was wondering if this type of thing would be possible with books? I know that df.item.slabst can be changed to df.item.bookst but what I don't know is if descriptions can be appended multiple times.

possibly with an automatic ingame date heading for every journal entry 

I made a suggestion a long while ago about adventurer written books (http://www.bay12forums.com/smf/index.php?topic=125154.0;nowap) but now I'm wondering if Dfhack can provide what I'm looking for.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 15, 2014, 02:18:29 pm
Thats a nice idea. Warmist has to get here, he made a peototype of dwarves that write their thoughts on a billboard. Would be so amazing if dwarves had a personal journal you can look at, and see their entries with fitting dates.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on April 15, 2014, 02:18:52 pm
I did some research on books. Did not have full success, but the idea is that there is book (which has only title) and than you add item improvement "PAGES". That holds a vector of something (don't remember what though...).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 15, 2014, 02:21:39 pm
23 secs after I say "Warmist should get here..."

:D
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on April 15, 2014, 02:30:50 pm
Actually you posted as i was writing out my thoughts :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 15, 2014, 02:36:03 pm
Pst... they dont need to know that. Just pretend you have psychic abilities or something like that... ;)

But yeah, what happened to adcslab? I wanted to add a fortress version of that, but never quite found the time before I left.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: DVNO on April 15, 2014, 02:40:50 pm
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 ....
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on April 15, 2014, 02:47:12 pm
I'm currently looking into the system, it looks like you write books by adding events and so on... Not by typing out words. So not sure how useful that would be.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: DVNO on April 15, 2014, 03:05:15 pm
Oh, adding events would be one way to do it, I suppose.

I was thinking of another way to get around a book not having a discription, make the book have a corresponding .txt in, say, /df/books and let the .txt be a string container for whenever the book is interacted with in the game.

If the adventurer tries to read it, DFHack shows the .txt as string in a in-game GUI. If the adventurer tries to write in it, it adds a new line to the .txt. 

Would something like that be a good workaround?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on April 15, 2014, 03:16:33 pm
Yeah that could work. We also could exploit tablets more (e.g. interpose method to return tablets name as "diary" :) thought c++ stuff is needed for that).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Urist Da Vinci on April 15, 2014, 10:01:52 pm
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.

Well, there is the (R3) script that removes the blood, ichor, and liquid barrels: http://www.bay12forums.com/smf/index.php?topic=91166.msg4246062#msg4246062

THIS script is significantly more fun:
Code: (resourceEdit.lua) [Select]

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)



Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 16, 2014, 06:20:38 am
 :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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on April 16, 2014, 09:06:07 am
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 ....

I don't know why but "This is a book" cracked me up.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Urist Da Vinci on April 16, 2014, 08:15:59 pm
: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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on April 16, 2014, 11:41:00 pm
: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.

Is it possible to have a creature with the [PET] token and no biomes (so it does not appear in game naturally) be added to a foreign civs list, and then be brought along to trade/use as normal for a pet?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 17, 2014, 01:19:02 pm
Roses, that is exactly what I wanted to ask. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on April 17, 2014, 02:05:57 pm
A lot of stuff seems to have changed, shouldn't the OP be updated?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 18, 2014, 05:17:33 am
Yes. Its still about r3. But I dont have the time atm. I could do it in 1,5 months from now, when I am done cycling.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on April 19, 2014, 05:05:28 pm
Progress with books: thanks to Quietust's research we can now hack books. Good news: it allows us to fill them with events and stuff. Bad news: no free strings (i.e. diary type texts). Also the interaction giving part needs more research. This is a quick book thingy i hacked up:
Spoiler (click to show/hide)
and the code:
is subject to change (https://gist.github.com/warmist/11099012)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 24, 2014, 09:01:18 am
Since Urist daVinci seemed to have fullfilled the last suggestion, here another one:

Upon embark all civ members, pets, the wagon and all items in the wagon.... are teleported to a random place in the first cavern (dry, not in the water I hope). I know that Roses has a teleportation script, and if it somehow could find the caverns and run automatically once at embark, we could have this option:

CAVERN EMBARK: YES/NO

What do you guys think?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PintOfBass on April 24, 2014, 09:41:22 am
The one thing I have always wished DFhack did was have a filter when assigning bedrooms, much like when you assign animals to a zone.  Simple key stroke to take off the list the dwarfs who already have a room would be soooo eye sex.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 24, 2014, 09:46:05 am
Dwarves claim bedrooms automatically, you dont have to asdign them to dwarves.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PintOfBass on April 24, 2014, 09:55:28 am
Dwarves claim bedrooms automatically, you dont have to asdign them to dwarves.

Never liked them choosing for them selves.  Most the time I don't make one large bedroom area, but rather 20 room pods on differing levels.  Then assign the rooms to the dwarfs who work closest to that area.  So as an example the dwarfs who work closest to the surface or on the surface (farmers, wood cutters, milkers/shears etc) aren't walking 30 levels down to the "main" fort, and the dwarfs who work near the magma furnaces aren't walking 30 floors up to take a nap.

But hey if your a hero of the people then just let them go willy nilly.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Askot Bokbondeler on April 24, 2014, 01:00:38 pm
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on April 24, 2014, 03:07:50 pm
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

1. Attack announcements don't really have all that data in them. Also, if a creature is surrounded during a fight, the attacker id might not be correct, and I'm not sure exactly how you'd get the attacked creature.
2. item:addWear(int_32 delta,bool simple,bool lose_masterwork). The types are just guidance, you shouldn't actually be including them in the arguments if you're on lua
(or ruby AFAIK)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Askot Bokbondeler on April 24, 2014, 05:29:19 pm
yeah, i'd gotten 2 already. i want to do that automatically during combat
for 1 i was guessin one could parse the string outputted by the combat log and then find the creature with a matching name. then i took a look at the log and noticed it just outputs the creature's profession or race
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on April 25, 2014, 08:39:17 am
If you do write this wear-for-weapons/armor, let me know. it will be added as a option into MDF. ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on April 25, 2014, 09:02:52 am
Closes i got to weapon striking detection is:
"onItemContaminateWound(item,unit,wound,number1,number2)" in eventful.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on May 21, 2014, 07:10:34 am
Suggestion (or rather a request): A script that spawns colonies of a specific vermin around the worker. Make a 1-tile workshop, run reaction and AutoSyndrome triggers the script. The script then generates 4 colonies, next to the workshop.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: peregarrett on May 26, 2014, 04:41:24 pm
A suggestion for pumpstack/track spiral/shaft/etc helper - a plugin that searches for solid-stone columns from level where it's called down to magma sea.
When you're looking for place to start digging for pumpstack, you call this plugin and it intersects maps of all explored caverns and gives you places where it's safe to dig vertical shafts without getting into the cavern.
Unrevealed tiles count as solid. Better be called by a hotkey from designations menu, optionally looking for columns of specified size (square sections, circles, whatever)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on May 26, 2014, 04:44:32 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: peregarrett on May 26, 2014, 05:05:42 pm
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 example, if I need to piston-pump magma from magma sea up above first cavern, I need to dig a solid shaft 10x10 for example, ensuring that no cavern will get on the way. What I do now is about half-an-hour scrolling from lowest caver to first and second, mumbling "here's the nice solid section..  shit, here's an empty space at second cavern.. and here? no, there's a lake on the way at first one... and here? no, here's a this stalaktites at third..."
And what I'd like to see is a whole level covered with green and red Xs - greens where it's safe to dig a shaft straight down and reds (or empty) where a cavern is on the way. Something like embark finder screen.
Maybe I should make a picture that clearifies...

EDIT: I better write a pseudocode
Code: [Select]
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: fricy on May 27, 2014, 01:42:30 pm
A plugin to hide components (mechanisms, bridges, doors, etc) from the list when selecting what to link.
Filters should include linked state, material, z-level, build time if possible, but hiding already linked components would be the most beneficial. Another idea is to filter by forbidden/hidden tag.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: peregarrett on May 28, 2014, 12:13:10 am
A plugin - carve track helper.
Takes first and last points of trackway, runs usual pathfinding, shows path (ensuring that there's no stair on the way) and then designates whole path for carving.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: WillowLuman on May 29, 2014, 02:20:03 pm
I really wish there was something to designate tombs for the already deceased.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: peregarrett on May 29, 2014, 10:36:03 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on May 30, 2014, 08:47:13 pm
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

This is more or less first on my todo list, by the way.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: MeMyselfAndI on June 01, 2014, 03:19:12 pm
I'd love a plugin (script?) that allowed you to link by cursor position. Would this be possible?

(So, select a lever/pressure plate, when you select add link it enables the cursor and allows you to move the cursor to the thing you wish to link to, with a (flashing?) green X when you're over something that you can link to and a red otherwise (maybe yellow if you're already linked to said item?))

This could be leveraged for quickfort-like programs too.



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?



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.)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 01, 2014, 05:49:17 pm
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

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. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: MeMyselfAndI on June 01, 2014, 06:27:25 pm
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.cpp

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.
Wow that's messy. (hardcoded commands, etc)

Would a lua script be easier, I wonder?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on June 01, 2014, 06:30:47 pm
I think thats more Falconnes domain, he is the only one who has written something like this.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falconne on June 01, 2014, 07:28:20 pm
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.)

That's on my todo list for the building planner plugin.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 01, 2014, 07:37:59 pm
I'm serious when I say I have no idea, beyond the existence of the old copypaste.cpp

Which reminds me, there are two plugins I'd love to see fixed up:
hotkeynotedump.py (https://github.com/DFHack/dfhack/blob/develop/needs_porting/hotkeynotedump.py) seems kinda useful, and trivial to port to a script for anyone who can do lua. 
hellhole.cpp (https://github.com/DFHack/dfhack/blob/develop/needs_porting/hellhole.cpp) is probably a lot more complicated, but it instantly creates a hole to hell.  How has the community gone years without this function?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on June 04, 2014, 11:39:21 pm
a plugin that has trees beget more trees (since tree growth rate can't really be controlled).

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on June 05, 2014, 12:25:29 am
a image upscaling plugin (say using xbr or hqx)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on June 05, 2014, 12:51:26 am
a plugin that has trees beget more trees (since tree growth rate can't really be controlled).

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.
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.
Also don't forget that we have new df version very sooooon with totally different ideas about trees. On related note: will the 1-tile-tree still exist in next version?

Edit: also forgot to mention main reason we had that 1x1 farm idea: there would be no need to regenerate the world. It would be easy to add a new type of seed and catch when you plant it but that needs a world regen.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 05, 2014, 12:57:09 am
IIRC, trees grow from a sapling to 1-tile, then keep growing. 

Literal tree-farming sounds fun, and you could combine it with Falconne's getplants to automate the whole thing :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on June 05, 2014, 06:04:46 am
Just saying that I really like the idea of tree-planting/farming, as it would fit perfectly into playable elves. :) Grow walls and rooms and large forests.

Would go right together with grass planting. Embark on a desert, make it a paradise.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rumrusher on June 05, 2014, 06:17:05 am
been screwing around with the sizes of forts and it got me thinkin what happens if you move the site?
does all your progress move also or does it stay where you left it? if someone went in and change the min/max X/Y of a fort to be 3 tiles to the left then reclaim the site then retire/abandon the place will that just move the 3x3 tile identifier of the fort 3 spaces to the left or add 3x3 block on top of the previous place?
If there's a way to grow a fort with out having to sacrifice cpu memory to load up a 14 x14 size map I would do that in a heart beat.
So far I haven't gone heavy into testing this since results of fiddling with forts usually ended up with crashing on unloading the dang things.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on June 05, 2014, 06:38:39 am
What? You mean "Expand the site of construction to the east", and a 3x3 embark becomes a 3x4 embark? Thats a pretty epic idea.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on June 05, 2014, 07:32:18 am
I asked about modifying embark size after embark a while ago (maybe even in this thread). Hurmph!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: MeMyselfAndI on June 05, 2014, 08:21:01 am
Another suggestion:

It would be nice to have (persistent) toggles (yes / no / don't care) for classes of construction materials. So stone / wood / metal / glass / magma-safe / fire-safe / value.

Or for mechanisms / traps: quality / value / magma-safe / fire-safe

You can do this manually, but it gets tedious to do it for every designation, and forbidding things while you build causes cancellation spam elsewhere.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on June 05, 2014, 09:38:04 am
Instead of a plugin, I was thinking a dfhack script would do well enough to initiate the tree growth.

Then I could mod it into a workshop as a custom reaction.

t would be nice if I could build a workshop (say Gaia controller) that produces output (i.e. custom reaction/dfhack script) without a dwarf having to operate the job constantly.  Then I could build it, set it AnD forget it without having to build a huge DLL plugin
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Quarterblue on June 05, 2014, 03:53:22 pm
How about a renderer that shows multiple z-levels at the same time?

Something like this (from an old thread)
Spoiler (click to show/hide)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on June 05, 2014, 04:06:09 pm
that looks amazing.  how would one modify it to work with tilesets?  Hues for each layer?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Quarterblue on June 05, 2014, 04:24:34 pm
Edited my post to include another pic from the same thread. I think darkening works pretty well.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 05, 2014, 05:33:56 pm
Probably best done through Rendermax, I seem to remember discussion about something like this a while ago. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Rumrusher on June 05, 2014, 07:48:35 pm
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: MeMyselfAndI on June 07, 2014, 05:06:05 pm
UI Tweaks:

Showing the status of a trap when you view it with q.

Showing the actual value of a room when you're looking at it with q.

Showing all things connected to a machine (lever etc) in flashing Xs when you are adding a link to something.

Selecting all items in the current "send to depot" screen, maybe with a filter for quality / material / price.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Quarterblue on June 09, 2014, 07:07:17 pm
Here's another example of rendering pulled from another thread:
Spoiler (click to show/hide)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on June 10, 2014, 01:23:57 am
Here's another example of rendering pulled from another thread:
Spoiler (click to show/hide)

It looks beautiful for outside, but what's about underground? It doesn't make sense to draw what is below unmined areas and we don't have much of open space and slopes underground.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Vattic on June 10, 2014, 01:49:07 am
It would help in the caverns.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on June 19, 2014, 09:03:04 pm
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.

Cross posting to the proper thread because Warmist and Rumrusher are being silly. :P
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on June 19, 2014, 09:39:49 pm
I'd love for a plugin that allows me to extract all pertinent details of the dwarf object to a xml file for re-incorporating into say another completely different save.  Of course one would either have to: create a new creature or... wipe the creature at the target cursor.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: MeMyselfAndI on June 25, 2014, 07:16:26 am
I'd love a plugin / script that allowed better management of liaison meetings.

As in: select all in group (like you can with stockpiles), filter, save/load (either max / add / min / set?).

For that matter, a way to save / load stockpiles would also be great. Maybe even adding to the stockpile UI a custom menu for saved stockpiles?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 25, 2014, 07:21:47 am
A plugin or script that could maximise the DF window, or some other method of starting DF maximised.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on June 25, 2014, 08:27:09 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on June 25, 2014, 08:37:46 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on June 25, 2014, 08:39:16 am
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.

Ah, I understand now.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: fricy on June 25, 2014, 08:44:29 am
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 25, 2014, 09:40:35 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on June 25, 2014, 04:23:05 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on June 28, 2014, 02:10:41 am
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on June 28, 2014, 02:22:54 am
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. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scamtank on June 28, 2014, 03:27:59 am
It'd also be a way more elegant way to do stuff than ADD_SPATTERing everything.

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on June 28, 2014, 03:36:17 am
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on June 28, 2014, 03:41:40 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on June 28, 2014, 03:58:23 am
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.
Yes it does. Explosive siege projectiles are already in Genesis and MDF.

Thanks expwnent, I will have a look at the ingame uses, once I find some time. ^^
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on June 28, 2014, 11:56:03 am
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.

Yeah, eventful has an onProjHitEvent or something along those lines.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on June 28, 2014, 01:55:41 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on June 28, 2014, 07:18:54 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on June 28, 2014, 07:40:17 pm
Quote
You guys want everything. :P
We really need a Modding Suggestion thread as well, so non-modders can make unreasonable demands of modders, just like you scripters/coders get. :P
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on June 28, 2014, 11:16:12 pm
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.

 :) It's all I want for Christmas!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scamtank on June 29, 2014, 03:21:12 am
You guys want everything. :P

It's only because we love you.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on June 29, 2014, 06:38:23 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Quarterblue on June 29, 2014, 09:16:00 am
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:
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on June 29, 2014, 09:17:49 am
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:
  • 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
Cant you simply take more points and buy those things?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Quarterblue on June 29, 2014, 09:22:09 am
Hunters do start with a free crossbow, leather armor and quiver. The point is that it removes tedious micromanagement (having to manually equip each of your dwarves, etc.) and would allow to take less points than usual.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on June 29, 2014, 10:37:12 pm
Something vaguely like advfort for arena mode so modders can test buildings and reactions without going through worldgen.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: indyofcomo on June 30, 2014, 09:54:51 am
How about something which would allow us to get back reason(s) why something is not being done? Like why when I have tons of bolts but soldiers are without ammo. Rather than posting on the forum and getting a set of things to check, I can just debug it myself.

I had another thought, but it's escaping me right now...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on June 30, 2014, 10:10:16 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 30, 2014, 06:39:24 pm
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. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on June 30, 2014, 06:59:51 pm
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.

My partial solution is to iterate through df.global.world.status.reports and look for INTERACTION_ACTOR and INTERACTION_TARGET events, require that they happen at the same time, then walk through all the units in df.global.world.units.all and find what reports are in their personal report lists to find out the attacker and defender, then fire the event. Too slow to do very often in Lua, but it's fine for EventManager. It shouldn't be too difficult to implement it yourself in Lua if you want to play with it in r5. I haven't actually done it yet, but theoretically it should work.

There are a few corner cases that misses, like one unit doing an interaction on many simultaneously, or two units using the same interaction on the same tick on two distinct targets, but I'll keep fiddling with it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on June 30, 2014, 07:04:52 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 30, 2014, 07:39:48 pm
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?

Don't work on this!  You have far better things to do.

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. 

It's a problem that's in the process of going away, but I thought I might as well post the idea in case it was easy. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on June 30, 2014, 08:11:16 pm
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...

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on June 30, 2014, 08:33:29 pm
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. 

Stonesense could stand to render a lot less than it currently does.  I did some quick calculations (https://github.com/DFHack/stonesense/issues/18) for the minimum screen-filling size, and it involves rendering at least double what it displays, and more for any non-square window.  That's probably even more than the 2D render underneath, without even considering players setting it way higher than they need to...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on June 30, 2014, 11:00:51 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on June 30, 2014, 11:09:16 pm
Not really. You just have to iterate through all the dwarves and filter out the ones you don't want. The only alternative is to keep track of what dwarves have what labors yourself and keep it updated often enough.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on June 30, 2014, 11:14:57 pm
Well, I was asking if there's any existing plugin:)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 01, 2014, 12:00:42 am
A GUI for selecting specific job items for queued jobs in workshops.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falconne on July 01, 2014, 03:42:30 am
Well, I was asking if there's any existing plugin:)

If you're just looking for example code then my DwarfMonitor plugin (http://www.bay12forums.com/smf/index.php?topic=123279.0) does that for building its reports. Also I expect autolabor does too.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: indyofcomo on July 01, 2014, 08:27:30 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on July 01, 2014, 08:47:14 am
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.
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: palu on July 01, 2014, 04:43:39 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scamtank on July 02, 2014, 02:33:16 am
Let me throw out something outrageous: do you think there'd be a way to hijack engraving jobs so you could control the subject matter to some extent? Like being able to decide between ancient history, fort events and idle doodling of animals.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: MeMyselfAndI on July 02, 2014, 10:10:22 am
Not something I'd use, but that reminded me of something.

A plugin that allows manager-style controls for engraving / skilled architecture. So I can get my non-skilled dwarves to build the things that aren't affected by low quality while preventing them from building my well or engraving my dining room.

You can do this with burrows, but micromanagement galore.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on July 03, 2014, 12:42:47 pm
Quick request: A script that plants a colony (which we already have), of a specific vermin type, around/nearby a workshops.

Run reaction "create colony" => somewhere in a radius around the workshop a few colonies of this vermin spawn.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on July 04, 2014, 07:32:08 pm
Is their a way to rotate buildings using dfhack?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: palu on July 04, 2014, 07:46:33 pm
Upgradebuilding.lua. Create 4 buildings, all with the same reactions, and reactions to convert them to any of the rotated buildings. Add one to your civ.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 06, 2014, 05:21:39 am
I have the opposite of a suggestion: what sorts of things are hard/awkward to make happen or not happen during worldgen? For example, it would probably be possible to run a script during worldgen and suppress all wars, or make sure that a certain civ doesn't go extinct by fiddling with historical events as they happen and censoring ones that you don't want to have happen.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scamtank on July 06, 2014, 05:25:15 am
Dislodging demon rulers once they take the throne, I guess.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: thistleknot on July 09, 2014, 06:03:39 pm
auto-dump things that cause miasma?

nevermind...
http://www.bay12forums.com/smf/index.php?topic=24351.msg273948#msg273948
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: arbarbonif on July 09, 2014, 07:26:06 pm
I have no idea if it is possible, but I would love an improved find sites on the pre-embark map.  Something where you could put in criteria pulled from prospect, like "sand & lignite & native silver"  or even ">10K native gold"
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Sorcerer on July 12, 2014, 06:25:27 am
Automatic Building Blueprints for above ground constructions.

building with reaction to build constructed wooden walls and floors around it, if constructed is impossible, use tiletypes instead?
makes building aboveground a bit easier, could be interesting for things like kobold camp (leather tents) masterwork humans, and MLP mods that mostly use surface dwellers.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: indyofcomo on July 16, 2014, 01:32:08 pm
automatically lining up engraved slabs with coffins according to the occupant.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on July 16, 2014, 06:40:59 pm
A way, possibly through Workflow, to automatically engrave a slab for any ghost that rises. 

Upgrade Buildingplanner so you can specify that slabs must be engraved.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: TheDorf on July 16, 2014, 07:15:49 pm
I can't believe this hasn't been suggested already, maybe it's just me who's crappy at using the search function :p

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. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on July 16, 2014, 07:32:02 pm
I can't believe this hasn't been suggested already, maybe it's just me who's crappy at using the search function :p

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. :)
That already exists. Roses made a script like that, except with the reload/question thing. But the rest pretty much works.

https://github.com/Pheosics/DFHack_spells/blob/master/projectile.lua
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: TheDorf on July 16, 2014, 08:14:07 pm
I can't believe this hasn't been suggested already, maybe it's just me who's crappy at using the search function :p

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. :)
That already exists. Roses made a script like that, except with the reload/question thing. But the rest pretty much works.

https://github.com/Pheosics/DFHack_spells/blob/master/projectile.lua

Thanks :D This looks like something I should learn :)


Edit: Uhh... How would I go about adding these to weapons? :3
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on July 16, 2014, 08:54:10 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on July 16, 2014, 09:14:41 pm
PS: Mixing this with putnams projectileExpansion script allows even more fun.

https://gist.github.com/Putnam3145/7005764
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 16, 2014, 09:18:17 pm
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/projectile-trigger.lua).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 16, 2014, 09:24:44 pm
Yo (https://github.com/expwnent/dfhack/blob/develop/scripts/modtools/item-trigger.lua).

Aw, shucks.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 16, 2014, 09:26:32 pm
Hehe, I linked to the wrong one.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: TheDorf on July 16, 2014, 09:46:22 pm
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.

Ahh, I see. Thank you for the clarification, I'll go take a look at syndromeTrigger too, then. I'll wait for the next release of DFHack before I start using this in mods, but I might mess around with some .34 modding then, just to get into using DFHack in general. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 18, 2014, 04:05:39 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: fricy on July 20, 2014, 05:33:22 am
A script/plugin that designates any built furniture ( bed, coffin, are the main targets) that is not yet part of a room as the appropriate room and resizes it. Make it accept furniture type and room type as an argument and run with repeat.
That would make it possible to automate another chore: bedroom and coffin building.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Isngrim on July 22, 2014, 05:52:11 pm
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"
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: YAHG on July 23, 2014, 06:10:40 pm
Tracking Melt stuff. Being able to see how much metal has been duped sacrificed you could run anything else dfhack can do already, as a reaction (gods could punish etc.).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Draugo on July 24, 2014, 02:53:42 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 24, 2014, 02:56:30 am
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Draugo on July 24, 2014, 05:55:33 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 24, 2014, 06:21:16 am
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.

Oh sorry then, I thought you meant mouse cursor..
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Tzyx on July 24, 2014, 06:24:47 am
is mousequery working with the new DFHack then at the moment?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on July 24, 2014, 07:36:47 am
It appears to be.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: palu on July 24, 2014, 01:36:21 pm
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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Draugo on July 25, 2014, 01:07:33 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 25, 2014, 01:28:39 am
It's similar. Also consider digFlood.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: YAHG on July 25, 2014, 08:27:06 am
Spoiler (click to show/hide)

Perhaps with mousequery and dfhack the way it lets you press 'm' do go back and forth from box to single tile click, it could let you with another key like say:

v: digv clicked
l: digl clicked
V: digvx clicked
L: diglx clicked

I think the code is already there to run those commands at the cursor, the issue would be changing the trigger of the script to the left mouse down action (seemingly already captured by dfhack) with the above or similar filters added to the designation window in addition to the current "m" option.

Something like a forced single toggle option would be great. hitting m,v,V,l, or L would toggle that option and disable all other options, so it would be simple to control yet also very powerful.

This would work well with existing mousequery.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PatrikLundell on September 22, 2014, 05:08:52 am
These might exist, but I've failed to find them.

Job priority to get e.g. the Grower to only perform farming jobs as long as there are any, and then Gather Plants as long as there are any, and then Haul Stuff (possibly with priorities there as well, so that Refuse hauling and Animal hauling can be taken care of before hauling yet another stone or piece of wood [want that hide to get to the refuse pile so the Tanner can pick it up, and the strays rounded up before the wolves get them]), but go back to the farming task as soon as another seed needs planting.
Ideally priorities would be assignable per worker, overriding a default set. As it is, I get bogged down by having to disable Hauling on e.g. my Milker when it comes time to do milking and then add it back afterwards, or the hauling jobs will just keep blocking the Milking, and it goes with most jobs that are not "permanent".
I think this can be done crudely with DFHack scripting/plugin by disabling the lower priority capabilities on the worker, run the job matching, and then adding capabilities back one after another until a match is found, at which time they all would be added back, but that will probably result in a mess in the GUI, where the player will see job capabilities being added and removed (apart from also using CPU). Hopefully there is a reasonable way of implementing this, though. I don't know if Repeat jobs in workshops are finished and then restarted for each instance completed, or if the job keeps going until the job (or capability) is removed. The latter might complicate things.

Dwarf Therapist (or similar) access to the pre embark screen, to allow me to allocate starting skill points to dwarves that are actually suited to the tasks. Currently I ignore allocating points and just get livestock instead, allocating the skills on arrival instead, but that probably doesn't work in a hostile environment where you need to dig fast and defend your miners from get go.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Insanegame27 on September 22, 2014, 07:33:22 am
I was hoping for a script that always ensured there is always at least 1 of a certain caste at world-gen
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Psyra on September 22, 2014, 10:10:40 am
I'd 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

Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on September 23, 2014, 01:16:14 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PatrikLundell on September 24, 2014, 02:44:02 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on September 24, 2014, 02:47:15 am
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.

https://github.com/DFHack/dfhack/blob/master/Readme.rst#restrictliquid
https://github.com/DFHack/dfhack/blob/master/Readme.rst#restrictice
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Insanegame27 on September 24, 2014, 04:58:59 am
a way to unfreeze ice

and

a way to remove something from a fort and then have a caravn arrive and then it arrive as a caravan guard
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Probe1 on September 25, 2014, 12:21:30 am
I've always wanted an autogather plugin that functions identically to autochop except for gathering plants.    I don't have the energy to constantly designate gather plants on my clay/sand areas.  But my dwarves do.  If I could have exactly what autochop does, from burrows to a very convenient UI, but for plant gathering I'd be so happy.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: nomad_delta on September 25, 2014, 05:00:57 pm
If someone were to make a patch to fix or in any way work around the bug where Marksdwarves won't ever take [C]ombat designated bolts out of their quivers to make room from [T]raining designated bolts and therefore get stuck with metal bolts in their quivers and refuse to train ever again... (http://www.bay12games.com/dwarves/mantisbt/view.php?id=4530 <-- that one) it would make me so happy.  :)

Apparently someone on the bugtracker made a binary patch that fixed or worked around it once, but that was posted many versions ago so no doubt it no longer works.

This bug has been around forever and makes it so the only practical options for Marksdwarves are either:

1. Only let them use Wood/Bone bolts for both combat and training, no metal bolts -- this way they suck in combat vs armored things.
2. Let them use bolts of any material for both combat and training -- this way they burn through your expensive and finite metal bolt supply like there's no tomorrow.

--nomad_delta
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Psyra on September 26, 2014, 09:46:21 am
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.

Splendid! Much thanks!

Now just need to figure out how and where to plug that in. ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on September 26, 2014, 01:54:23 pm
You could save it as a script in <DF>/hack/scripts (e.g. "hack/scripts/unassign-beds.lua"), then run "unassign-beds" in the DFHack console.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on September 26, 2014, 03:58:24 pm
Assignment is slightly more difficult and I'm not sure about how to go about it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on September 26, 2014, 04:00:11 pm
I'd 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
Dwarves 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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Trouserman on September 26, 2014, 10:28:39 pm
Would it be feasible to make a way to add space to an existing stockpile? Either drawing new areas onto a pile, or merging two piles into one, would be quite handy.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on September 27, 2014, 08:56:50 am
It should be possible to adjust the stockpile's coordinates, although I'm not sure if that would trigger new hauling jobs. In the meantime, to increase a stockpile's size, you can designate a new stockpile next to an existing one and use "copystock" to copy over the old stockpile's settings.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scamtank on September 29, 2014, 02:49:00 am
Here's one: could you disband squads remotely, without using the military screen?

This is mainly to sidestep the bug where if a squad-leading/commanding noble gets [REPLACED_BY] a higher ranked one, the commander is kicked out of the squad, making it disappear from the military screen. You can still order the remaining squaddies around, but you can't adjust their equipment or anything and the empty squad will stay in the list forever.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Greiger on September 29, 2014, 03:30:50 am
A dfhack script for use with soundsense in adventure mode.  Detects when the player enters the travel map, and detects what kind of place they leave the travel map to, as well as when the player is in the local map and transitions to a diffrent kind of area.  Once it detects such a transition, it writes a line to the gamelog so soundsense triggers can detect it, and the player can customize the music.

Such as "You are now on the travel map" or "You have entered the human town of happyshopping" or "You have entered the dark goblin fortress of Alespit" or "You have entered the territory belonging to the abandoned dwarven fortress of Boatmurdered."

Not a complete list, and I'm not actually sure if DFHack can detect that kind of thing, but I can dream I guess.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: dwarf_reform on October 04, 2014, 01:06:32 am
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? I'd like this for sorting out low-quality stuff and other junk for specific atom-smashing..
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: ptb_ptb on October 04, 2014, 06:55:03 am
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.
https://github.com/DFHack/dfhack#autodump

e.g. autodump damaged
damaged : select only items with one or more levels of damage.

-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

I've just had an idea for a dfhack script.

idlepause [%] [n]
% of dwarves (default 50%)
n ticks (default 50 ticks)

Automatically pauses the game when % or more of the dwarves are idle. On manual un-pause, remains unpaused for next n ticks regardless of idle numbers.

Basically my idea is that if you have all your dwarves set to do some big task and leave DF running it will pause automatically when they have finished.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on October 04, 2014, 07:33:49 am
That should be fairly simple, although I'm not sure how much it would impact performance if done with a Lua script. It would probably be more efficient to check every five frames or so (or allow the delay to be configured) than to check every frame.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Suds Zimmerman on October 05, 2014, 11:42:53 am
Since the changes to the [IMMOBILE] tag in DF2014 are causing issues with creatures not being to attack or use interactions at all, would it be possible to prevent a creature from moving with DFHack, but still allowing it to attack?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Korvar on October 05, 2014, 01:34:00 pm
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. 

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on October 05, 2014, 04:01:22 pm
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. 

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.
Doesnt that already exist?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on October 05, 2014, 05:51:55 pm
I don't believe it does.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on October 05, 2014, 06:43:16 pm
It would be great if building planner could have an option to place memorial slabs only.

And for workflow to auto-carve memorial slabs.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Korvar on October 06, 2014, 05:43:57 am
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. 

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.
Doesnt that already exist?

There is added search functionality on Rooms, Units, Jobs and a few others, but not the Slab Engraving specifically.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on October 06, 2014, 09:42:09 am
Sorry if this was suggested before; I tried searching the thread and came up empty.

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Itnetlolor on October 07, 2014, 11:35:54 am
Sorry if this was suggested before; I tried searching the thread and came up empty.

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 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.

However, is it possible for anyone to simplify my process, and actually make it a separate DFHack-able?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: katwithk on November 12, 2014, 12:52:42 pm
A simple plugin to read the number of idlers and force a pause (with alert window) when it rises above a configurable number (and/or percentage)

Useful for those of us who DF and do other things at the same time
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: rmblr on November 13, 2014, 07:41:26 am
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Korvar on November 13, 2014, 11:43:32 am
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?

*raises hand*
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: katwithk on November 13, 2014, 03:13:00 pm
I second the motion described above.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: hanspeter on November 13, 2014, 10:12:30 pm
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.

Would really love to see that.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on November 13, 2014, 11:12:14 pm
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.

Would really love to see that.
Maybe it should have to be an artifact.  We can call it Lord Stanley's Cup.  :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: dwarf_reform on November 14, 2014, 02:49:24 am
Would it be possible to set up a command that enables a creature to be playable in adventure mode? I know how to do it by hand, but having it automated would be beyond friendly :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: jwhite.df on November 15, 2014, 08:55:20 pm
Hmmm, how did I miss this thread before? I posted a separate "like autobutcher for eggs (http://www.bay12forums.com/smf/index.php?topic=145375.0)" thread but maybe this is the correct place for it.

Currently, there's a lot of management that goes into controlling access to eggs that I want hatched. Generally that means a separate hatchery room with a locked door. Getting the hatched young out of the room without harvesting other eggs in a hatchery means manually forbidding them before unlocking the door.

Something mimicking autobutcher's functionality would be nice: automatically forbid the X oldest eggs of any given species. That way, all egg laying (food and hatchery) can be done in the same room, no need to lock doors, no need to forbid eggs.

Next request, auto-cage the hatched young to prevent FPS hits, then free them as they age out. :-)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: rmblr on November 16, 2014, 06:56:21 am
Have you seen autonestbox? It doesn't have all the features you're looking for, but is a big time saver nonetheless.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: jwhite.df on November 16, 2014, 04:16:32 pm
Have you seen autonestbox? It doesn't have all the features you're looking for, but is a big time saver nonetheless.

Autonestbox is really nice, and does a great job at saving time on the assignment of birds to 1x1 pastures on top of nest boxes. That's the kind of thing it would be nice to have for hatchlings and cages, right?

I think the single room with a specific number of eggs automatically forbidden is better than a main pasture room with specific locked doors to hatchery rooms.

Code: [Select]
   #   #   #   #
   #   #   #   #
   #   #   #   #
   #   #   #   #
   D   D   D   D
################
################
###Pasture######
################
################
   D   D   D   D
   #   #   #   #
   #   #   #   #
   #   #   #   #
   #   #   #   #

Unless there's something easier that I'm missing. The idea behind this is a steady stream of meat and hides for leather, while still having bulk eggs for staple food production.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meneth on November 20, 2014, 02:20:03 pm
I'd like something that pauses the game and pops a warning whenever any creature enters the map. While one might not care about Foxes or Crundles, Keas and Giant Cave Spiders deserve my attention.

Optional: filter by creature type.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meneth on November 22, 2014, 07:02:59 pm
I cobbled together this little script (https://gist.github.com/Meneth32/06f9b01db111778b4c42). Works pretty well for me.

However: no options, can't be disabled once enabled, needs to be rerun each time you start DF, and alerts even on creatures in caverns you haven't opened yet.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: disacorns on January 13, 2015, 12:20:06 pm
some thoughts off the cuff, (havent read all the suggestions so some mb repeats, also dont know how much of this possible)

*a kind of suspend state, for faster loading.
*monthly autosaves.
*also dont need so many backups, just one or two. mb a quick rename. (obviously these things can be done quickly enough without a mod, but still)
-
*combat control. get the stupid dwarves to stop attacking, if necessary.
*get marksdwarves to fetch ammo instead of trying to bash the fire breather.
*train marksdwarves - assign training job? something like that to get the marksdwarves to actually use those targets (consistently).
*equipment check. they don't go out without their equipment. or at least a way to quickly check what equipment is not being worn (despite the useless check in equip) (seems like something for therapist)
*get the soldiers to drop the bin theyre hauling. ditto civs, when theyre running from something (canceling the job doesnt work)
*fire control- dwarves running around with buckets trying to put out the fires
* someway to know my farmer is fighting capuchins.
-
*fps check. could there be a way to see exactly what is killing fps? some kind of process manager.
*pathing. where exactly are the biggest pathing problems.
-
*farm manager- how much food/drink will the farms produce, factoring in level of planter, subtract number of dwarves eating the food. ditto clothing/dye.
*autodump excess plants/meat/tallow

---
thats it for now, mb ill have better ideas later.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meneth on February 18, 2015, 07:13:37 pm
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.

The reply is a bit late :), but I just wrote a script warn-starving.lua (https://gist.github.com/Meneth32/ff6fab74d327d4cde84c). It warns about starving, dehydration, and drowsiness. I haven't tested it with an actually starving creature yet (those are a bit hard to generate), but at least it behaves as expected (i.e does nothing) in my current fort.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: YAHG on February 18, 2015, 07:38:43 pm
I like to play "peasant fortress" and only embark with no skill dwarves, it would be cool of there was a plugin/script whatever you call it that made it so that all immigrants would show up with no skills at all.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on April 08, 2015, 06:53:02 pm
I'm not the only one who would like an automilitary plugin. (https://www.reddit.com/r/dwarffortress/comments/31w515/automilitary/)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Kirkegaard on May 13, 2015, 01:57:08 pm
Dismiss traders
Add an option to the trade menu to "dismiss traders" so you can ask them to leave when you are done with them.
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"

No traders
Add an option to make traders stay away from the fortress (alternative make them leave right after they arrive)

The reason for those two suggestions is that I rarely use the traders for anything, so they just arrive and take up space, get's killed and drop lots of random stuff around the world. I'm guessing I'm not the only one playing a rather trade-light game, so think it would be two useful options.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: cata2k on July 07, 2015, 11:23:48 am
"Diglayer" or "Digflux"to easily mine flux stone from a layer
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 07, 2015, 03:05:46 pm
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"

If it were that easy, we could also find and reuse the built-in "send a siege" command and the built-in "create a unit" command
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: cata2k on July 09, 2015, 12:00:12 am
Dig exposed. DFHack looks for exposed vein stone and gems in the layer and digv's them
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 09, 2015, 12:09:42 am
you can do that in vanilla with the "automine gems and minerals" setting
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: cata2k on July 09, 2015, 12:29:15 am
you can do that in vanilla with the "automine gems and minerals" setting
Where do I find that setting?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 09, 2015, 12:30:08 am
designations menu, mining, at the bottom
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: taldarus on July 20, 2015, 10:54:06 pm
Just wanted to check, this seems to be the pace for it. I have a project I am working on. Kinda depends on being able to spawn creatures, both from the workshop and worldspace in general. I have seen that people seem to be able to do it, but I was looking to do some 100+ creature spawns. Has there been any progress in this regards?  I see people an do it, but it sounds to be to time management heavy. (I don't mind mindless and repetitive work, it's relaxing)

I could use transformations for about 60% of the reactions, but it won't have the 'feel' that I am going for. The other would be for something like a plant, and it changes into a creature (triffid). I suppose I could transform wandering creatures, but again that wouldn't feel right.

I recently taught myself a fair portion of C++, in part for modding df; but I also realize I am definitely in the amateur category. I have sifted through the forums trying to find something on v0.40 creature spawns, but haven't found anything but troubleshooting. Also looked through the github scripts for dfhack. Feel like I am missing something obvious.

Trying to level up my modding :) Links or advice would be cool
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 20, 2015, 10:57:54 pm
i'm still an amateur

anyway, what exactly are you looking for? spawn-unit is lying around in various places, Sparking is the only mod that uses it in 0.40 AFAIK
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on July 20, 2015, 11:02:41 pm
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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 20, 2015, 11:32:23 pm
I'm using it for invaders because everything else is dumb and probably not working, I wouldn't put it in yet

hell, even invaders have to have some manual flags flipped to work, and even then they don't behave quite properly
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: taldarus on July 20, 2015, 11:38:54 pm
Hard to explain what I am doing... It's a practice mod, meant to teach myself the basics of advanced df modding... It's kinda growing wild though (I think my practice mod will surpass my original goal in coolness)

Trying to upload an image of my outline, but it's too big and awkward. So.. think birth of the Tyranids via Biochemist Ants evolving. Originally, I was just going to add a simple reaction that would allow you to chemically alter your 'eggs' to upgrade them into stronger versions.

Devolved (Size 10,000) -> 'stumbles onto upgrade' A reagent-key that unlocks new workshops and abilities
T1 (Size 60,000) -> Each tier would have access to newer and better materials that the colony would 'grow'
T2 (Size 80,000) -> Eventually you would get access to many advanced biochemically-based technologies.

The whole species is something I developed for a short story I wrote. It was an attempt to explain what a space-faring hive-mind species would probably look like. To keep it short, I even have a mind map worked out. I could do it, if I could figure out this one hitch.

Altering eggs, easy.
Unlocking tiers, easy.
Spawning the altered egg so that the correct Caste is born? If I was on v0.34 I think i could do it by myself (again, need to study it)

This is actually the tip of the iceberg. Idea's are just exploding in my head. It still hinges on being able to spawn units though. I could have a working creature file, with castes setup and everything ready to go...In about 4 hours (Already got the 'precast' done, so just need to add in Castes). Workshops, again, easy to do; but I am less familiar with all that, so I would need a couple of weeks to work it all out.

DFHACK, completely unfamiliar territory to me.

(Trying to figure out how to link my mind map)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 20, 2015, 11:56:27 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 12:18:47 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 21, 2015, 12:47:01 am
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.

Using the original DF code is just more reliable and much less code to write and maintain.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 12:58:28 am
The idea is to make it so that it works better, including nemesis entries. It just doesn't work yet.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 21, 2015, 01:13:49 am
The idea is to make it so that it works better, including nemesis entries. It just doesn't work yet.

Where's the latest version?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 01:22:13 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 21, 2015, 01:27:21 am
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!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 01:39:10 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 21, 2015, 01:55:06 am
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.

What are "all cases"?
The most basic version that creates dwarves is just several lines of code https://gist.github.com/pronvit/f665d13e5eb70f5da1e3
I'm not sure I'll have time to improve it, but I was thinking it doesn't need to be fully-automated because viewscreen_layer_arena_creaturest also gives us a free UI to choose a race, skills, effects.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 02:04:26 am
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 would add:

5. Do pets work?

6. Can new dwarves join the military / take on noble roles?

Before and after saving and reloading of course, in each case.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 02:09:56 am
PS: For scripts it will need to be fully-automated, since when the mod requires many evil goblins to show up out of nowhere you don't want the user to be consulted and spawn fluffy wamblers instead.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 21, 2015, 02:20:16 am
I'll try, but again, I wasn't saying it would solve all the problems. You'll need to configure the unit afterwards to get the behaviour you want. But at least no need to deal with body/appearance/personality/next_ids and to worry about some of the data being uninitialised and thus causing problems.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 02:22:58 am
Oh, sure. It would be great if it works for all cases though. That way we won't have to work out how to fix the script every time there's a new significant DF release.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 02:24:25 am
I think you need to add "links" to the proper population for them to truly be a member. See the spawn-unit version I linked for details.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 21, 2015, 02:38:30 am
Also, about configuring after: just make sure it's usable with script_environment if it's a lua script (make the primary spawn unit function global, make it so that it doesn't actually do anything if zero arguments are presented)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 02:39:26 am
I can manage that bit myself once the core functionality is there. That part's easy.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on July 21, 2015, 03:36:50 am
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've been waiting for this about a year now. You truly are a wizard.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 03:39:19 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 21, 2015, 03:41:22 am
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.

What do you mean? Obviously it doesn't create histfig, so you can't assign to noble positions, etc. I'll look into histfig/nemesis later, maybe there's some code somewhere in the game that we can use.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 03:51:53 am
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.

Still, this helps. I'll keep trying tonight. I might be able to get spawn-unit working from this and the old version.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 21, 2015, 03:57:57 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 21, 2015, 04:11:56 am
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.

(http://images.akamai.steamusercontent.com/ugc/885234158935936474/EE6D4D1241951ADCEA51062F9D1BF935C3651E93/)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 21, 2015, 05:31:47 am
Results are promising. I'll try and post a beta version today after some tinkering.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: taldarus on July 21, 2015, 07:52:34 am
*Sleepily stares at screen*

Thanks for the link, and a beta version sounds cool. So badly want to work on this, but must wait for sleep.

ty
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on July 21, 2015, 08:48:51 am
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.
I 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 args.civ_id then args.civ_id = tonumber(args.civ_id) end

Putnam had mentioned that Sparking might have a version that returns the unit ID.  Haven't had a chance to check that out yet, but it would be useful for fiddling with the spawned creature's mind (setting to attack a specific creature, etc.).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on July 21, 2015, 09:17:30 am
I'd personally like to add a suggestion:
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on July 21, 2015, 10:04:07 am
I'd personally like to add a suggestion:
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.
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 21, 2015, 05:07:24 pm
With viewscreen_layer_arena_creaturest approach it's very easy to add equipment.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: StagnantSoul on July 21, 2015, 05:13:12 pm
One to change the quality of enhancements on items. I can go k-change item-q-5 and it'll still have superior encrusts and such.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on July 21, 2015, 06:26:36 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 21, 2015, 07:05:47 pm
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.

New dwarves created with viewscreen_layer_arena_creaturest have preferences.
But no relationships of course because it doesn't create a histfig.  On the other hand, relationships totally depend on what you're creating (civ member, pet, invader), so can't be created fully automatically.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: taldarus on July 21, 2015, 07:52:38 pm
hafta re-write this...

Dirst- Your code sounds perfect, gonna study it. Have very little clue how to use it of course, but thats part of the fun :)

Meph- Try building in organic weapons? They wouldn't be lootable, but you could actually add the item as a part of the corpse? Something like:

body:Sworddwarf
   [BP:SW:sword:swords][CON:Right_hand][CATEGORY:STEELWEAPON][DEFAULT_RELSIZE:?]

Then you should be able to alter the materials of the steel weapon to match up with a 'real' one. I could have done this pre v.34, and could try to though together a demo if you wanted. ( I like my mod, but I really can't play w/o Masterwork :)

A link to something like this, but way out of date (I did this w/o internet, btw and am super proud):http://www.bay12forums.com/smf/index.php?topic=124299.msg4129409#msg4129409 (http://www.bay12forums.com/smf/index.php?topic=124299.msg4129409#msg4129409)

--OR--

Spawn items at their feet, and hope they pick em up? (I assume someone has tried this though)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on July 21, 2015, 08:15:13 pm
You'll see that the comments in that code give a lot of credit to others.  The parts that look like duct tape would be my contributions :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: taldarus on July 21, 2015, 10:52:34 pm
:) I know, its a group effort, but you are where I found it
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on July 22, 2015, 01:44:01 am
Organic weapon/armor bodyparts work, but are super clumsy. And for invaders I wouldnt need them to be civ-members of any type, just random hostile units. I can give them basic AI just with BUILDING_DESTROYER or with tags that make them path into your fortress.

All I want is to say "spawn 15 bandits at map edge", makes 15 humans with iron/leather gear. Or "spawn elite orc warband" with specific orc gear and materials. And even better, using creatures that dont have a civ, for example "You angered the forest. Face the wrath of Gaia", spawn 50 treants/Ents on the map edge, ready to tear down your Isengard.

Non-procedually generated invaders, so to speak.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 22, 2015, 01:47:17 am
Equipment is the easy part. We already have good tools for making items, and it's simple enough to equip them on creatures, even in silly ways if you want them to wear their pants on their head or something. The "proper" way to do it would be to have them be separate functionality: one tool for creating units, and one for equipping them. That way if you want to do a magical girl transformation or whatever you can reuse the equipment script to replace what they're wearing.

Hmm...I wonder if wearing armor on your brain would give it extra protection.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on July 22, 2015, 03:27:17 am
And the locations can be made "random map edge tile" or something like that? Or "random cavern 1,2,3 map edge tile"
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 22, 2015, 03:39:13 am
I can write a make-invasion script or something that does that. You'd have to specify which unit equips which item at which body part, which would be tedious copy-paste work, but it shouldn't be too bad.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on July 22, 2015, 04:11:35 am
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. ^^
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 22, 2015, 04:14:02 am
That's absolutely possible. I'll try and get the base script working first though. It works in the most difficult case (spawning fort dwarves that can take on noble and military positions, even after save/reload) but I have to make sure it works for pets and invaders and wild animals too.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Meph on July 22, 2015, 04:16:45 am
Thank you.

Please mind that I won't do much with it the next 2 months though. I'm still away, but getting towards the end of my trip. After that, I'd be more than happy to give people more FUN with a script like that.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 22, 2015, 09:35:22 am
Please beta test thoroughly. (http://www.bay12forums.com/smf/index.php?topic=152119)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: taldarus on July 22, 2015, 09:38:20 am
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?

EDIT:I have to look over Expwnents thing
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 22, 2015, 09:41:32 am
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?

Are you talking about spawn-unit or create-unit, the one I posted a few minutes ago? I have have ninja-posted above you.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: taldarus on July 22, 2015, 09:45:39 am
Was just checking your thing, might be perfect.

Ninja of awesome!

Edit: Really want to try it out, but it's super late atm. Still wondering about how to hook this script to the reaction I want though. Try it out tomorrow. Looks like this is good enough for me to churn out my creature castes.  8)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on July 22, 2015, 10:07:12 am
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. ^^

My events system can handle running scripts after certain criteria are met (e.g. X goblins killed, X goblin sieges, X time, X deaths, etc...). I haven't worked on the system in awhile since it's main purpose was to create better sieges and monster attacks, but there wasn't a working create-unit so I put it on hold. With the new create-unit I will continue working on the system. And, when combined with my civilization system, it should allow you to slowly level up the other NPC entities so that you are continually challenged.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on July 22, 2015, 10:09:18 am
Roses: By the way, let me know when you consider your scripts to be stable and I'll include them in the main repo.

Sounds like a great way to do invasion scaling over time.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: arbarbonif on July 23, 2015, 05:12:43 pm
Could you create a UI to set what the default priority for jobs spawned from a given workshop or stockpile are given?  Combined with workflow that could help make sure that you always have coal by having the coal smelter be higher priority than the metal smelter (that uses the coal).  And have a large "if there is nothing else to do" stockpile and a smaller "always keep this filled, no matter what" stockpile (and help control who does hauling based on importance of what else they are doing).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 23, 2015, 06:05:51 pm
i'm not entirely sure if job priorities are even things we can effect except by setting jobs to urgent
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Isngrim on August 07, 2015, 02:20:54 pm
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?
basically: Dwarf equips weapon that was used to make 10 notable or unnotable kills, an item upgrade script is called making the weapon stronger,or the dwarf gets a strength boost.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: fricy on August 07, 2015, 03:19:54 pm
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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Isngrim on August 07, 2015, 04:17:58 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on August 10, 2015, 12:34:46 pm
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.

You did not miss anything. Currently that particular feature is not an option (you can trigger scripts based on number of global kills, but not on specific weapons). It is sobering I would like to add, but is currently buried under a very large to do list
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Isngrim on August 11, 2015, 01:42:01 am
Ill just have to base it of the skill of the wielder for now then....using Roses scripts i might add
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Isngrim on August 16, 2015, 12:26:51 pm
Is it possible (or is there a script that can) to change an individual creatures CREATURE_CLASS through DFhack?

I'm looking for a way to have nobles that are supposed to be the strongest in the fort,but i want to avoid a transformation.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on August 21, 2015, 11:16:43 pm
It is likely impossible.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on August 21, 2015, 11:20:56 pm
It is totally impossible. CREATURE_CLASS is a raw-only thing.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Manzeenan on September 01, 2015, 09:22:26 pm
has anyone mentioned an improved quest gui that tracks quests for different civiliations? Like pre df-2014
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Atomic Chicken on September 04, 2015, 08:12:24 am
Not a plugin request, but this seems to be the general thread for dfhack suggestions. How about an official alteration of syndrome-trigger to add support for detecting syndromes by syn_class instead of syn_name if required? It would be quite a useful feature in my opinion.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on September 04, 2015, 08:20:09 am
It's in syndrome-util but not in modtools/add-syndrome.

Code: [Select]
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
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: ramshield on November 20, 2015, 06:33:58 am
A script that automatically forbids eggs that are fertile?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on November 20, 2015, 06:41:32 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on November 23, 2015, 08:14:07 am
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?

Just kidding... a script to toggle gathering fertile eggs would be awesome.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: milo christiansen on December 04, 2015, 05:54:32 pm
but the main issue is canceling hauling jobs that have already begun.

I did that for my conveyor belt workshop...

Take a look at "User/DFHack/Powered/Belts" in the Rubble 6.16 package (that addon isn't included with Rubble 7 yet).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: jobywalker on December 12, 2015, 03:53:22 am
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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Pikkaro on December 22, 2015, 09:11:29 am
More suggestions:

- A way to highlight the cursor position, like a togglable cross centered on it. Would also help with aligning structures or designations that aren't immediately next to each other.

- Please make it possible to supply a keyword to the ls command. There are a lot of plugins, and looking for a keyword by reading all the descriptions is rather tedious.

- 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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: arbarbonif on December 22, 2015, 03:19:09 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on December 22, 2015, 04:59:28 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: forsaken1111 on December 22, 2015, 06:14:01 pm
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.
You can already do that, sort of, using workflow

Example, queue up a shearing job on your farmer's workshop and set a range for it for Wool of any type, 999-1000. The downside is that it will spam your announcements screen with cancellations but it WILL keep retrying every time workflow refreshes the jobs. I have this set up in my current fort and every animal is milked or sheared as soon as they are ready for it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on December 22, 2015, 07:44:28 pm
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.
I interpreted that to mean something in the sidebar, which would be somewhat difficult to fit in.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on December 23, 2015, 10:16:12 am
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.
I interpreted that to mean something in the sidebar, which would be somewhat difficult to fit in.
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Button on December 23, 2015, 11:58:37 am
'Scuse me - I know in 0.40.x there was a plugin to force a unit to give birth, but was there a plugin to query whether or not a unit is pregnant?

I have some Science I want to conduct in 0.42.x, and it would be much easier if I could query a unit for pregnancy rather than simply waiting for it to give birth.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on December 23, 2015, 03:04:00 pm
No, but you can use ":lua !dfhack.gui.getSelectedUnit().relations.pregnancy_timer" to print the number of ticks until the selected unit gives birth. (If it's <= 0, either the unit is giving birth or isn't pregnant.)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Pikkaro on December 29, 2015, 03:48:42 pm
Quote
This already exists; it's the view-item-info script. Unless you mean before mining it out, which is harder to deal with well.

Yeah, I was talking about the sidebar - it's virtually unused when looking at veins etc. right now. Sorry, should have been clearer there.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: jobywalker on December 29, 2015, 07:52:36 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on December 30, 2015, 03:14:16 am
There is a repeat script for that. (http://dfhack.readthedocs.org/en/stable/docs/_auto/base.html#repeat)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on January 06, 2016, 12:42:15 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: King Kitteh on January 06, 2016, 05:43:28 pm
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'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  :-\
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on January 06, 2016, 06:37:51 pm
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'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.)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: King Kitteh on January 06, 2016, 09:23:42 pm
Quote
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.)

Thanks. If you could do that it'd be very helpful  :)

Currently I'm tiding myself over by just setting [SKILL_LEARN_RATE] to zero for unpermitted labors.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on January 06, 2016, 09:32:24 pm
I got it to mostly work (and even color invalid labors red). The main issue is with Shift+Enter to toggle groups at this point - it would take some effort to figure out which labors are in each category, and preventing them from being toggled as part of a group would cause DF to always try to enable groups when pressing Shift+Enter (since they would contain disabled labors).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: King Kitteh on January 06, 2016, 11:04:10 pm
I didn't even know you could Shift+Enter to toggle whole groups in the first place  :P

I'm fine with that though, a small price to pay for what will help me alot. Thanks.  :D
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on January 07, 2016, 06:14:48 am
I didn't even know you could Shift+Enter to toggle whole groups in the first place  :P
But... There's a manual...

(Has anyone here ever seen The Greatest American Hero?)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on January 07, 2016, 06:24:07 am
To be fair, the manual is new.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: King Kitteh on January 07, 2016, 06:26:51 am
Quote
But... 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.

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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: King Kitteh on January 07, 2016, 06:28:14 am
EDIT: Accidently double posted  :-[
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: RickRollYou2 on January 07, 2016, 09:03:26 am
Quote
But... There's a manual...
sometimes hit '?' by accident.

Try pressing '?' a few more times while in the manual. ;)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on January 07, 2016, 09:40:12 am
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 was an early 1980's comedy series... might even have made it to Australia by now ;)
The premise was "What if you had a really powerful alien suit that gave you superpowers... and you lost the instructions?"
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on January 07, 2016, 02:34:40 pm
Quote
But... 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.
It's also listed right at the bottom of the labor screen, except when you've highlighted Mining (no subcategories.)

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:
(http://i.imgur.com/arwvNDt.png)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on January 07, 2016, 06:08:04 pm
Changing colors like that requires creating a new renderer, and I expect TwbT would crash if you tried adding another renderer. It would also be limited to specific print modes, which doesn't make sense for something like that. Is it possible to just add semi-transparency to the tileset's floor file?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on January 08, 2016, 02:52:28 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on January 08, 2016, 04:39:28 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on January 08, 2016, 07:30:35 pm
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'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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: King Kitteh on January 08, 2016, 07:39:48 pm
Quote
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.

Thankyou very much!  :D

This will be very helpful!

EDIT: Errr, where can I actually get it? I'm a bit of a nub  :P
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on January 08, 2016, 09:17:06 pm
You'll have to compile DFHack for it until there's a release, because it's part of a plugin (the tweak plugin, to be exact) which is written in C++ and needs to be compiled.
What platform are you using? I can compile for OS X and Linux (and as of an hour ago, I can compile for both *on OS X*, which is convenient), so I could upload a development version of the plugin for those platforms. If you're on Windows, I've been considering doing another alpha release soon, so someone should upload a Windows build with that change when the release happens.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on January 08, 2016, 09:57:22 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: King Kitteh on January 09, 2016, 03:59:59 am
Yeah, I'm using a windows computer. It's not urgent though so don't worry.  :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on January 09, 2016, 12:51:57 pm
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.

There's a beta version out. A full version depends on the harder parts of updating df-structures, which only two active members of the team know how to do.

I have a virtual Linux OS inside Windows for programming. It is not particularly difficult to set up or maintain.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Button on January 11, 2016, 01:19:12 am
You know what I'd like to see? An unroll/un-retract function that can be used on critters with RETRACT_INTO_BP critters. Bug #8627 (http://www.bay12games.com/dwarves/mantisbt/view.php?id=8627) can be seriously irritating.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: SatelliteOfLove on January 25, 2016, 11:22:13 am
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...

Has anyone tinkered with it?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 25, 2016, 02:29:57 pm
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...

Has anyone tinkered with it?
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: SatelliteOfLove on January 25, 2016, 04:10:33 pm
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...

Has anyone tinkered with it?
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.

I sincerely appreciate the reply, Warmist.  Yes, dfhack compiles just fine on Windows, but whenever I run df with dfhack enabled, I get tons of warnings that the plugins can't run because of missing globals.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on January 26, 2016, 01:46:50 am
So there are only two members of the dfhack team who even know how to update the structures?

That is approximately true. Technically peterix can too but he's not working on the project anymore. A couple other members have tinkered with it a bit. The problem is that the required skill/freetime to contribute significantly is quite high.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: fricy on January 26, 2016, 02:30:17 am
/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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on January 26, 2016, 12:35:03 pm
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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on January 26, 2016, 01:00:07 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: SatelliteOfLove on January 26, 2016, 01:12:36 pm
/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).

I did compile the 42.05 development branch and thank you for that information - I'll give it a try when I get home.  Thanks for all the input/suggestions, everyone.

Edit: 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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on January 29, 2016, 12:00:59 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: khearn on January 29, 2016, 03:32:50 pm
Suggestion: A plugin to automatically handle petitions for long term residence. I'm getting one every few minutes, mostly from wannabe entertainers in my overpacked tavern. I'd like to be able to set it up to either:
a) auto-deny
b) auto-accept
c) take no action so the player can decide

It should be able to be told what action to take, based on the type of petitioner (entertainer, scholar, soldier).

What I'd like to be able to do right now is auto-deny entertainers (hit the road, freeloaders), auto-accept scholars (we can always use another scholar), and let me decide on soldiers (Thanks, but we don't really need any pikemen, since we can't make pikes, but more axemen are welcome).

That's what would be ideal. I don't know how easy the above would be to implement, so I'll take what I can get. :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Darthania on February 02, 2016, 05:09:28 am
Suggestion:

Do you think you could put together an updated version of the Dwarvern Heritage Project? (http://www.bay12forums.com/smf/index.php?topic=112381.0)
It's something that *always* bugs me when I see all my dwarves with different names, hard to keep track!

Thanks :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on February 03, 2016, 03:39:30 am
It's still on my todo list. I'll move it up a bit.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Darthania on February 03, 2016, 06:03:32 am
Wonderful :)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Isngrim on February 03, 2016, 03:00:31 pm
Wonderful :)
seconded
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on February 18, 2016, 11:30:10 am
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.

Edit: This is now a vanilla feature.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on February 18, 2016, 03:24:35 pm
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.

That's actually possible. It would take some monitoring of jobs to keep track of what the item in question was but once you've computed what the item is you can find where it is and once you know where it is it's simple enough to alter the location field of the announcement.

The difference between plugins and scripts is technical. Plugins have less FPS impact and can do a few things we can't do in scripts but scripts require less skill to write.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: khearn on February 23, 2016, 06:17:13 pm
Some dwarven civs can make high boots, some can't. Same with robes. Some dwarven civs have access to iron, and some don't, leaving the player stuck with having to spend 300 embark points on a steel anvil, or start without an anvil. Some dwarven civs don't have access to cassiterite, so starting with the makings for smelting bronze isn't possible. But you can't know these things until you've already selected a civilization and get to the "prepare carefully" screen.

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.

A summary of who is at war with whom would also be nice. I usually end up selecting a civ, tabbing around to the relationship screen to see who they are at war with, then tabbing back to the civ choosing screen, selecting the next, tabbing around to see who they are at war with, and so on, ad nauseum. It's at least possible to find out war status before choosing a civ, but kind of tedious.

A summary similar to this would be nice:

The Hammers of Choosing
    Hostile with Goblins.
    Makes high boots, robes. Has iron.
The Boats of Indecision
    Hostile with Goblins. At war with Elves.
    Makes robes. Has cassiterite.
The Fist of Ash
    At war with Goblins, Humans.
    Makes high boots. Has iron, cassiterite.

There are probably other clothes/armor and minerals that would be worth reporting, and maybe other things that would be nice to know about a civ when choosing. Population maybe? That's available in region*-world_site_and_pops.txt, but could be put on the same line as the civ name w/o cluttering up the summary too much. Other ideas?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on March 10, 2016, 12:54:41 am
A stocks screen that exists as only a partial menu (like squad orders) that lets you easily check item locations.

A stockpile quality setting for xworn itemsx, if possible.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bogus on March 10, 2016, 06:16:00 am

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on March 10, 2016, 06:22:06 am

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.
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scamtank on March 10, 2016, 06:24:12 am
Remember this irritating bug? (http://www.bay12games.com/dwarves/mantisbt/view.php?id=9249) As used as I am getting to opening up the scroll's data in gm-editor and manually removing the third entry in the improvement vector every time I make one, it seems like something that'd be just the thing to automate with a script.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on March 12, 2016, 04:13:51 pm
I just went through the post, took many of the ideas and put them on the DFHack issue tracker, so that's nice. See Here (https://github.com/DFHack/dfhack/issues?q=is%3Aissue+is%3Aopen+label%3Aidea)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: devek on March 15, 2016, 04:54:30 pm
Not sure if anyone has brought these up before.

1) In theory the game has a "uniform" for civilian jobs, hunters/woodcutters/miners, has anyone looked if its possibly to get access to them so we can assign armor for hunters and wood cutters?

2) Dwarfs build underground roads between forts, you can see this in adventure mode or by reclaiming a fort in fortress mode. It would be nice if you could convince dwarfs/liaison to enter from underground.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: indyofcomo on March 21, 2016, 01:34:46 pm
I would love to be able to filter jewelry gem lists by cost. That would be way less annoying than swapping back 'n' forth between DF and web-browers/Excel/notepad/whatever.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bogus on March 22, 2016, 06:20:53 am
i would love to see callbacks for when a topic has been researched.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dozebôm Lolumzalěs on March 26, 2016, 02:52:02 pm
A script or plugin or whatever the name is - it's a one-time thing that only runs when you use a hotkey or type it into the command prompt. Like "warn-starving", although that might run automatically. Like "make-legendary," "liquids", "reveal" - you know?

Anyway, that kind of thing. A [THING] that when you run it, gives the selected creature (intended for adventurer) all the necessary tags to become a full citizen of the current fortress, or the site that the adventurer is in (if run in adv mode). I know that the difference is just a bunch of booleans and numbers that you can change in gui/gm-editor, so it should be possible.

---

I know that, ever since world activation, it has been impossible to spawn migrant waves out of the blue. But what if you altered a migrant wave to have more dwarves in it?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 26, 2016, 02:55:53 pm
Fuckin' hell, do you know them? Goddamn, I've wanted to make one of those since 0.42 came out but didn't know what needs to be changed specifically.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on March 26, 2016, 03:35:40 pm
I know that, ever since world activation, it has been impossible to spawn migrant waves out of the blue.

The "force" script definitely worked in 0.40, although I can't remember if I checked in 0.42. The thing is that instead of spawning waves, it tells DF to spawn a wave immediately, which doesn't always produce a wave (especially if you've just spawned a few in rapid succession).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on March 26, 2016, 03:51:23 pm
Yeah, I have video evidence of force working in 0.40. https://youtu.be/NP3axSEckkE?t=2279
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: indyofcomo on March 31, 2016, 01:46:27 pm
Is a 'prospect'-like report possible from the choosing embark screen?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: NW_Kohaku on March 31, 2016, 02:29:43 pm
I didn't see this on the list of things in DFHack already, so hopefully I'm not just repeating something.

Currently, buckets are bugged.  I know "empty buckets" (of water) is part of workflow, but there is also a bug where dwarves put buckets of lye inside barrels, then lose the capacity to recognize the bucket and lye forever. 

Could there be a plugin that searches for buckets inside barrels, and then corrects behavior by moving bucket contents into the barrel, and the now-empty bucket out of the barrel?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on March 31, 2016, 06:54:52 pm
Is a 'prospect'-like report possible from the choosing embark screen?

Yes, prospect.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: indyofcomo on April 01, 2016, 07:40:51 am
Is a 'prospect'-like report possible from the choosing embark screen?
Yes, prospect.

Oh really? I thought it only worked in the 'in-game' screen. Cool!
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on April 01, 2016, 12:15:21 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on April 01, 2016, 04:20:20 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on April 01, 2016, 05:11:31 pm
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.

Hmm, maybe I will have to look at generation then, although it's not something I could do for a couple months so if anyone else has an itching desire to be my guest.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: NW_Kohaku on April 07, 2016, 10:37:00 am
In a pair of threads (http://www.bay12forums.com/smf/index.php?topic=156871.msg6915837#msg6915837), some fo us were talking about graphics for procedural creatures (http://www.bay12forums.com/smf/index.php?topic=157439.0).

It dawned upon me while talking about it that there is probably the capacity within DF Hack as the game currently stands to make procedural creatures have distinct graphics.  I'm thinking I could draw, say, blobs, quadrupeds, spiders, etc. with different colors to represent different material types, and some fire or dust or something along the edges to represent special attacks, and come up with enough permutations to make most procedural creatures look meaningfully different.

That said, I've never coded DF Hack before, so is anyone willing to help with the actual code part of ferreting out the relevant tokens and setting up a script for graphics file text replacement so that individual procedural creatures are associated with a graphic that represents them?

(Incidentally, this is mostly a sort of proof-of-concept for what may come with full procedural playable races... I suspect there would be demand for making current tilesets work with graphics actually representative of the creatures you play.)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on April 07, 2016, 09:37:15 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: NW_Kohaku on April 07, 2016, 09:56:50 pm
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.

When I say "graphics raws" I mean the text file that says
Code: [Select]
[CREATURE_GRAPHICS:FORGOTTEN_BEAST_0]
[DEFAULT:PHOEBUS_P:0:0:ADD_COLOR:DEFAULT]

You could accomplish it with simple text replacement when the game is closed, although thinking about it now, that would take some sort of intermediate step of outputting the required changes somewhere that could then be used to replace the raws after the game was closed if you were using DF Hack with the game open. 

I suppose if you wanted to do it from within DF Hack/while the game was open, you could have a system of saving the game -> running the search for association of creature templates to specific graphic -> alter the text file raws in the save -> force-close the game without saving.  When players reloaded, the graphics should then be adjusted.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on April 07, 2016, 10:00:17 pm
It might be possible to alter the relevant data in-game as well, to avoid needing to reload the save. I don't know for sure if the graphics engine can handle that, though (it probably can't load new textures on the fly, but it might be possible to use already-loaded ones without reloading).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on April 07, 2016, 10:05:15 pm
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.

If that is approximately how the game works (I might be misremembering how fonts work), the most straightforward thing to do is to manipulate the texture directly.  TITAN_22 always points to the same spot, but DFHack stuffs the right pile of subsprites there to make it match the description.  The same change can be made to the creature graphics in the save so that the image is persistent.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: NW_Kohaku on April 07, 2016, 10:28:25 pm
So is there someone who wants to actually try it?

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?)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on April 07, 2016, 11:14:54 pm
So is there someone who wants to actually try it?

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 :)

Stonesense does have sprites for Forgotten Beasts, Titans and Demons... but all Forgotten Beasts get the exact same sprite, etc.

Your layering system would work within Stonesense (and maybe Armok Vision someday), but you'd have to blit everything into a single tile for use in the game's own GUI.

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: NW_Kohaku on April 07, 2016, 11:42:15 pm
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...)

I should be able to do two sets, with two different resolutions, so that people using different tile sizes can probably rescale with only a few touchups.

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.

Well, I'm just going through it to make a list of body parts that would need representation.  I.E. There are raws for creatures with humanoid limbs, quadrupeds, quadrupeds that have hands on their front limbs, and everything up to decapeds with grasping hands on their front limbs. Plus shells, wings, proboscis, horns, exposed ribs, etc. 

Everything beyond that should be coverable through simple palette swaps plus having a "special attack" indicator. 
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on April 07, 2016, 11:48:55 pm
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...)
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  :'(

I think you're on the right track with modular subsprites.  My suggestion was just about from where to pull the assembly information at runtime.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Xune on April 10, 2016, 10:20:22 am
In the adventure mode (Q)uest screen there is a section for (p)eople. It would be great if the information on these people were more detailed, for example their gender, age and physical description. Other good info would be where you last saw them.

Not sure if this exists already or is even doable.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on April 13, 2016, 02:54:53 am
If worst comes to worst you could always just have a hook that redraws the tiles containing the given creatures every frame. It wouldn't work very well though.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: NW_Kohaku on April 22, 2016, 10:35:55 am
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.)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on April 22, 2016, 09:02:14 pm
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.
Quote
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.

I added the first one to the Github issue tracker (https://github.com/DFHack/dfhack/issues/new) just now. It's generally easier for us to keep track of things there than here.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dozebôm Lolumzalěs on April 24, 2016, 03:38:56 pm
Hmm. How about a thing that is like revflood, except it does not flood through constructed walls? Maybe a command for revflood?

revflood -c

or such
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: expwnent on April 24, 2016, 04:30:12 pm
I don't remember what they are but I remember there are good reasons it doesn't work that way. Maybe it messes up re-exploration.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: klassekatze on April 28, 2016, 03:17:32 am
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.)

I have something you might have a use for. Still a bit of a mess internally, but it currently marks for slaughter the smallest animals first - genetically smaller, that is. The value it uses is related to the ones that declare creatures gigantic and so on. It does not currently evaluate muscle or other useful things, but I imagine it would be easier to tweak this script than to write one from whole cloth.

Code: [Select]
--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


Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Hamelin on June 10, 2016, 01:40:17 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on June 10, 2016, 02:04:11 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on June 10, 2016, 02:13:08 pm
Yep, since 0.40.24 (January 2015). There was also a DFHack plugin (embark-tools) that did that since July 2014.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on June 25, 2016, 06:21:46 am
Is there a script to fix missing floors? Tree cave-ins destroy floor tiles without touching the walls below them. They can be fixed with obsidian floors (using liquids command); however it's difficult to find all the affected areas. It should probably leave constructed fortifications alone, and ideally it would repair the floors with the appropriate layer material.

Maybe have a floating cobweb fix, too. Yet again a tree collapse issue. At least there's deramp for the floating ramps.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on June 26, 2016, 02:52:51 pm
Shilling myself a little bit here with this thread.

Topic: Advanced building reaction idea - Assistance required please (http://www.bay12forums.com/smf/index.php?topic=158205.0)

There is a particular idea that came forth from this thread that i'd like to share with you.

A gui/ui bestiary of all creatures, methodically using the DF raws in effect in that world as a bibliographical corpus to read, meaning it would be modification & procedural creature compatible and therefore not hard-coded to require maintenance. Would allow greater control over other plugin effects by distinguishing individual features to be shortcutted in other DFhack applications and allow precision in allowing them to target specific traits (such as via exterminate commands, killing all dwarves with a brown beard as per selecting them from the plugin screen and linking them to that command)

For another example, if the dfhack plugin could also read in-game ID to distinguish, it could help users set up scripts like natural selection amongst livestock (as mentioned by NW_Kohaku for breeding only the desirable animals) and shearing creatures automatically when the appearance changes proc and become woolen to force a shearing job.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on June 26, 2016, 03:13:26 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on June 26, 2016, 04:00:21 pm
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.

I couldn't help but beam a huge smile when i re-opened this thread to be greeted with this answer. For more reasons than one.

Getting on topic. Thats interesting information to know for future reference, i evidently wasn't 100% aware of that, and it certainly saves a lot of time if it was required to turn it into a individual unrelated plugin.

Certainly by using arguments within the plugin i am suggesting which could be co-dependent or modeled on df::global::world->raws, couldn't you just assign each (obtuse for most sentient creatures may i add, if it was pet discriminatory it might be able to bypass extreme facial differences etc until it was fine tuned for basic fields) true/false arguements via what features the df.global.world.raws plucks out until it narrows it down to a result? A dog for instance has a wide range of colours but only a set amount of groups to which those range of colours can be assigned.

Setting via the plugin UI and pre-determined set of options as set out by the df::global::world->raws to set everything else not selected to 'false' as to say IRIS:TRUE, TURQUOISE:FALSE, BROWN:FALSE etc etc. in order to engineer what you want in the script.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bogus on July 01, 2016, 03:03:07 am
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.

other than that, that gui were to allow sorting by each and every property a unit can have, it could be useful, but its a lot of flags and things to check.

also, in the examples you mentioned (dwarves with brown beards and shearing stock with long enough hair), you dont find these things in the raws but in the vector for active units.

you can use the gm-editor gui in game to explore df memory and look through this data manually, that way you can easily check out the structure of these entries and where things are saved.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on July 01, 2016, 03:22:36 am
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.

What if you wanted to build

Spoiler (click to show/hide)

EDIT - But more realistically, you could use appearance based scripts against (or for) vampires.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on July 10, 2016, 07:27:00 am
A unnessecary bump but a kickstart to the thread again after i seem to have capsized it.

I want to set the record straight with a actual constructive suggestion (rather than a collection of well intentioned shitposts) though im still quite fond of the appearance driven barber idea (adventure mode workshop magic haircuts for sprouting beards?/ dyeing your beard pink?)

What i am suggesting is a extension to the plant plugin to control the age of trees. Through testing with dfhack and arena mode (im running the 42.06r1 version) i came across that it only forces the trees to grow to the exact point of maturity by forcing the processes. The actual age of the tree is exactly 1 year (or to say day) old leading to complaints that the command can't generate multilevel trees. This new plugin redesign/rethink would also have some greater controls UI wise via use of co-ordinates to place down trees within a specified space rather than rely on the cursor, meaning they could be run autonomously.

One particular idea i have in general is to force a type of tree to spawn inside/outside to a fixed x/y/z so that we dont have to rely on mouse/all grow UI as currently in the plugin  (alternatively on a non collision 1 or 2x2 tile big 'tree-planter' workshop that obscures the trunk from cutting but allows general orchard picking when in season or leave the sapling to grow naturally and force it to grow with progressional uses of bonemeal*) fixture, feed the workshop a proxy reaction  with seeds/reagent to force sapling/saplings to spawn, but to also respect trees that are also on the same x/y/z grid adjacent to the workshop active zone.

So in quite literal terms

Reaction=
(Plant 'insert sapling name here' NW)

The base plugin already has the dirt restrictive preference, so attempting to plant the tree sapling on a rough surface like stone anyway wouldn't work without a varying script composure

*Bonemeal is a powder material collected from grinding bones in a quern to be allocated inside the 'bonemeal' page of the stockpiles stored in bags, its just a end to a means of providing a meaningful reagent to prompt running the sub-command to grow progressional growth, more age via a flat age progression 1/10/25  just demands more powder to be consumed for the reaction at once. Unless there were flexible variables.

*that 100 number variable in the plant create would be the spawned in tree's age upon creation effectively skipping 'plant grow' as to directly grow trees with meaningful lifespans

Post-post creation edit - I have found a Vjek's rejuvenation script


That's all very well and nice but the reason i pulled this out was because of this bit of code.

Code: [Select]
current_year=df.global.cur_year
newbirthyear=current_year - 20

This sets a dwarf's age to a flat 20 diminishingly (as in it does not act additive to children to force them to grow up), if the same rhetoric can be applied to trees then we can flat out control what age they grow too. Observe this noobish mockup i created as proof of concept.

Code: [Select]
current_year=df.global.cur_year
(grow++ date)=current_year + 20

Reaction=
(Feed NW tree one bag of bonemeal/compost)

I don't know enough about the background coding to effectively make any substantial plugin code myself but throwing it out to the community is the best thing i can do right now. It would be especially helpful to speak to the creator of the plant plugin, and i invite them to talk with me privately about this over PM's if they wish.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bogus on July 11, 2016, 04:28:28 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on July 12, 2016, 04:29:26 am
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.

Thanks. This depository was invaluable in providing a firm reference, concise as always bogus. GM editor too, only affects units but its very interesting to look into the peripheral guts of a unit.

In my initial twiddling i've just repurposed the growage to be directly relevant to the supposed current year in a additive number (because the sapling age in the original was done by - 1 it seems, i can swap that out if thats a non-compliant use of the + value in that context to something else), i've been taking a few tutorials over youtube as to C++ so i get a grip of what im looking at besides trial and error.

I would like to ask somebody to test it out, as i completed the changes on Notepad++ (notepad with the capacity to write in CC and display in notepad, read from notepad and also show in C++ for instance) and can't seemingly find a supported file type to run it into dfhack directly to test. Slot it around the 216 mark i guess for a additional sub command to appear on the original plugin, if it does work, it should work as before with cursor co-ordinates.

Code: ( custom grow code) [Select]
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;
}

I wonder who created the plant plugin. I never found that out and its been rather ambigious, im happy to take my plugin to another thread for more intensive work & discussion about fixing it up if people dont want me cluttering up here.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bogus on July 12, 2016, 02:40:19 pm
Quote
GM 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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on July 12, 2016, 03:33:33 pm
Quote
GM 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.

Ah. i was thinking about the gui/gm-editor, this explains a bit.

Well for one i dont even know if it definitively works so there's that, id rather pr a working build (though i've seen people shop shoddier things in other github places).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 12, 2016, 03:56:12 pm
Bogus is also talking about gui/gm-editor. gui/gm-editor can access everything Lua can access, which is nearly everything.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on July 12, 2016, 04:10:11 pm
Bogus is also talking about gui/gm-editor. gui/gm-editor can access everything Lua can access, which is nearly everything.

Interesting. I couldn't get it to process targets outside of unit view mode before using the dfhack console, ill have to look into it.

Im beginning to have doubts about my application of the plus twenty the biggest change to my incase it isn't applicable due to syntax or some other silly reason born out of my literally entry level C++ understanding. (Theres still the fact it might interpret unexpectedly towards current year in general so finding another application to facilitate testing is on the checklist of things i need to do)

Code: [Select]
tree->grow_counter = df.global.cur_year
tree->grow_counter = current_year + 20

If my understanding is correct it should add (+20 years) on, rather than stay at the baseline (-20) however as a contingency plan, applying minus variables as UI input as i detailed before could well be easier for a flat one way transition to that age (because even so, plants aging in reverse doesn't make much sense game wise outside "its magic, i aint gotta explain it" but for just a plugin utility thing its neat to have for control, say if you wanted to revert the eventual death of a plant with revitalizing ingredients.)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on July 12, 2016, 11:18:29 pm
Would it be possible to make it so that worn clothing is counted as refuse?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on July 14, 2016, 01:50:27 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on July 14, 2016, 05:11:23 pm
Throwing out a suggestion just because it crossed my mind earlier today.

What about mixing the code (i've heard it mentioned around) for Putnam's forced pregnancy, with a modified non-specific version of vjek's age rejuvenation in a plugin additionally with some custom code to force a unnatural 'child' state (even if not explictly in the raws) in a creature so that tame parents (however unnatural means that came to be) can give birth to a domesticated animal with good consistent training and player input. (GCS for instance or cave dragons)

It'd be the full taming bundle; it might even revive the dungeon keeper role within some DFhack capacity.

For instance you could tame a breed of forgotten beast (by applying a training level on it forcefully) in this fashion and then domesticate the child naturally without perversely having to go into gm-edit yourself to mess with those settings. Might help modders on projects with end level goals for bringing powerful unnatural beasts on board without being explicit about it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on July 14, 2016, 06:07:23 pm
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on July 14, 2016, 06:26:45 pm
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?
Mostly helptext, so that it can be formatted once and used in GitHub, script comments, and on-screen help.

Something along the lines of

Code: [Select]
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PeridexisErrant on July 14, 2016, 09:27:23 pm
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?
Mostly helptext, so that it can be formatted once and used in GitHub, script comments, and on-screen help.

Context:  documentation for scripts is now contained in the script files, between tokens that (in lua) denote a multiline comment or string (comment only in Ruby).  This text is marked up in "restructured text" format, which is similar to markdown but better for large documents, and used to generate the html docs.  It is also used as in-console help for some scripts - unifying the interactive help, documentation, and comments for maintainers.  An upgrade to the dfhack core command "help" is planned which will make the docs for all scripts available without adding -help flags on a per-script basis.

Dirst - I think what you want is for help text in the console to have some actual formatting, rather than just dumping all the markup characters.  This is a logical extension of the open issue, and actually pretty easy to do.  (though IMO it's plenty readable anyway...)

There are, I think, only a few main constructs to handle. 
- **bold**, *italics*, and ``monospace`` can be handled by colors, and nesting is not supported. 
- The title is always the first word, on it's own line, and underlined with its length in ===== on the next line -- another color would do. 
- 'Definition lists' have the term (command) first between colons, then spaces to align and the explanation (possibly multiline) -- just color term and remove the colons. 
- "::" indicates that the following (indented) block is monospaced; it should be replaced with ":" if on the end of a line or removed if nothing precedes it.
- leading and trailing empty lines should be stripped.
- `cross-references` are surrounded by single backticks -- another color.

It's not trivial, but nor would that be too difficult to implement in Lua... I'll open an issue with this summary to start tracking it.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on July 15, 2016, 08:32:59 am
Also we could have a function that constructs a viewscreen from the helpstring. Then we could show (maybe interactive?) help screen.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on July 15, 2016, 10:21:34 am
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on July 15, 2016, 11:44:03 am
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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on July 15, 2016, 04:20:14 pm
Also it's my quest to have everything df related in df :D
(like lua powered browser for wiki ;D)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on July 15, 2016, 06:14:11 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mifki on July 15, 2016, 06:29:33 pm
(like lua powered browser for wiki ;D)

Oh, that's my dream.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on July 15, 2016, 07:17:12 pm
(like lua powered browser for wiki ;D)
Oh, that's my dream.
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.)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on July 31, 2016, 12:31:57 pm
According to the df-structures it is possible to target fathers and mothers genes individually via a argument over egg fertilisation. (taking this out of context to force familiarial/inter-racial ties with similar attributes would be interesting)

You could have a setup in which you target egg laying parent A parent B (regardless of actual relation to each other) from the fortress population for their genes via cursor then implement into a selected individual or batch of eggs by forcing the 'fertilisation' and incubation time. For animals it doesn't matter due to no family trees so you could just find any animal of the eggs classification and essentially cheat-spore it as long as that animal is on the map.

It might be information you already know but three months time is equatable to 100800 ticks which is 2 months game time (even though the structure files reads it up as three, correct that discrepancy or my mistake please) 1200 is a day (1000 minutes on the worst possible lag and probably only a flat 100 or more on the best or good FPS, as time is disputably distortable)

Therefore with you can schedule the dfhack eggs or all eggs in general to be done early in more or less than a singular day similar to graze co-efficient in just speeding it up. Just negate - 10800 from the initial value of 0 for instantaneous results or something more conservative to have it done quickly. Elk birds can have their own script so they breed fast and spend less time starving on nest boxes without having buff all grazer co-efficient.

Other creatures seemingly can be contributed to egg results by changing the item references. A way to capture a creatures ID or reference and put it into a egg for a 're-birth' intelligent or not as a tame creature is a possibility

Here is the structure script
Spoiler (click to show/hide)

My own plant grow contribution i detailed some posts back is on hold until i get more information about the systems im learning about, time (which is more straightforward now as GROWDUR raws directly correlate to ticks i understand) and distance/co-ordinates (still working on learning about that, especially in relevance to workshops and fixed positions rather than globally) is helpful rather than a generic ++ to instantly grow.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Heretic on October 24, 2016, 06:36:15 am
Multi Tileset load.
Just in cause of 64x bit version, where we can access to much more memory...
It will be very useful for streams of DF, different players love/better understand different tilesets, so if we can make in-game dfhack command to change tileset it would be really great!
I'm understand, that try to update running game will be really dangerous, slow and useless. But - the tilesets loaded in memory such as collection of images linked to in-game symbols, yes? That if we will make two sets of images loaded and relink them by the command?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on October 24, 2016, 07:29:49 am
[EDIT] Thought of one, thanks for the patience

Could you create a binary patch/plugin that properly divides int32_t (https://github.com/DFHack/df-structures/search?utf8=%E2%9C%93&q=%27int32_t%27) in the DF structures codebase (or wherever is relevant) (https://github.com/DFHack/df-structures) away from emotions and/or non sapient beings? (or at least apply some syntax)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on October 27, 2016, 01:42:35 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: mcbucko on October 27, 2016, 03:03:31 pm
Would it be possible to have an interaction run a script that checks the calender date and applies different effects based on what time of the year it is? ie, spring summer fall winter, dry season wet season
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on October 27, 2016, 03:27:32 pm
Yeah, there's a cur_season global that should be useful for that. If not, there's also cur_year_tick, which runs from 403200. There's also World::ReadCurrentMonth(), or dfhack.world.ReadCurrentMonth() in lua, which is probably best, although it requires cur_year_tick to be available, which it isn't currently on 64-bit Linux 0.43.05.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on October 27, 2016, 03:40:50 pm
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.

I apologise if im not the um, perhaps most concise person. I'll wind myself down a bit, i do get a little bit tangled when i have a lot of information to relay at once, i get caught up brainstorming and researching for a hour or two readability goes out the window. I have a bug report going on here http://www.bay12games.com/dwarves/mantisbt/view.php?id=10057 which is equally muddled from flexibly interpretive point of view going over overlapping problems of creatures not properly executing deaths before turning into buggy corpse items, and because of the problems within this thread discussion contribute to the combined issue (This thread issue < That bug report issue, but the two play off each other, to expand the bug report's effects and make it harder to patch and approach)

Spoiler (click to show/hide)

Ok stripping it all back here's my basic arguement

Its my belief that the emotion system defined within int32_t (from the syntaxed used on creature_raw and also being a undefined place to put unassigned integers) more specifically is affecting local fortress populations by interacting with enums like (<enum-type type-name='animal_training_level' base-type='int32_t'>) to first enable creatures to feel emotions and give them a 'mind' screen leading to desires like prayer, which is exhibited behaviour by allowing those types of creatures to feel emotions, leading to distraction and adopting behaviours of intelligent animals in a integer overlap (so you have your cause, but alone it cannot create harm it needs a catalyst). And creatures unless they are hardcoded in as huntable animals (boars, etc) cannot ethically eat a creature with a sentient mind (semi sentients fall particularly into this category as trolls and BCO's are not responding as they should with [large predator] but also expressing normally unfufillable desires, a troll might have god but you would never know when it goes to pray in a friendly goblin fortress.)

Secondly the enums

Code: [Select]
        <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'/>

Serve as a catalyst to carry this emotional behavior to all the animals and units in a site locally, be they wild or civilized, this works for sentient life well but at the same time it affects all the wildlife. Emergent emotional/sentient behaviours like 'fistfight' unarmed come out when animals fight with claws and paws, and the actual ethics of the settling civ, affects the attitudes of all the wildlife (in my example i state that my ultra aggressive goblin civilization, because it has Kill neutral acceptable, animals on the cavern layer slaughter to death neutral sentients, while on a dwarven embark they only non-lethally brawl and part ways)

> There are more implications but that's the core root from my observation and personal research into it. I may be foolishly mistaking it out of a well meaning misunderstanding but im pretty sure the two are connected.  int16_t is my alternative suggestion for a integer to put emotions into instead (or somehow seperate the cause and the catalyst from one another intelligibly with a new integer or method with the zach brother's input)

A plugin or patch request to abstract that code and experiment with its effects would see if it could remedy a number of bugs (The butchery bug in my bug report request as to creatures not actually dying is relevant but if this bug was removed i think it would fix problems surrounding ethics in eating 'thinking creatures' and make pets/certain creatures butcherable again as well as patch behavioural issues) and eventually pathe a route to a absolute fix or temporary relief (if it works)

Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on October 27, 2016, 05:18:09 pm
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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on October 27, 2016, 07:41:38 pm
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).

https://github.com/DFHack/df-structures/blob/0e8313dc86617796b7145a306df274a882474175/df.unit-thoughts.xml.

I thought (no pun intended) that i might have forgotten to add this. Thoughts are emotions pretty much. To my observable knowledge it is impossible to have a 'high emotion' without a relevant 'high' thought taking place or being staged internally (pre 42.01 animals had none of these features bar perhaps fear for benign creatures in avoiding combat, now they express desires to pray and weep, get anxious and and distracted)

> I've expressed before im not the MOST technical person around on the matter but im pretty certain in most uncertainty that this is what i am describing when i express a emotional system in ('int_32t'). Some more elaboration on what precisely im misunderstanding would be great as im reading though and learning a little bit from that guide you linked including tidbits on scoping rules which are interesting adding on what i gleamed from the syntax . I've definitely cruised github before and got familiar with looking at C++ code (and only a little bit proficient at writing it, but DF code is in language to what i've seen and usually familiar with)

> creature_raw is defined as int_32t's core function on the syntax, and the enum type is used simultaneously between the animal functions too (as far as i see there is nothing to differentiate them into a group) so it seems to be a unintended effect in trying to apply the emotion system via enum fields without actually distinguishing intelligents as the recipient and throwing it on all life with unintented consequences that we see now.

Spoiler (click to show/hide)

Again i quote from the same field...

Code: [Select]
        <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 know witness death thoughts happen, because you can spill any aggressive creatures brains out and over time their morale will break and they will eventually become fearful of the race/entity or perpetrators who have commited the crime. And locally nearly all creatures who go off and back on the map again will express the same fear (which is a methodically replicatable experiment with chains & troggs, in selectively killing troggs in sight on chains until they are terrified and let them loose to contaminate the collective behavior of the rest of the troggs)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on October 27, 2016, 08:10:00 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on October 27, 2016, 08:36:23 pm
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.

Perfectly reasonable i guess, i never precisely found the 'core' of the thought system though i definitely rooted around for it. Perhaps it's squirreled away somewhere i haven't thought to look, but this emotional system is the largest common link towards the behaviors. In my own mind it must be running through some kind of process in order to execute the behaviour we're seeing and the mind facilitiates that (given that when you die, from being turned into a corpse and not a unit your thoughts stop even though you experience body health trauma) even though its non-interfacable, applications like dwarf therapist shows that in lesser beings thoughts still go through on subjects like nakedness.

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.

Immediate problem here is that even on the guide you described to me, all of the problem areas of location features, animal training and emotions are not properly scoped out and are sorted into the base type. [EDIT - Hang on every new name creates a new bitfield in 'int32_t' for reference after looking though primitives, which is interesting but definitely pokes some holes in my arguement unless it is somehow processing it wrong]
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on October 27, 2016, 08:38:47 pm
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). See add-thought (https://github.com/DFHack/scripts/blob/master/add-thought.lua) for a bit more detail.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on October 27, 2016, 08:49:01 pm
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).

I only recently learned in my edit that 'int32_t' creates new fields from names, what i seemed to be misunderstanding was seeing all these same entries of 'int32_t' being put into the same space without anything definitively setting them apart implying that they were all 'in the same basket' interacting with each other in a round about way (going back to the point on scoping that you helped enlighten me about, as its required to differentiate)

Code: [Select]
sub render_enum_core($$) {
    my ($name,$tag) = @_;

    my $base = 0;
    my $count = 0;

my $base_type = get_primitive_base($tag, 'int32_t');

Yes. Thats useful thank you. Im combing through it now, there are a lot of unknowns but some traces of (the bitfield in name=type doesn't appear to be closed off properly and/or a bit precarious interspersed there, seems a bit sensitive calling it 'type' and also structuring it that way but i might well be wrong)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on October 27, 2016, 08:59:48 pm
int_32t is merely a type. Two structures that both happen to be vectors of int_32t numbers will be independent of one another. There's no relationship between them just because they're both a vector of type int_32t. For example:

Code: [Select]
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
}
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on October 28, 2016, 07:23:31 pm
I do respect your input as you know more than myself on the matter. And i know more about where i went wrong from your information to drop that lead of inquiry, I can accept its the wrong place to look. So i followed the grapevine from what i found out elsewhere and pottered around looking at this.


Again always feel free to point out if im wrong, it's troublesome to be sent back to the drawing board but i enjoy the input.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on October 29, 2016, 12:14:05 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on October 29, 2016, 03:15:02 am
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?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on October 29, 2016, 12:04:59 pm
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?

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.

The games memory seems to set out that it was accepted for release because it affected all intelligent creatures (to which the GUI was created for, that was a the intention) globally as intended but instead it affects every animal defined anyway despite how entity populations already exist alternatively. Therefore they would need to be seperated in order to keep the mind system (which keeps one aspect of animals learning skills etc as they are in df.unit.soul) and have animals properly execute behaviours (Intelligent large predators for example and other [large predator] stop being aggressive etc once exposed to these emotional changes.) because flags are phased out in favour of unit emotion or dont work together thanks to overlaps.

The mind system was a one size fits all for all units defined as animals in creature raws across the board against the flags designed to simulate behavior.

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.

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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on October 29, 2016, 12:46:04 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on October 29, 2016, 02:46:57 pm
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.

Spoiler (click to show/hide)

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Quietust on October 29, 2016, 04:56:53 pm
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).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on October 29, 2016, 05:48:21 pm
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.

Describing the nature of the game and loosely interpreting and trying to make sense of it all is a good place to start, my own approach is to find a value and keep referencing where it eventually pools into in order to learn the relations it has. Shake the chain and see what rattles. In all cases even i'd agree my 'solution' is flimsy and non-practical but there's no harm in trying. In hindsight of your constructive criticism i won't be posting any more XML code here but i will keep looking through it privately for connections and read up a bit more about the C++ system, which i was doing anyway.

The GUI (game user interface when player are involved) or UI (menus etc) is what the player interfaces with, i am aware its a feature whether it's background or not, but toady in his initial release of the mind system he'd be working only only tailored it for the intended audiences of intelligent creatures that  benefited from it without making code to discriminate or only affect that class. Nothing was really mentioned about the fact since but bug reports like http://www.bay12games.com/dwarves/mantisbt/view.php?id=7369 started turning up regardless. There is a bug in our midst somewhere or some permeating issue.

I argue that animals & plants are 'map features' because they are referenced in population ID in relation to the biome sites they are represented in are part of features. You cannot generate a jungle map feature or a underground global feature without also having animals/plants relevant, and the population id reads off the features and its co-ordinate to find all the animals/plants within it as part of a background tally of existing units in the feature to the best of my applicative knowledge (feature defined jungle = jungle creatures & plants are put in = gets population numbers from raws and uses that)available for that site if they aren't in it already (plants being always present)

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).

This is very true, and i have kept this in mind, and as i've mentioned before, its a imperfect community effort for DFhack but a generally trustworthy one for looking into. You could also take a pinch of salt in saying that some of the things that i've mentioned (like entity_population/various population references using atleast 3 different names for the same value/little inconsistency in proper identification) could be typos.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on October 29, 2016, 06:13:55 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on October 29, 2016, 07:42:39 pm
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.

Because as how I understand it population id in the world data wouldn't work without it, since it needs to read sites in addition to settled areas, creatures that are non-site native are disallowed from leaving and to properly count everything living in every tile across all regions (without having $populationg.reg have anything to do with it) despite screwily as Quietust points out with innacuracies, population_id is already claimed  by entity_population at df.history.xml#L340 though the actual population id is marked as 'idx' which im unsure if thats applicable to any code rules.

But intelligent non-citizens (semi intelligent and animal observably) do (or alternatively looking at it, they emulate as non fortress faction citizen units), one such way to provoke a emotional response is to restraint chain for a extended period of time.

Certain individual creatures will become depressed and express emotional states, even the wild animals do the same (personality facets to each creature?), though mostly you can trigger anxiety emotions more easily in animals by exposing [BENIGN] tamed units to predatory wild units with historical names (which are then ignored by local site populations in fighting, though that might be related to my ethic setup, which has its own bug report here about wild creatures only respecting site entity ethical morale engagement rules - http://www.bay12games.com/dwarves/mantisbt/view.php?id=10059) because that creature killed a member of your fortress, much like the behavior of villagers being struck down with panic in adventure mode. This is not the same as generic animal running fear (which activates when being attacked), the anxious units will just stare though the grate at the carnivorous named animal and rush out to kill it, despite ignoring all other creatures otherwise.

Ill try to get a save up for the future dedicated to this for vanilla and solid science, but they are all things i have seen happening personally and with some effort are re-creatable and reproducible every single time with enough effort to arrange the conditions because its behind the scenes tomfoolery since the mind system was put in.

Sometimes its just common sense, but if it leads you towards where the original type value is defined and hosted (lets say ref-type creature raw, knowing it exists and then searching the directory for all of those entries will lead you to places, from there onwards until you find all the parts that you need and encounter new terms relevant to your query)

Spoiler: bugs and links (click to show/hide)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on October 30, 2016, 05:56:08 pm
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.
population_id is already claimed  by entity_population at df.history.xml#L340

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on November 02, 2016, 08:09:04 pm
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.
population_id is already claimed  by entity_population at df.history.xml#L340

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.

 :-X

I think i've found enough evidence both through observational study and clumsy XML memory reading to determine that the issues im talking about is code regression. There are bug-tracker discussions about those local feature site population causing personality/ethic bleeding problems here at (10059) (http://www.bay12games.com/dwarves/mantisbt/view.php?id=10059) and DF unit & BP body part issues causing intelligent living corpses because no BP death state and lingering living creature ID's here at (0010057) (http://www.bay12games.com/dwarves/mantisbt/view.php?id=10057)

Turns out after all, you're right about them being citizens rather than based on intelligence but all site animals are simply (wild) site citizens based on the entity who has settled the area, and this resonates to all settlements with kobolds taking up human professions in abandoned towns and hostile invaders (who switch to a hostile marauder class like megabeasts/invaders do, even if they are your deserted factional units) to explain crazy beserk wagons and civilians going feral when stranded on reclaim sites because they are now part of the non-site population. (http://www.bay12games.com/dwarves/mantisbt/view.php?id=9176)


Back to actual suggestion i guess, what about a plugin/script that reveals the genetic links of a egg (because each egg has a parent creature) and can centre on them for working out paternity.

Runs in sync with egg fertility indicator plugin described here (http://www.bay12forums.com/smf/index.php?topic=153400.msg6542303#msg6542303) and possibly future scripts as a way to artificially create units without drawing upon world populations by causing them to spontaneously hatch out of a egg by script editing the parent race. Might have some funky functions as chicken donor's (contributing to fertile eggs and laying) could make tame animals by switching out the fertile eggs and parents code, and splicing new or artificial ones in.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on November 03, 2016, 05:50:25 am
Now that Toady seems willing to provide a dump of global variables (if not the entire memory structure), a DFHack plugin to convert guessed-to-actual names would be very helpful.  Ideally something that could wrap around an old script like an emulator.  Statically analyzing code seems like it would be hardest path (having to parse local variables pointing to global ones).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on November 03, 2016, 08:12:56 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on November 03, 2016, 11:41:25 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Dirst on November 03, 2016, 02:01:24 pm
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.
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).

Hopefully the attributes aren't all .scamps1, .scamps2, .scamps3, etc.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on November 03, 2016, 02:11:31 pm
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.
Renaming even one global in DFHack would be a huge amount of work. Aliases should be possible, but would probably be confusing.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on November 03, 2016, 02:30:02 pm
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.
Renaming even one global in DFHack would be a huge amount of work. Aliases should be possible, but would probably be confusing.
Also we can have multiple names having same type and same address.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Roses on December 08, 2016, 04:37:37 pm
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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on January 25, 2017, 10:52:31 am
I have a plugin request in regards to issue (0009171: Butcher returns of sentient creatures are unusable, regardless of adventurer's ethics (http://www.bay12games.com/dwarves/mantisbt/view.php?id=9171)) and the findings conducted on this thread about sentient butchery.

> Eating Sapients FotF derail (http://www.bay12forums.com/smf/index.php?topic=161408.0) (namely this post reveals the nature of the bug (http://www.bay12forums.com/smf/index.php?topic=161408.msg7337371#msg7337371))

A function to disable 'graveyard' (or (y) corpses stockpile) taking in traffic on command, given that the bug explored here suggests that the issues with sentient beings stem from a relationship of being queued up to visit that stockpile sometimes unnecessarily when there is room for bodies in the refuse piles. If the bodies can be redirected away (by the prompt to go to graveyard never firing) from the graveyard stockpile and into the refuse pile, the materials will be freed up for use with the appropriate ethics until the resulting bug is fixed.

> Graveyard is still important for defining who to bury & who can be memorialised, but it is tedious when you have the option to memorialise every sentient that ever visited your site via this bug because they went to the graveyard. It would also in strongly supported theory free up pets to be butchered (because they are queued up for the graveyard when they die of natural/combat)

> Re-enabling dead_dwarf=true on your civilians you want to memorialise would be a manual hot-fix if this plugin would work.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: ab9rf on January 26, 2017, 11:33:56 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Fleeting Frames on February 12, 2017, 07:11:09 am
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.

Can't use just repeat -time 1 -timeUnits months -command [ combine-plants ], as that will always give an error as you never have stockpile selected while game is unpaused.

So I thought that maybe I could fed combine-plants arguments for this. However, variations on combine-plants 12 1 295 (respective #s for 'max', 'stockpile' and single 'container' in said stockpile ) gives an error on the 12.

What would be proper repeat script to do this? (Ideally bound to a hotkey, but getting even one that has to be copy-pasted for each stockpile to run would be a start.)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: fortunawhisk on February 12, 2017, 03:42:39 pm
I use the following:
Code: [Select]
repeat -name food -timeUnits days -time 1 -command [ "combine-plants -stockpile 21" ]

Quotes and spacing are important. I used bprobe to get the stockpile number, the number that shows up in-game (#7, etc) doesn't appear to work.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Fleeting Frames on February 12, 2017, 05:24:01 pm
Thanks, didn't occur to me that I'd need to identify the variable names either.

I guess the building number is order of buildings placed on embark with oldest/embark wagon first - found it on test myself with :lua print(df.building.find(1)) and gui/gm-editor on the container for it's id.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on March 12, 2017, 02:05:44 am
Would it be possible to make a reaction to repair items while maintaining item quality, decorations, etc.?

I was thinking maybe a hacked improve item job that resets the item's wear while optionally adding a negative value decoration. It would probably require a repair kit item (made of wood and metal), which is created in large stack sizes and used for the decoration.

Not sure how much of it is possible.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: soul4hdwn on March 12, 2017, 09:59:15 pm
is it too annoying to request a setting that disables teledwarves when a siege or strange mood happens in-game?  or slightly less direct, a reminder mentioning.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scourge728 on June 28, 2017, 01:37:45 pm
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))
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on June 28, 2017, 04:56:30 pm
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))

I was inspired by your post (http://www.bay12forums.com/smf/index.php?topic=15096.msg7493665#msg7493665) a few days ago and wrote a script already:

Code: [Select]
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

Let me know if you have any issues with it. Originally it just erased everything in flows, but that caused dragonfire to stop working too (not necessarily a bad thing, I suppose, but not right either).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scourge728 on June 28, 2017, 06:25:59 pm
Okay... turns out I have no idea how to use the script.... I tried shoving it into a .txt, using notepad++ to turn into into lua and then renaming the file into a .lua, only for... it to not work
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on June 28, 2017, 06:35:44 pm
Is it in the hack/scripts folder? Are you sure you changed the extension to exactly ".lua"? ".lua.txt" won't work.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scourge728 on June 28, 2017, 07:52:57 pm
is flows = df.global.flows supposed to be outside of the section where things turn blue
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on June 28, 2017, 08:46:10 pm
I don't know what blue you're referring to. All of the code in my code block should go in one file. I named mine clear-smoke.lua, so I can run clear-smoke in the DFHack console.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scourge728 on June 28, 2017, 11:42:45 pm
(http://i.imgur.com/e7Pr7Od.png)

is this correct?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on June 29, 2017, 07:48:47 am
I think so. Are you sure it doesn't have a .txt extension too? Where are you saving it?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scourge728 on June 29, 2017, 10:35:24 am
(http://i.imgur.com/lri7wqx.png)
(http://i.imgur.com/Lqvb7oE.png)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on June 29, 2017, 10:53:27 am
Okay, and what exactly happens when you run "nosmoke"?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scourge728 on June 29, 2017, 11:31:30 am
the smoke turns invisible, but doesn't actually go away, pressing k still shows smoke and the game still has massive lag problems (I know the lag is related to the smoke because I've reclaimed this fort before, with no lag problem until I got back up to massive populations
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on June 29, 2017, 12:11:56 pm
Okay, when you said it didn't "work", I assumed you meant that it didn't work at all. It really helps if you can specify exactly why it doesn't work so I don't have to make sure it's in the right place (which it is).

Anyway, it looks like flows are also tracked in map blocks, so I'll have to handle that too.

Edit: try this:

Code: [Select]

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

Be warned that it could be slow for large maps.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: scourge728 on June 29, 2017, 02:00:48 pm
Thank you, that seems to work perfectly
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on October 15, 2017, 08:48:58 am
A plugin that freezes grazing states/stops grazing hunger, so that we can maintain animals with 'problematic' grazing habits without in-game workarounds (keeping them exclusively as pets/in cages) or altering the grazing co-efficient so they don't starve.

Either by counting all creatures co-efficients then passively nullifying numbers above a certain level or allowing the player to target animals wished to inflict with the plugin (such as tame elk-birds) ideally.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on November 14, 2018, 06:36:25 pm
A plugin that re-evaluates which tiles are underground vs. above ground.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on November 14, 2018, 08:04:04 pm
What exactly are you thinking of?
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Bumber on November 15, 2018, 08:14:11 am
Basically, a script that redoes this check:
Quote from: http://dwarffortresswiki.org/index.php/DF2014:Tile_attributes
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.

Constructions (Edit: maybe only walls) would block the ray, allowing a return to subterranean darkness in tiles that have been exposed to light. The script could run map-wide, or on a single column.

Ideally, we could have a feature that automatically calls the column check whenever a light above ground space is filled via construction or obsidian cast.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on December 07, 2018, 05:19:06 am
Id like to look into a script that makes dwarves queue up 'talk' for the next-action field in the gui/gmeditor since while they're hanging around with no job they don't seem to activate this at all, mostly thinking about wandering to the next spot, least not frequently in a effort to get them to socialise through keeping the script running.

Initially, testing this made them move over ontop the tile of a friend whom they embarked with and gave them the spoke to thought, though im not sure if this even works outside of a meeting zone.

The player targeting dwarf A and dwarf B locked in a burrow or shared public space to run 'talk' on each other until they develop some social skills and relationship traction would i think would be the useful application though a autocoupling script to make dwarves seek others automatically when needs get too low would be over and beyond.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on December 09, 2018, 03:55:38 am
What, a script that basically just force-inserts a talk action into dwarves who are near other dwarves? Not a bad idea at all, actually. Main problem is there's a lot of crust in the talk part of the action union, as you can probably see (all the unk values, boy!). I'd have to do research into determining what they refer to. It should be possible by just talking in adventure mode, mind.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on December 09, 2018, 05:51:38 am
Talking subjects are not important in fortress mode, unless of course there are special interactions with spilling the beans to visitors about artifacts (in which animals in a resolved bug shouldnt have been doing at all) I just used the general 'invasion' talk subject that was the default and closest value in the list when i went through to inspect it to serve as something to talk about.

Something nice and non-conflictive for lack of arguements unless they disagree that the defenders deserved it. Though i think dwarves would autonomously pick a topic if abstractly prompted without gm/guieditor, but it may not be the case like they say.

Spoiler (click to show/hide)

I think these might impede a possible socialisation script also @Putnam, though the latter observation is correct and a known issue anyway since you can manually cap off a dwarf at maximum value like Talden says for no gameplay difference simply because the zone is very posessive of dwarves who walk into it (http://www.bay12games.com/dwarves/mantisbt/view.php?id=10964).

Purple and green don't really matter overall because its all the same with different scopes of activities to give dwarves too much time into repositioning constantly in the location zone, and not talking between listening to some poetry or doing a little jig.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Blucher on January 03, 2019, 10:07:08 pm
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?

I have a fort from a dead/dying civ and the dwarves aren't getting "busy" enough fast enough.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: bloop_bleep on January 03, 2019, 10:15:24 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on January 03, 2019, 11:47:47 pm
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?

I have a fort from a dead/dying civ and the dwarves aren't getting "busy" enough fast enough.
If you want something similar to catsplosion, looking at catsplosion is your best bet. I don't know how rejuvenate is similar.
Of note: it already accepts races as arguments (e.g. "catsplosion DWARF" would probably do what you expect, but it would apply to non-adult dwarves as well). Filtering just adults shouldn't be too hard to add.

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!).
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 04, 2019, 04:19:02 am
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!).

Also related: building hacks moves everything to lua land so you don't need to track it yourself. It even allows you to change power usage/generation and keeps track of that. I've also looked into the issue of machine connections but it was so long ago that i'm not sure what must be done to fix it. 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)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on January 04, 2019, 06:22:05 am
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.

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: lethosor on January 04, 2019, 10:43:04 am
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.

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.
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on January 04, 2019, 10:57:04 am
Unfortunately not, active meeting zones/locations have no effect other than deterring tavern keepers from serving wine, dwarves will still visit the place anyway to socialise/pray etc. It only stops no-job idlers from walking in there simple because the meeting zone exists and getting stuck in the long-run.

The only pernament solution has to be unassigning the location unfortunately, not that i have to retire the location itself, just turning it off over the 'i' zone for a bit. Take for example that my monster hunter's long-term resident occupation holders don't leave to actually hunt until i do this, then retire for autumn and winter to hang out and socialise all the while waiting for my scheduled spring-summer shutdown.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: bloop_bleep on January 04, 2019, 12:33:04 pm
Re: machine connections.

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on January 04, 2019, 04:43:08 pm
Re: machine connections.

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.
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...
Anyway i'm too "out-of-it" to help. Sorry :). Would love for it to be fixed as it is still annoying me...
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falcn on January 09, 2019, 10:57:30 am
I have a few suggestions for scripts/plugins.

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.
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.
3) plugin that outputs a custom game log with extended information for combat messages to make them on par with in-game reports.
 - who is hitting who (like the red/blue in df combat reports)
 - is it a sparring or combat
 - and maybe a name, since reports have this information, but game log doesn't
The idea is that SoundSense, AnnouncementWindow (http://www.bay12forums.com/smf/index.php?topic=153777.15), DF Log (http://www.bay12forums.com/smf/index.php?topic=172351.0) and maybe some utilities that does not exist yet can make use of this information to fine tune sound, color-code combat log, filter out sparring, keep track of wounds etc.
Utilities must be updated to make use of this new information. DF log is closed source but fairly new, AW and SS are not actively maintained but open source, and most of the work could be done by updating external regex files / adding new sounds. Currently, it could be done with guesstimating what's going on with regexes, but it interferes with non-dwarf citizens, dwarf civ sieges, and any hostile dwarves in general.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falcn on January 09, 2019, 06:17:39 pm
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.
Code: [Select]
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')
https://pastebin.com/c1qJ3B30
It's not working from 'z' and it exits with a wrong view mode, but it still solves the problem of quickly going to a room of unhappy dwarf without typing his name (which sometimes has non-english characters)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: falcn on January 11, 2019, 08:48:30 am
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.
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on January 11, 2019, 11:23:40 am
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.

Messing with any of the game is cheating, but its merely compensating for it not being fully rounded by itself with the contribution of a third party tool/s. Some of them are otherswise actually unobtainable, as are some lifetime wishes like 'see the great natural sites' that can't be fufilled whilst in fortress mode for a individual.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: forsaken1111 on January 23, 2019, 01:06:15 pm
'cheating' is meaningless in a singleplayer game anyway, everyone plays the way they want to play. No one should tell someone else that they are playing incorrectly. Do what you like, have fun with your game.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Putnam on February 03, 2019, 12:25:09 am
Many would say autolabor is cheating to begin with, so I don't think adding another anti-micro feature to it and labormanager is much of a problem.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: seyedaed on February 04, 2019, 01:54:37 am
Hi everyone,

Thanks for all your hard work and dedication on making these mods and apps.  I can't express how awesome it has been using them over the years.

Anyway, I have a thought for a plugin but not sure if it is already possible or makes much sense.  I'm still learning and new to a lot of this.   However, I think it would be great if there was plugin that could allow lua scripts to easily be run in separate threads. 

To my understanding, right now when a lua script runs, it runs on the same thread that the main game runs. The issue though is that if there is a really heavy lua script running it can cause delays in the game FPS.

I understand there are reasons that running things on the same thread are ideal, but I think there are some things that might not be as dependent on the main game thread and some modders could take advantage of this. Some of the scripts I've been playing around with tend to be really heavy and I do notice they can cause an FPS hit. 

I know I do have a lot of work to do on optimizing things though.  I was originally thinking of just offloading some of the work using the socket connectors to other programs or going a C++ route, but then I'm afraid I'll lose a lot of data/functions/convenience that the dfhack lua api provides and have to rewrite a lot of stuff in the other app.

Anyway, thanks again for everything.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: Warmist on February 04, 2019, 05:08:11 am
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: bloop_bleep on February 04, 2019, 06:44:17 pm
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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: seyedaed on February 05, 2019, 12:51:44 am
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.
Thank you so much for the feedback. I do appreciate it.  It definitely helps me understand the issue better.

I want to explain the issue I'm having a little more and maybe you or others might have other ideas on how I can approach this problem.

I've been experimenting with visualizing different parts of the game map while the game is actively running. I know that others have done this using sockets or custom C++ plugins to external apps.  The approach I took, mainly because of my lack of knowledge on dfhack with C++, was to cycle through the lua data and then use a socket to send the data to an external app.  This works ok, but the more I add to the lua script or frequently I run it, the more the FPS take a hit. This is especially an issue if I'm using other mod scripts I wrote.

I had an idea of what some of the issue could be and you helped clarify things better. I do thank you for helping me understand why the memory reads/writes are probably a bigger issue than the processing.  I don't know enough about this, but I had thought that the process to process memory access would cause more lag than the process to thread transfer. Any more advice on this would be appreciated.

However, because of the need to wait for other processes to complete, I originally thought threading could help. Especially in cases when running multiple mod scripts and those that aren't that memory heavy and that could improve the user experience by completing more timely.

To my knowledge I have a couple of options. 

1.  I could just send more of the data to an external app and let it handle more of the processing rather than relying on the dfhack lua. Doing so could allow the code to run by taking advantage of other processing cores.  I understand the lag from memory reads will still be there but some processing can occur during the memory/read write times.  However, doing so would require a lot of rewriting code and functions that already exist in dfhack LUA API.

2.  I could write a C++ plugin that could thread and handle the visualization data.  I might be able to use code from others to handle some of the functions.  However, I feel that I would be relying too much on my own coding ability to try to handle the table data that LUA already is optimized for. 

3.  Optimize my code (any other ideas are appreciated).

I know threads are a real pain to work with and can cause all kinds of craziness.  For me, it was the first way I could think of that could potentially help the issue and I thought maybe a plugin or something could help. 

Thanks again for the feedback though and I don't mean to bother everyone with this .  I know there are probably other workarounds, I'm not considering and I have a lot to learn, but I hope at the very least, it can help me and others that might be experiencing similar things gain additional insight or maybe someone else would come up with other solutions.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: seyedaed on February 05, 2019, 12:52:50 am
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.

Thank you for sharing this.  It definitely helps me make more sense of things.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on June 30, 2021, 07:24:10 am
Pity to see this thread fall into disuse, time to kick it back into life before the turn of the next month.

I have a request:

Baby yarn animals cannot be sheared which ends up in difficult situations where you have to slaughter strays or have dwarves go insane over other people's pets if they're the sole animal type of the specific yarn in the fort, could a script be comprised to force the job or simply set llama wool back to 0, and drop a clump of fur beneath them?

It would be super if the script was malleable to determine force-yarn-drop amounts to distinguish creature types or read the current hair level for a appropriate cue. It probably shouldnt matter whether the animal is owned, dead or alive just as a debug tool (for fun dead-troll fur harvesting on the side).

I have a related issue report regarding it. (http://www.bay12games.com/dwarves/mantisbt/view.php?id=11427)
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: PatrikLundell on June 30, 2021, 08:03:15 am
If I recall correctly, there's a field somewhere in the creatures that determines the length of the hair or something like that. This field, or set of fields, could presumably be hacked to the value for full shearing length, after which normal shearing ought to be possible.

I forbid some of each kind of cloth in my fortresses to ensure I've got some on hand when moods strike (and I do the same with metal bars and leather). In addition to that, I bring sheep on embark exactly to make sure I've got a wool supply (3 males and 3 females almost always result in a reproductive population since the "unwilling to marry" animal bug was squashed), and I similarly bring silk thread on embark to tide me over until I start to harvest silk from the caverns. I also bring some metal bars, for the same reason.

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.
Title: Re: [SUGGESTIONS] for DFhack plugins
Post by: FantasticDorf on June 30, 2021, 08:20:04 am
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).


Politely, i wasn't asking for gameplay advice to subvert suggesting this script. Its the sensible workaround to the bug in that children don't have anything different to adults other than size and behaviour (bearded babies etc) and therefore buildup yarn if they've lived for a while. But the way things are it'd be a nice band aid to when you're caught short on immediate notice like the circumstances of the report.

The wool from the stray child llama (if there is one that isnt a slaughter exempt pet being targeted in which this script is utmost nessecary for shearing adopted child pets) is clumped up in the butcher-shop when the slaughter designation is done, which is a needlessly violent solution. The long hair of a baby llama etc and other yarn animals is visible when you directly read their descriptions.

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.

Doable with dead_dwarf_false scripts like sentientbutcher.lua, but the manner in which im suggesting the script can imply DFhack remotely does the shearing, if i wanted to keep a troll alive then by means of workshop local scripts or direct-cursor clicking, constantly shaving the wild or enemy POW troll when it's due without ever touching it directly.

That's one creative use i can see in the demand for this script suggestion.