Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 211 212 [213] 214 215 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1458178 times)

Laggy

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3180 on: March 11, 2013, 01:36:43 pm »

So playing around with this a bit as a learning exercise, I made a script to remove all the wear from all the items in your fort.  If anyone is interested:

Spoiler: removewear.lua (click to show/hide)


In an unrelated question, is there like...a list of material IDs somewhere or something?  Like, i just picked a random item, and printall shows that mat_type = 30, and mat_index = 536.  I know that one of those has to refer to Silk, but for the life of me I can't find the struct that has that info in it.  Attempting to cross-reference all this stuff at this point has just been an exercise in futility, basically just printall'ing one table after another hoping I find something.
« Last Edit: March 11, 2013, 01:44:55 pm by Laggy »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3181 on: March 11, 2013, 01:48:38 pm »

Yeah, I kinda need to know about mat_types too--where to find a struct for the ones that aren't 0 (inorganic).

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3182 on: March 11, 2013, 02:18:41 pm »

The first 18 mat types are listed here: https://github.com/angavrilov/df-structures/blob/master/df.materials.xml

These ones are fixed. After that, they're split into plant mats and creature mats, but which are which is raw-dependent.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3183 on: March 11, 2013, 04:20:50 pm »

Related to the earlier issue with lua:

Code: [Select]
local function teleport(unit)
local playerblockoccupancy = dfhack.maps.getTileBlock(player.pos).occupancy
player.pos.x = unitToTeleportTo.pos.x-1
player.pos.y = unitToTeleportTo.pos.y
player.pos.z = unitToTeleportTo.pos.z
for k,v in ipairs(playerblockoccupancy) do
for k,v in ipairs(v) do
v.unit = false
v.unit_grounded = false
end
end
end

This seems a bit stupid, but a bit of testing reveals that it works. Should I expect anything weird out of this?

Laggy

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3184 on: March 11, 2013, 06:53:34 pm »

Here's another little utility mod I made for myself (*****WARNING******* Back up your save before using, just in case.  I tested this for my game, but it could potentially cause problems.  I hope not, but just be safe.) to delete all my excess useless stone.  I had something like 20,000 stone in my fort, and it took up a lot of space (or walking time to dump into a Quantum Stockpile, or time marking a ton of stuff to dump and then using autodump).

Spoiler: destroy_stone.lua (click to show/hide)

Change the destroyThese table entries for the stones you want to destroy.  I'm using Masterwork mod, and I only wanted to keep Obsidian, and metal-bearing ore/stones that were ~steel quality or better.  Adjust per your needs/wants. 
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r2
« Reply #3185 on: March 11, 2013, 08:59:35 pm »

This seems a bit stupid, but a bit of testing reveals that it works. Should I expect anything weird out of this?
Yes - that'll clear the unit occupany bits on all tiles in that map block, not just the one formerly occupied by your player.
Additionally:
1. It isn't bothering to set the proper occupancy bits in the destination tile.
2. It isn't checking occupancy in the destination tile to see if the player needs to be set Prone.
3. It isn't even checking if the destination tile is valid - for all you know, your target could be standing next to a wall, and your player will end up inside the wall. Even better, your target could be standing next to the edge of the map, resulting in you being teleported off of the map.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3186 on: March 11, 2013, 09:15:06 pm »

Well, that last part I knew about :P It's damn difficult to check all that when there is no easy method to check the info for an individual position.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.34.11 r2
« Reply #3187 on: March 11, 2013, 09:35:00 pm »

But it's plenty easy: local playeroccupancy = dfhack.maps.getTileBlock(player.pos).occupancy[player.pos.x%16][player.pos.y%16]
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3188 on: March 11, 2013, 09:37:15 pm »

Ah, 16? That's all I needed to know. Not sure how I didn't figure that out, but oh well.

Andux

  • Bay Watcher
  • [PREFSTRING:semicolons]
    • View Profile
    • Andux's DFWiki page
Re: DFHack 0.34.11 r2
« Reply #3189 on: March 11, 2013, 09:52:45 pm »

In an unrelated question, is there like...a list of material IDs somewhere or something?  Like, i just picked a random item, and printall shows that mat_type = 30, and mat_index = 536.  I know that one of those has to refer to Silk, but for the life of me I can't find the struct that has that info in it.

Here's some example code that may help you get the hang of the various material-info-finder functions:
Code: [Select]
local mi = dfhack.matinfo.decode(mat_type,mat_index)
if mi then
print('Decoded MatInfo:')
printall(mi)
print('Full material token: '.. dfhack.matinfo.getToken(mat_type,mat_index) )
print('Specific material ID: '..mi.material.id)

printall( dfhack.matinfo.find('CREATURE:DWARF:BLOOD') )
end


Additionally:
...
4. It isn't checking whether the player is the only unit in the starting tile. :P
Logged
(Do not sign anything.) -- Fell, Planescape: Torment

MADMAN · Save Tools · WTF Tools · Generated Raws Extractor · Tweak for 0.31–34.xx

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3190 on: March 11, 2013, 10:59:08 pm »

I had something like 20,000 stone in my fort
Spoiler: You're doing it wrong. (click to show/hide)
Logged

Laggy

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3191 on: March 12, 2013, 01:11:03 am »

I had something like 20,000 stone in my fort
Spoiler: You're doing it wrong. (click to show/hide)
Haha, I saw that when you pasted it in irc.

--------------------

Unrelated:  Are keybindings broken for anyone else?  I added 'keybinding add Ctrl-Z' liquids-here to my init, but when I get in game and hit Ctrl-Z, nothing happens.  I checked 'keybinding list Ctrl-Z' and it says its bound to 'liquids-here'.  Any ideas?
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r2
« Reply #3192 on: March 12, 2013, 02:06:28 am »

Press Alt once. That will fix it. If you Alt+Tab out of DF, DF thinks that ALT is still pressed, till you press it again.

So after you Alt+Tabbed out of the game once, and went back to DF, and pressed your Ctrl+Z, you are actually pressing Ctrl+Alt+Z.
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 :::

Laggy

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3193 on: March 12, 2013, 02:14:01 am »

Press Alt once. That will fix it. If you Alt+Tab out of DF, DF thinks that ALT is still pressed, till you press it again.

So after you Alt+Tabbed out of the game once, and went back to DF, and pressed your Ctrl+Z, you are actually pressing Ctrl+Alt+Z.
That didn't fix it :(

Edit:  What's weird is that some of them work.  Like Ctrl+Q does quicksave.  But Ctrl+Z still doesn't do anything.

Edit2:  Well, using Alt-Z for the keybinding works fine.  Weird.  Maybe its because Ctrl-Z has a windows function and is getting intercepted before it gets to DF?
« Last Edit: March 12, 2013, 02:26:54 am by Laggy »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3194 on: March 12, 2013, 04:16:51 pm »

Where's the data for a tile being a wall? I can't find it and it's kinda bumming me out.
Pages: 1 ... 211 212 [213] 214 215 ... 373