Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Legends in Fortress mode  (Read 8618 times)

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Legends in Fortress mode
« on: August 03, 2015, 03:45:43 am »

Did you know it's possible to do

Code: [Select]
w=dfhack.gui.getCurViewscreen() ; w.child=df.viewscreen_legendsst:new() ; dfhack.gui.getCurViewscreen().parent=w

and get a fully functional Legends screen? There was couple question about how to get more info about outer world recently. The only thing you can't use ESC to close the screen, instead, use

Code: [Select]
dfhack.gui.getCurViewscreen().breakdown_level=2

Someone needs to make a convenient script, if there's no already.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: Legends in Fortress mode
« Reply #1 on: August 03, 2015, 06:40:29 am »

Did you know it's possible to do

Code: [Select]
w=dfhack.gui.getCurViewscreen() ; w.child=df.viewscreen_legendsst:new() ; dfhack.gui.getCurViewscreen().parent=w

and get a fully functional Legends screen? There was couple question about how to get more info about outer world recently. The only thing you can't use ESC to close the screen, instead, use

Code: [Select]
dfhack.gui.getCurViewscreen().breakdown_level=2

Someone needs to make a convenient script, if there's no already.

No, WOW, yes - definitely.  I'll open an isssue and crosspost to the DFHack thread  :D

Downside - DF crashed when I tried ESC-ing to close the screen, so that will need to be handled.  Upside - I can even export legends files!  This is great!  I'll also want to change exportlegends.lua a bit to allow exports from fortress mode...
« Last Edit: August 03, 2015, 06:44:53 am by PeridexisErrant »
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Legends in Fortress mode
« Reply #2 on: August 03, 2015, 06:51:02 am »

Well, that's what needs to be done - intercepting ESC and closing the view using breakdown_level=2. I don't know if that can be done in Lua, otherwise just a very small dfhack plugin.

lethosor

  • Bay Watcher
    • View Profile
Re: Legends in Fortress mode
« Reply #3 on: August 06, 2015, 09:09:00 am »

This is equivalent to
Code: [Select]
dfhack.screen.show(df.viewscreen_legendsst:new())
dfhack.screen.dismiss(dfhack.gui.getCurViewscreen())
The only thing you'd really need a separate script for is to intercept LEAVESCREEN appropriately.

Edit: Here is a script that does that. Currently untested in adventure mode. Appears to work in adventure mode as well.
« Last Edit: August 06, 2015, 10:12:52 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.

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: Legends in Fortress mode
« Reply #4 on: August 06, 2015, 05:08:15 pm »

This is equivalent to
Code: [Select]
dfhack.screen.show(df.viewscreen_legendsst:new())
dfhack.screen.dismiss(dfhack.gui.getCurViewscreen())
The only thing you'd really need a separate script for is to intercept LEAVESCREEN appropriately.

Edit: Here is a script that does that. Currently untested in adventure mode. Appears to work in adventure mode as well.

That's it, thanks!

lethosor

  • Bay Watcher
    • View Profile
Re: Legends in Fortress mode
« Reply #5 on: August 06, 2015, 07:43:24 pm »

FWIW, that script breaks the "Ctrl-A@legends" keybinding in dfhack.init-example, but it will be possible to specify multiple contexts at once in the next version, so "Ctrl-A@legends|dfhack/lua/legends" will work.
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.

Geltor

  • Bay Watcher
    • View Profile
Re: Legends in Fortress mode
« Reply #6 on: August 13, 2015, 04:18:03 am »

i followed your use instructions on reddit here: https://www.reddit.com/r/dwarffortress/comments/3g0g6h/dfhack_script_that_opens_the_legends_screen_in/

unfortunately when i run "open-legends" in dfhack while fortress mode is open, i get this:
Spoiler (click to show/hide)

what am i doing wrong?

edit: note that i wrote "enable" after the open-legends, i tried it without that as well and the results are the same
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Legends in Fortress mode
« Reply #7 on: August 13, 2015, 07:41:51 am »

Yeah, there was a compatibility issue with DFHack 0.40.24-r3 which I just fixed in the repo. Try downloading it again.
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.

Geltor

  • Bay Watcher
    • View Profile
Re: Legends in Fortress mode
« Reply #8 on: August 13, 2015, 08:11:47 am »

Yeah, there was a compatibility issue with DFHack 0.40.24-r3 which I just fixed in the repo. Try downloading it again.
that did it. thank you.

is there any way to get "exportlegends all" to work with this? says it has to be in the main legends menu.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: Legends in Fortress mode
« Reply #9 on: August 13, 2015, 10:35:36 am »

Yeah, there was a compatibility issue with DFHack 0.40.24-r3 which I just fixed in the repo. Try downloading it again.
that did it. thank you.

is there any way to get "exportlegends all" to work with this? says it has to be in the main legends menu.
It'll require a change to the exportlegends script. open-legends creates an invisible screen above the legends screen (which catches 'esc' and stops DF from crashing), which is what exportlegends sees.
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.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Legends in Fortress mode
« Reply #10 on: August 21, 2015, 01:44:20 pm »

Hey guys, I made a little something using this script: http://www.bay12forums.com/smf/index.php?topic=152707.0

Your dwarves can build an archive in your fort and look up legends mode themselves now. :)

Edit: Damn it, I'm really slipping... this was posted on the 3rd, script finished on the 6th... and I only see this now. O.o
« Last Edit: August 21, 2015, 01:46:54 pm by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: Legends in Fortress mode
« Reply #11 on: August 22, 2015, 02:19:21 am »

Did I mention how amazing this is? I thought pulling up the names screen was awesome, but having access to current legends in game? Fuck me dude.
Logged