Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 356 357 [358] 359 360

Author Topic: DFHack 0.43.03-r1  (Read 1122426 times)

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5355 on: May 04, 2017, 12:28:44 pm »

Three questions:

1. Is there an easy way to center the game screen on a given position? I seem to remember there was a function already built in, but I can't seem to find it.

2. Is there a builtin pop up box? What I mean is, I am altering one of my guis to allow changing of classes, but I want there to be a warning, something like "Are you sure you want to change class, Press Enter for Yes, Press Esc for No". I know I can use the same method I use for the gui (i.e. make a widget.Panel and add the options in there) but I was just wondering if there was already a pre-constructed option.

3. Does anyone have a working script that fully constructs a building? I remember making a rough one awhile back (to test the feasibility of multi-story buildings) but I seem to have lost that code. I know it is possible using the dfhack.buildings functions and then altering the construction stage, thought I would check if anyone has something already working before I re-do that work.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5356 on: May 04, 2017, 12:51:29 pm »

Not sure where to ask but is there an 'embark anywhere' utility with dfhack?
"embark-tools anywhere". This is a good place to ask.

Three questions:

1. Is there an easy way to center the game screen on a given position? I seem to remember there was a function already built in, but I can't seem to find it.
There's Gui::revealInDwarfmodeMap() in C++. That doesn't seem to be exported to Lua, and I can't find a good equivalent. There's the Viewport class in the "gui.dwarfmode" module, but it looks like that requires more setup to use (I couldn't figure it out by playing around with it, but there are probably examples - maybe gui/liquids?). Anyway, I should have that available to Lua in r1.

Quote
2. Is there a builtin pop up box? What I mean is, I am altering one of my guis to allow changing of classes, but I want there to be a warning, something like "Are you sure you want to change class, Press Enter for Yes, Press Esc for No". I know I can use the same method I use for the gui (i.e. make a widget.Panel and add the options in there) but I was just wondering if there was already a pre-constructed option.
Take a look at the "gui.dialogs" module (specifically showYesNoPrompt()).

Quote
3. Does anyone have a working script that fully constructs a building? I remember making a rough one awhile back (to test the feasibility of multi-story buildings) but I seem to have lost that code. I know it is possible using the dfhack.buildings functions and then altering the construction stage, thought I would check if anyone has something already working before I re-do that work.
I haven't seen anything like this before, sorry. If you do come up with something that works, or find your original code, it would be nice to share that in case others find it useful.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5357 on: May 04, 2017, 09:20:47 pm »

In case the handful of people who have reported autochop being totally broken didn't see my responses on GitHub (or if anyone else is curious): we've finally identified and fixed the issues with autochop creating and removing tree-cutting jobs, which probably dated back to 0.40.20 (the job priorities release). Issues such as dwarves standing by felled trees trying to cut them down a second time should be resolved now, as well as ones where autochop wouldn't actually stop trees from being cut down when requested.

I'm working on similar fixes for getplants now, but that was about the last major issue we had left to resolve before a stable release. If anyone wants to try out the autochop fixes, they're currently on the develop branch.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

knedl

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5358 on: May 05, 2017, 07:33:00 am »

I need a bit of help here, this is driving me nuts after two hrs of trying to figure it out. The Workflow Status GUI is accessible through selecting a workshop, then Alt-w and then Shift-S. How can I set a key bind like Alt-w or some other so I can get the Workflow Status GUI straight up from game or from z-stock menu? Please help me out and let me know what to do. I am using the 43.03 Peridexis Newb Pack.

And thank you guys for working on DFHack!
Logged

Amostubal

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5359 on: May 05, 2017, 07:54:15 am »

In case the handful of people who have reported autochop being totally broken didn't see my responses on GitHub (or if anyone else is curious): we've finally identified and fixed the issues with autochop creating and removing tree-cutting jobs, which probably dated back to 0.40.20 (the job priorities release). Issues such as dwarves standing by felled trees trying to cut them down a second time should be resolved now, as well as ones where autochop wouldn't actually stop trees from being cut down when requested.

I'm working on similar fixes for getplants now, but that was about the last major issue we had left to resolve before a stable release. If anyone wants to try out the autochop fixes, they're currently on the develop branch.

good job lethosor, maybe in the future edition, I'll use autochop again!

oh and lethosor I did some more testing and made a few more fixes to create-unit.lua that I didn't notice originally, primarily, a couple of errors to the function calls and a fix to get rid of the "dog -123456789" weird naming errors (basically instead of just setting them to having no name, you have to blank the first name also).   I've got to test it versus one more script of Boltgun's (which helped me discover the other errors) this morning, and if everything seems to be in order, I'll upload it to github today. 



I need a bit of help here, this is driving me nuts after two hrs of trying to figure it out. The Workflow Status GUI is accessible through selecting a workshop, then Alt-w and then Shift-S. How can I set a key bind like Alt-w or some other so I can get the Workflow Status GUI straight up from game or from z-stock menu? Please help me out and let me know what to do. I am using the 43.03 Peridexis Newb Pack.

And thank you guys for working on DFHack!

in dfhack.init,

the line should be:
keybinding add Alt-W@overallstatus "gui/workflow status"

it shoukd already be in there, but if not just add it in, then you can pull up the workflow status window by pressing Alt-W at the overall status window (the one you get with 'z', that displays your fort value and food stocks on it, has menus for animals, stone settings, stocks, etc.)
Logged
Legendary Dwarf Fortress
Legendary Discord Group
"...peering into the darkness behind the curtains, evokes visions of pixies being chased by dragons while eating cupcakes made of coral iced with liquid fire while their hearts burn out with unknown plant substances..." - a quote from the diaries of Amostubal

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5360 on: May 05, 2017, 08:00:04 am »

No, there's another binding for alt+w when a workshop is selected. That one just gives a dashboard of sorts from the main fortress mode screen. I'll find the exact keybinding when I'm not on mobile.
Also, it's been missing intentionally by default from every DFHack version for 0.43 so far. I just recently added it back, so it'll be in r1.

Edit: here they are:
Code: [Select]
keybinding add Alt-W@dwarfmode/QueryBuilding/Some/Workshop/Job gui/workflow
keybinding add Alt-W@overallstatus "gui/workflow status"

Add these to your dfhack.init file to have them take effect every time. If you're already running DF and don't want to restart it, run those commands in the console too to have them take effect for your current DF session.
« Last Edit: May 05, 2017, 08:18:41 am by lethosor »
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

knedl

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5361 on: May 05, 2017, 08:48:26 am »

Darn it, still it doesn't open the workflow status menu. If I set it to Alt-X for example then I can use the same keybind for the same thing but only in workshop. In workshop there is a Shift-S that opens the workflow status menu. Something is mixed and it's the "status thing"
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5362 on: May 05, 2017, 08:52:52 am »

I'm not quite sure what you're referring to. Does alt+w in the main fortress mode screen open the status screen you're thinking of? What if  you run "gui/workflow status"?
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

knedl

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5363 on: May 05, 2017, 08:58:41 am »

I'm not quite sure what you're referring to. Does alt+w in the main fortress mode screen open the status screen you're thinking of? What if  you run "gui/workflow status"?

If I run "gui/workflow status" directly from init then it opens. Saved text in init file doesn't work nor if I type it in. So I tried with Alt-x because alt-w was already in use. What I am sure is that we are binding the wrong path.

EDIT: OK got it now lol - keybinding add Alt-E@overallstatus "gui/workflow status" this is all that it needs to be accessed straight from the game. I set it to Alt-e

Thank you both for quick responses and help I am slowly learning the DFHack.

EDIT 2: Just to sum up because it's seems a bit strange how this thing worked out. I read that
keybinding add Alt-W@dwarfmode/QueryBuilding/Some/Workshop/Job gui/workflow
keybinding add Alt-W@overallstatus "gui/workflow status"
have been removed because it was not needed anymore. And adding this two commands to my init file did nothing to bring up the menu. The direct access to Workflow Status screen where you can manage the work orders is done by:
keybinding add Alt-E@ "gui/workflow status"
This will open the Status screen from any menu you are in. I just hope I didn't mess up any other bind with Alt-E. I used it because I was unable to find an key bind to it so I hope it's fine.

Tnx again and hats off to guys working on this awesome tool box for DF.
« Last Edit: May 05, 2017, 09:24:41 am by knedl »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5364 on: May 05, 2017, 09:54:33 am »

EDIT 2: Just to sum up because it's seems a bit strange how this thing worked out. I read that
keybinding add Alt-W@dwarfmode/QueryBuilding/Some/Workshop/Job gui/workflow
keybinding add Alt-W@overallstatus "gui/workflow status"
have been removed because it was not needed anymore.
They were removed because we weren't sure if people would still want those bindings, and we weren't sure if workflow was going to be stable. They have been re-added after DFHack 0.43.05-beta2.

Quote
And adding this two commands to my init file did nothing to bring up the menu. The direct access to Workflow Status screen where you can manage the work orders is done by:
keybinding add Alt-E@ "gui/workflow status"
This will open the Status screen from any menu you are in. I just hope I didn't mess up any other bind with Alt-E. I used it because I was unable to find an key bind to it so I hope it's fine.
Did you restart DF after editing your init file?

I'm a bit confused as to whether you're running these commands in the init file or the console (the window that opens when you run DF). "gui/workflow" will definitely not work in your init file, but it will work in the console.

Oh, also, "@overallstatus" is the "z" screen, not the main fortress mode screen (sorry about that). Does alt+w work there?
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

knedl

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5365 on: May 05, 2017, 11:05:38 am »

Yes I restarted DF after every change of init file. I tried all combinations and nothing worked. I also tried the same commands in all variations through the console first but didn't work either. And yes I figured out that "@overallstatus" is the "z" menu and was trying with alt+w in this menu and main fortress one. (Heck I tried all possible ways with all the combos I could think off lol). Anyway here is my version of what might be wrong. The "keybinding add Alt-W@dwarfmode/QueryBuilding/Some/Workshop/Job gui/workflow" is something else than the workflow status screen. Go to one workshop and set a job. You have two options here to set the job. 1. Alt-A to set input and output stuff for a job/product and 2. option is ALT-W where you set workflow constraints like range/limits on production. At the bottom of the screen there is the shift+S option that opens the workflow status screen=GUI/workflow. Changing the above keybind /querryBuilding/some/wokshop... is changing the keybind for workflow constraints and thats not the status screen. Since the keybind alt-w is already taken, binding gui/workflow in fortress screen or in @overallstatus menu won't work either (because it is in second place and the code accepts only the first one and others are discarded - like if Alt-w is already in use then you can set all keybindings to alt-w but the code will only accept the first keybind set an not the ones after). So I used Alt-e since I think it's not tied to anything. At least I was unable to find it through notepad++

Not sure but I suggest you test if it works in the latest DFHack version (I am using 43.03 Peridax Newb Pack on an old 32bit potato computer) because if you just added those two lines of code back into init file I am sure the gui/workflow=workflow status screen wont open in @overallstatus/z-menu. You should not touch the above mentioned code line. Only add "keybinding add alt+whatever is still free (E works for me) "gui/workflow status" and that's it. If you want it open in z-menu than add the @overallstatus but I didn't try this option since I like the option to see it anytime in any other menu.

Sry for my bad english, not native for me so I hope I explained good enough.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5366 on: May 05, 2017, 12:55:03 pm »

Oh, try this:
Code: [Select]
keybinding add Alt-W@dfhack/lua/status_overlay "gui/workflow status"
You might have a script running that changes the "z" screen (by adding an "x: Additional options" item), which adds an extra screen and keeps "overallstatus" from working.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

knedl

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5367 on: May 05, 2017, 01:18:28 pm »

Ah nice one it works this way now. TNX!
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5368 on: May 05, 2017, 01:57:06 pm »

Cool. That has come up before, but I forgot about that script. I'll add that keybinding for r1 too.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Amostubal

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5369 on: May 06, 2017, 08:59:19 pm »

here is an interesting line from onLoad.init in TESB:

Code: [Select]
modtools/reaction-trigger -reactionName TESB_DECONSTRUCT_TRIBUTE -command [ modtools/anonymous-script "dfhack.buildings.deconstruct(df.building.find(args[1]))" \\BUILDING_ID ]

Really this thing is annoying... spits out an error that reads:

Code: [Select]
(anonymous lua script):1: Cannot write field building.find(): integer expected.
stack traceback:
[C]: in field 'find'
(anonymous lua script):1: in main chunk
[C]: in function 'dfhack.safecall'
...warf Fortress/hack/scripts/modtools/anonymous-script.lua:26: in local 'script_code'
...ied-MWDF\MWDF Project\Dwarf Fortress\hack\lua\dfhack.lua:562: in function 'dfhack.run_script_with_env'
(...tail calls...)
[C]: in field 'runCommand'
...ied-MWDF\MWDF Project\Dwarf Fortress\hack\lua\dfhack.lua:580: in upvalue '_run_command'
...ied-MWDF\MWDF Project\Dwarf Fortress\hack\lua\dfhack.lua:595: in function 'dfhack.run_command'
...warf Fortress/hack/scripts/modtools/reaction-trigger.lua:146: in local 'doAction'
...warf Fortress/hack/scripts/modtools/reaction-trigger.lua:186: in function <...warf Fortress/hack/scripts/modtools/reaction-trigger.lua:115>

decided I'd ask here since, Dirst hasn't been on since December, otherwise I'm just going to have to disable it... this is just the first of a series of errors out of the code, but its the first that I don't understand....Its simple to remove the line from onload and manual deconstruct the buildings...
Logged
Legendary Dwarf Fortress
Legendary Discord Group
"...peering into the darkness behind the curtains, evokes visions of pixies being chased by dragons while eating cupcakes made of coral iced with liquid fire while their hearts burn out with unknown plant substances..." - a quote from the diaries of Amostubal
Pages: 1 ... 356 357 [358] 359 360