Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 221 222 [223] 224 225 ... 360

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

breadman

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3330 on: December 04, 2015, 01:22:11 pm »

I realize that changes take place and that the version he documented in his video is not the same as what exists now.  I went to GitHub to look at the commands like he is talking about but the web page does not look like what is in his video.  The biggest problem I have is that the GitHub page the wiki points to is one of the most non-beginner-userfriendly pieces of documentation I have ever seen.
Yes, the documentation has been undergoing a massive revamp.  It was hoped that the new version would be friendlier, but it seems that it can still be improved.

Quote
In the video, there on the front page at the 3:45 mark is a big "Commands" section.  I cannot find that anywhere (after looking literally for 3 hours).  At the bottom of the page currently it says ..and I quote
"The full documentation is available online here, from the README.html page in the DFHack distribution, or as raw text in the ./docs folder. If you're an end-user, modder, or interested in contributing to DFHack - go read those docs."

I clicked on the link but I do not see any "ReadMe" link or the word "Distribution" in any link either.  I also do not see anything saying /docs in the linked page.  However I do see docs folder on the github page which shows an images and styles folders which again confuses the hell out of me as nothing there has anythnig remotely resembling actual documentation of anything.
Two issues here.  First, the "Commands" section has been rearranged into the new "User Manual" section in the online documentation.  The "DFHack Core", "DFHack Plugins", and "DFHack Scripts" pages each list their set of the commands.  It got a bit too unwieldy as a single page, but the new structure is neither searchable nor intuitive unless you already know the distinction.

Second, the part you quote can be misinterpreted.  It intends to list three different places to find the documentation; however, the second only applies to a released distribution, and even then only to releases that include built documentation.  The third also applies mostly to releases, but since you looked at the /docs folder on GitHub, you must have seen the list of .rst files, which are the "raw text" documentation described in the quote.  If, instead of interpreting the three items as separate, you interpret the second as modifying the first, then yes, you'll have trouble finding README.html after following the link.

Quote
Can someone for the love of GOD point me in the right direction?  Also.. can someone clean up the github page to be more user friendly and more concise and clear as to where the bloody hell to go to learn about stuff?
I've changed the link on the dwarffortresswiki page to go directly to the online documentation.  Any suggestions on how to be clearer in the GitHub Readme?  Would bullet points help?

Part of the issue may be that DFHack isn't meant to be something you just try.  It's a tool for accomplishing something in particular.  What were you hoping for?
Logged
Quote from: Kevin Wayne, in r.g.r.n
Is a "diety" the being pictured by one of those extremely skinny aboriginal statues?

Apostolos

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3331 on: December 04, 2015, 02:28:37 pm »

Ya I actually think just one large page you could do a search on would be a lot easier, but that is purely personal preference as others may like it sectioned off.  I thought I would try and get back into the game a little since its been over a year since I played at all.  I was also a little interested in learning how to manipulate the map some to customize my embark location. Instead of creating 30+ worlds or more and then searching for a specific set of circumstances in a 4x4 area I was hoping dfhack would allow me to build an embark location.  Example: having 4 regions, each being a different type of surrounding so as to increase the number of possible fauna you could encounter and at the same time making sure there was a minimum amount of X and Y resources.  Getting lucky on a world creation for something so specific is hard as hell to get right so thought dfhack could help.  I just got frustrated as hell just trying to find any kind of tutorial or anything noob friendly at all.

Also.. as to .rst files.. I have no idea what those are, would not have known what I was looking at it if it was waving at me.  I just clicked on that folder and said "thats not anything that looks at all what I am looking for" when it opened up and promptly closed it heh
« Last Edit: December 04, 2015, 02:34:54 pm by Apostolos »
Logged

DrunkGamer

  • Bay Watcher
  • Beer loving Gentledwarf
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3332 on: December 04, 2015, 02:30:26 pm »

Any ETA on the dfhack release? It's a pain to build gigantic things without fastdwarf or cleaning out all the blood without clean all
Logged

Geltor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3333 on: December 04, 2015, 04:10:53 pm »

Any ETA on the dfhack release? It's a pain to build gigantic things without fastdwarf or cleaning out all the blood without clean all
first world problems... i cant even manage dwarves without dfhack
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3334 on: December 04, 2015, 04:30:38 pm »

Ya I actually think just one large page you could do a search on would be a lot easier, but that is purely personal preference as others may like it sectioned off.  I thought I would try and get back into the game a little since its been over a year since I played at all.  I was also a little interested in learning how to manipulate the map some to customize my embark location. Instead of creating 30+ worlds or more and then searching for a specific set of circumstances in a 4x4 area I was hoping dfhack would allow me to build an embark location.  Example: having 4 regions, each being a different type of surrounding so as to increase the number of possible fauna you could encounter and at the same time making sure there was a minimum amount of X and Y resources.  Getting lucky on a world creation for something so specific is hard as hell to get right so thought dfhack could help.  I just got frustrated as hell just trying to find any kind of tutorial or anything noob friendly at all.

Also.. as to .rst files.. I have no idea what those are, would not have known what I was looking at it if it was waving at me.  I just clicked on that folder and said "thats not anything that looks at all what I am looking for" when it opened up and promptly closed it heh

There's a search box on https://dfhack.readthedocs.org/en/stable/, although it's admittedly not as useful for browsing. The main reason for the plugin/script distinction is that script documentation is automatically generated, so it would be hard to insert it in appropriate locations in existing files. It's also nice to clearly distinguish between plugins and scripts, although it's possible to do that in the documentation itself (without necessarily separating the two).
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.

dmselena

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3335 on: December 04, 2015, 05:10:29 pm »

Any ETA on the dfhack release? It's a pain to build gigantic things without fastdwarf or cleaning out all the blood without clean all
first world problems... i cant even manage dwarves without dfhack

HEY, the struggle is REAL, man. This game is just way too much !!Fun!! without DFHack.
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3336 on: December 04, 2015, 05:20:57 pm »

+1

That and ALL my mods use DFHack extensively, oh well I need a break anyway...

EDIT: Oh, by the way, what version of Lua does DFHack use? Is it 5.2 or 5.3?
« Last Edit: December 04, 2015, 05:44:26 pm by milo christiansen »
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3337 on: December 04, 2015, 05:51:25 pm »

No integers in DFHack lua, so not 5.3. table.unpack is the function you use to unpack tables, so I'm pretty sure 5.2.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3338 on: December 04, 2015, 05:56:42 pm »

OK, thanks.

I am thinking about writing my own Lua for use in Rubble (because I can't find a good Go Lua VM that isn't old or very buggy) and I got curious which version DFHack used.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Gorobay

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3339 on: December 04, 2015, 08:55:44 pm »

I’m having some trouble with persistent storage in 0.40.24-r5. Here is what I am doing:

  • Load a world in adventurer mode.
  • dfhack.persistent.save{key='frotz/ozmoo',ints={1,2,3}}
  • Create an adventurer.
  • Retire the adventurer.
  • Reload the world in adventurer mode.
  • dfhack.persistent.get_all('frotz', true)
  • It finds nothing, so save the same entry again.
  • Unretire the adventurer.
  • Now get_all finds both, and I have duplicate entries.
« Last Edit: December 04, 2015, 08:57:42 pm by Gorobay »
Logged

Rallor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3340 on: December 05, 2015, 06:33:28 am »

Could someone recommend me a library I could use to display image files in a dfhack plugin?
The images would use transparency and would be layered on top of each other.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3341 on: December 05, 2015, 12:29:00 pm »

Could someone recommend me a library I could use to display image files in a dfhack plugin?
The images would use transparency and would be layered on top of each other.

Code: [Select]
local widgets=require('gui.widgets')

local gui=require('gui')

local Button=defclass(Button,widgets.Widget)

Button.ATTRS={
    on_click = DEFAULT_NIL,
    graphic = DEFAULT_NIL, --refers to the name of a tilepage
    label = DEFAULT_NIL
}

function Button:preUpdateLayout()
    self.frame=self.frame or {}
    if not self.page then self.frame.w=0 self.frame.h=0 return end
    self.frame.w=self.page.page_dim_x
    self.frame.h=self.page.page_dim_y
end

function Button:onRenderBody(dc)
    if not self.page then return end
    for k,v in ipairs(self.page.texpos) do
        dc:seek(k%self.frame.w,math.floor(k/self.frame.w)):tile(32,v)
    end
end

function Button:onInput(keys)
    if keys._MOUSE_L_DOWN and self:getMousePos() and self.on_click then
        self.on_click()
    end
end

function Button:init(args)
    if not self.graphic then return end
    for k,v in ipairs(df.global.texture.page) do
        if v.token==self.graphic then self.page=v return end
    end
    error('No tilepage found: '..self.graphic)
end

this is a GUI widget that displays a full graphics image using Dwarf Fortress's native graphics capabilities, with optional on_click function to be called when image is clicked on

I use it in the SCP mod for various things

you have to actually load the graphics files in-game, which looks like this:

Code: [Select]
[TILE_PAGE:LEGENDS_BOOK]
[FILE:scp/menu/white-book.png]
[TILE_DIM:16:16]
[PAGE_DIM:4:4]
 
[TILE_PAGE:BANKNOTE]
[FILE:scp/menu/banknote.png]
[TILE_DIM:16:16]
[PAGE_DIM:4:4]

[TILE_PAGE:SCP_LOGO]
[FILE:scp/menu/scp-logo.png]
[TILE_DIM:16:16]
[PAGE_DIM:8:8]
   
[TILE_PAGE:SCP_173]
    [FILE:scp/SCPs/scp-173.png]
    [TILE_DIM:16:16]
    [PAGE_DIM:16:13]

[TILE_PAGE:DESCRIPTION_LOGO]
    [FILE:scp/menu/tied-scroll.png]
    [TILE_DIM:16:16]
    [PAGE_DIM:8:8]
   
[TILE_PAGE:OFFER_TO_CONTAIN_LOGO]
    [FILE:scp/menu/exit-door.png]
    [TILE_DIM:16:16]
    [PAGE_DIM:8:8]
   
[TILE_PAGE:SCP_S]
    [FILE:scp/SCPs/nothin to see here, insect.png]
    [TILE_DIM:16:16]
    [PAGE_DIM:16:16]
 
[CREATURE_GRAPHICS:GRAPHICS_CREATURE_SCP]
 [DEFAULT:LEGENDS_BOOK:0:0:ADD_COLOR:DEFAULT]
 [STANDARD:SCP_LOGO:0:0:ADD_COLOR:DEFAULT]
 [MINER:BANKNOTE:0:0:ADD_COLOR:DEFAULT]
 [WOODWORKER:SCP_173:0:0:ADD_COLOR:DEFAULT]
 [BOWYER:DESCRIPTION_LOGO:0:0:ADD_COLOR:DEFAULT]
 [WOODCUTTER:OFFER_TO_CONTAIN_LOGO:0:0:ADD_COLOR:DEFAULT]
 [STONEWORKER:SCP_S:0:0:ADD_COLOR:DEFAULT]

GRAPHICS_CREATURE_SCP is a barebones [DOES_NOT_EXIST] creature; you must load the tilepage on a valid creature in order to have the tilepage load into the game

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3342 on: December 05, 2015, 12:34:42 pm »

That really only supports one image in a given location, though. It would be possible to use SDL_Image to draw to the screen in non-OpenGL print modes, but I'm not sure how it would work with OpenGL.
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.

Rallor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3343 on: December 05, 2015, 02:57:12 pm »

I didn't actually intend for it to display within the game window.
I had something like stonesense in mind, in which it opens a separate window to display its graphics.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.40.24-r5
« Reply #3344 on: December 05, 2015, 03:16:54 pm »

I didn't actually intend for it to display within the game window.
I had something like stonesense in mind, in which it opens a separate window to display its graphics.
Depends on what you want.
Stonesense moved away from this model because it had to use same address space as df. So it's quite limited and might crash for big things (like visualizers). If you want something small it's possible but imho too hacky and not worth the trouble.
Other way is have dfhack talk to your program through a socket. We use protobuf and basically you write stuff you need from dfhack to your program. This way you have way more control and can even program in any language you want.
Pages: 1 ... 221 222 [223] 224 225 ... 360