Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 358 359 [360] 361 362 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1456732 times)

Antsan

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5385 on: April 02, 2014, 07:12:44 am »

Is it really that much of an inconvenience to use a graphical user interface?
Well, it uses resources (DF runs more slowly when the window manager is running), it takes additional (and noticable) time to start up, it changes the behavior of my monitor in undesirable ways when working with the console (it really is annoying when I am working in emacs in the console and suddenly the monitor dims and I need to switch to X just to move the mouse a bit).
Of course I can start up the window manager every time I want to play DF, but I still hoped I didn't have to.
If running a window manager causes DF to run noticeably slower, then either your computer is underpowered or there's something seriously wrong with your window manager and you should consider using a different one. The fact that your monitor also randomly dims lends further credence to the "dodgy window manager" theory.
I am sorry, DF running more slowly in the window manager is bullshit.
The monitor dimming doesn't happen on my desktop PC, but it happens in my laptop. I don't think it's the fault of the window manager, as both use lightdm.

Basically I want dfhack to work with the ncurses interface of Dwarf Fortress.
Logged
Taste my Paci-Fist

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5386 on: April 02, 2014, 12:53:15 pm »

DFHack works by replacing DF's SDL library with its own and I don't think the ncurses DF uses SDL, so...

Doktoro Reichard

  • Bay Watcher
  • Lunatic formerly known as Escaped
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5387 on: April 02, 2014, 02:02:51 pm »

Guys, is there any dfhack or another 3rd part way to revert tile changes and make them intact stone or ground again? For example, if you've dug a room and you don't like it anymore, is there any way to undo those actions and make that area intact and unexplored again?

As people said, you can make due with:

1- the liquids command. It enables you to paint obsidian walls at any given point.

2- the gui/liquids command. Same deal, but with a graphical user interface, that makes it much easier to designate large areas. Note however that you can't designate stuff at 3D - every level you want to fill with obsidian you need to do it one by one.

3- the tiletypes command. The previous commands left the tiles visible. tiletypes can revert that. Also, tiletypes can fill any given area with any "type" of material. However, tiletypes is also a very, very crude hammer. The sequence of commands to fill a tile with stone and revert it to hidden, for instance, are the following:

paint mat stone  - This sets the material to the biome's layer stone type
paint h 1        - This sets the visibility flag to "hidden"
paint sp normal  - This sets the material special flag, so that it appears as unmined (not smoothed) stone
range x y z      - The range, from the lower upper left corner of the cube, that the tiletypes command works


Pressing Enter with the "k" cursor will activate the commands and turn every tile in range to what was specified. You can refine the sequence, if you only want to affect certain tiles (such as floors or fortifications).
Logged
I have to write something... well here goes:
"A dwarf isn't a dwarf unless he dies the most !!FUN!! of ways", Quote unknown, possibly Armok.

Doktoro Reichard is quite pleased with making a Great Carbonite Trap

Why shouldn't you write with a broken pencil? Because it's pointless!

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5388 on: April 02, 2014, 02:29:31 pm »

DFHack works by replacing DF's SDL library with its own and I don't think the ncurses DF uses SDL, so...
That's only on Windows - On Linux and OS X, it hooks in by running DF as a child process (or with some form of exec). As far as I know, it does rely on SDL for keyboard input, so things like keybindings won't work. There may be other things that don't work either, since SDL_Init wouldn't be available in text mode.
Edit: Keybindings don't seem to work, but the search plugin does work. It's difficult to test many other plugins without a console.
« Last Edit: April 02, 2014, 02:39:50 pm 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.

drayath

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5389 on: April 02, 2014, 08:50:42 pm »

I am trying to directly add an improvemnt to an item as part of a larger script (E.g. directly adding poison splatter to an weapon being added to a spawned unit). Having an issue where i can't work out how to set the type of the improvement, am i missing something silly or is this somehting dfhack does not expose (yet). If that is there case are there any sensible work arounds?

Code: [Select]
function AddImprovement(item, improvementDef)

if not CheckChance(improvementDef["chance"])
return
end

local improvement = df.itemimprovement:new()

improvement.mat_type = improvementDef["material"][1] -- TODO: check dont need to do a lookup before assigment
improvement.mat_index = improvementDef["material"][2]   -- TODO: check dont need to do a lookup before assigment
improvement.quality = improvementDef["quality"].Generate()
improvement.skill_rating = improvementDef["skillLevel"].Generate()
improvement.maker = item.maker

        -- THIS METHOD DOES NOT EXIST
-- TODO: There is a getType() method, but no setType() and no type property exposed 
improvement:setType(df.improvement_type.COVERED)

utils.insert_or_update(item.improvements, improvement, 'id')
end

item_improvement type for reference
Spoiler (click to show/hide)
« Last Edit: April 02, 2014, 08:52:16 pm by drayath »
Logged
Drayath's Gem Splitting Workshop - Split large gems and gem trinkets into numbers of small gems.
Drayath's Seed Brewery - Convert bags of spare seeds into useful booze.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5390 on: April 02, 2014, 11:27:41 pm »

There is no setType because it uses virtual inheritance. Thus can't change the object itself with a function (at least easily...). You need to create not a base object but the more specific one, in your case this: "itemimprovement_coveredst". That class has two more fields: cover_flags (for marking glazed items) and shape (not sure about this one...).

One minor nitpick: every time you write foo["bar"] you can replace that with simpler: foo.bar.

cdombroski

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5391 on: April 03, 2014, 07:15:35 am »

Guys, is there any dfhack or another 3rd part way to revert tile changes and make them intact stone or ground again? For example, if you've dug a room and you don't like it anymore, is there any way to undo those actions and make that area intact and unexplored again?

As people said, you can make due with:

1- the liquids command. It enables you to paint obsidian walls at any given point.

2- the gui/liquids command. Same deal, but with a graphical user interface, that makes it much easier to designate large areas. Note however that you can't designate stuff at 3D - every level you want to fill with obsidian you need to do it one by one.

3- the tiletypes command. The previous commands left the tiles visible. tiletypes can revert that. Also, tiletypes can fill any given area with any "type" of material. However, tiletypes is also a very, very crude hammer. The sequence of commands to fill a tile with stone and revert it to hidden, for instance, are the following:

paint mat stone  - This sets the material to the biome's layer stone type
paint h 1        - This sets the visibility flag to "hidden"
paint sp normal  - This sets the material special flag, so that it appears as unmined (not smoothed) stone
range x y z      - The range, from the lower upper left corner of the cube, that the tiletypes command works


Pressing Enter with the "k" cursor will activate the commands and turn every tile in range to what was specified. You can refine the sequence, if you only want to affect certain tiles (such as floors or fortifications).

Pretty certain you also need:

paint sh wall - to actually do the undigging

It goes with the other paint commands.
Logged

Fluoman

  • Bay Watcher
  • Anything the game allows.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5392 on: April 03, 2014, 07:24:03 am »

Well, the auto-melt script is still buggy, I don't know what to do :(
Logged
"hey, look, my left hand! It's only bones now, gosh, has it been that long since that cave dragon bit it off?"

RtDs!

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5393 on: April 03, 2014, 07:39:38 am »

So I have been using dfhack.run_script(name[,args...]), but it expects the arguments to be in the form dfhack.run_script(name,args[0], args[1], args[2], ...). Is there anyway to send just an array of arguments through and have it work? Or is there a lua command that does that?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5394 on: April 03, 2014, 08:13:17 am »

So I have been using dfhack.run_script(name[,args...]), but it expects the arguments to be in the form dfhack.run_script(name,args[0], args[1], args[2], ...). Is there anyway to send just an array of arguments through and have it work? Or is there a lua command that does that?
dfhack.run_script(name, unpack(args)), I believe.
Edit: It looks like DFHack's Lua interpreter doesn't include unpack(), so here's a Lua implementation (from the Lua docs):
Code: [Select]
    function unpack (t, i)
      i = i or 1
      if t[i] ~= nil then
        return t[i], unpack(t, i + 1)
      end
    end
« Last Edit: April 03, 2014, 08:18:26 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.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5395 on: April 03, 2014, 11:39:24 am »

It includes it, but it's under table.unpack.

Doktoro Reichard

  • Bay Watcher
  • Lunatic formerly known as Escaped
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5396 on: April 03, 2014, 12:47:46 pm »

...
...

Pretty certain you also need:

paint sh wall - to actually do the undigging

It goes with the other paint commands.

Yes, that's right. I forgot about it but it is needed. Thanks for correcting.
Logged
I have to write something... well here goes:
"A dwarf isn't a dwarf unless he dies the most !!FUN!! of ways", Quote unknown, possibly Armok.

Doktoro Reichard is quite pleased with making a Great Carbonite Trap

Why shouldn't you write with a broken pencil? Because it's pointless!

xxseuzxx

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5397 on: April 03, 2014, 01:16:32 pm »

why does the dfusion used in dfhack lacks the friendship command?
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5398 on: April 04, 2014, 03:18:29 am »

why does the dfusion used in dfhack lacks the friendship command?
Short answer: because i'm a lazy bum.
Long answer: It's included but due some changes (mostly that it's higher level command, and you need to know what you are doing) it's been moved to a module and you need to have some knowledge of lua to activate it. It also might not work on linux and osx and it might be that i forgot include one file needed for it to work. That being said i'm too lazy to develop it further i.e. make a gui and add support for modification of races that are active while game is running. This is mainly due to fact that friendship (and embark) uses different way to modify df and it's a very error prone, and maintenance intensive way. And for that reasons i'm trying to deprecate both plugins. It's shame that there is no good way to mimic the same functionality in other ways.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5399 on: April 04, 2014, 11:24:05 am »

You forgot it on Windows, too. I had to compile DFHack manually then copy friendship.o to wherever it's needed.

Also I put it on dropbox.

Also, yes, I read friendship's code. From what I understand... it's hacky as hell.
Pages: 1 ... 358 359 [360] 361 362 ... 373