661
Utilities and 3rd Party Applications / Re: Help with a script - DigRoom.lua
« on: July 25, 2015, 05:56:20 am »
I think it's a typo, it should be "designation".
April 23, 2024: Dwarf Fortress 50.13 has been released.
News: February 3, 2024: The February '24 Report is up.
News: February 4, 2021: Dwarf Fortress Talk #28 has been posted.
News: November 21, 2018: A new Threetoe story has been posted.
Forum Guidelines
a = df.new(df.viewscreen_setupadventurest) ; a.subscreen = 3 ; gui = require 'gui' ; gui.simulateInput(a, 'A_RANDOM_NAME') ; gui.simulateInput(a, 'A_CUST_NAME') ; print(dfhack.TranslateName(dfhack.gui.getCurViewscreen().name))
You'd want to make sure that screen is actually a dwarf mode viewscreen, though. (Is this supposed to work in adventure mode?)What is the extra viewscreen_dwarfmodest for?
That makes it so that it works even if the current viewscreen is something else.
That's not required even in this case. Just use df.global.gview.view.child instead of getCurViewscreen() - it will correctly place the new screen on the top of the stack even if the parent screen wasn't on top.
What is the extra viewscreen_dwarfmodest for?
That makes it so that it works even if the current viewscreen is something else.
^Now I'm wondering if it would be possible to put something like the adventurer travel map above the fort mode minimap with dfhack.
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.
I haven't done much work on it myself but I'm told that nemesis/histfig stuff is the hardest part to get working properly. As for code in the game you can use, there's always transformation + pregnancy, but that only works on races that can reproduce, it requires a unit to start with who isn't otherwise occupied with anything important, it can only be done across 3-4 frames, and if the game exits halfway through it might do horrible things to the save file.
I 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.
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.
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.
The idea is to make it so that it works better, including nemesis entries. It just doesn't work yet.
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.