Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 135 136 [137] 138 139 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1457117 times)

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2040 on: June 29, 2012, 03:14:41 am »

Have you tried putting magma a few extra z-levels above where you want it? Sometimes that helps.
Logged

ag

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2041 on: June 29, 2012, 03:33:25 am »

Can someone explain to me how to use make_sort_order defined in utils.lua? I don't understand the documentation. What is key supposed to do? Are you supposed to pass it an array of sorting data tables as the second argument?

Look how sort plugin works. That's the thing it was written for.

Edit: Basically, it implements something like an SQL ORDER BY clause, i.e. sorting based on a sequence of expressions with associated orderings, applied from left to right. The result is expressed as a lookup index table, instead of reordering the original array, so that you can apply it to multiple arrays in unison, which is what the sort plugin does all the time.
« Last Edit: June 29, 2012, 03:41:39 am by ag »
Logged

danaris

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2042 on: June 29, 2012, 09:59:00 am »

Good news, everyone!

After much rigamarole and trying various options, we finally have a build of DFHack for Mac OS X that should work for most people.

You can get it here for now.

Please try it out, and let us know if it works for you.
« Last Edit: June 29, 2012, 10:09:23 am by danaris »
Logged

Makbeth

  • Bay Watcher
  • His lower body is melted.
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2043 on: June 29, 2012, 11:23:26 am »

I don't like how obsidian walls and floors work in liquids and so i try to do it naturals way - by combining water and magma. But unfortunately this leaves tiles with hot stone. Which is strange as we have only obsidian slab surrounded by clay or sand. But they are hot and they never turn normal. I can swap them with obsidian of course and this actually changes temperature to normal. But there is a fact of DF game that it sometimes has temperature traps - then a stone or two inside earth are hot and never cool down.

If you're making obsidian, why are you dumping magma into water instead of the other way around?  The water won't create heat traps, and it should cool the magma below it.
Logged
Diso Faintpuzzles was born in 120.  Although accounts vary it is universally agreed that Diso was chosen by fate as the vanguard of destiny.

In the early spring of 143 Diso began wandering the wilds.

In the early spring of 143 Diso starved to death in the Horn of Striking.

Tierre

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2044 on: June 29, 2012, 12:58:54 pm »

2 things - firstly water sometimres evaporate before dumping into magma:) and secondly then i kill murky pool it already has water.... so making it into magma and them dropin water is kind of perverted:)
Logged

malvado

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2045 on: June 29, 2012, 02:58:34 pm »

Think it could be possible to change the point of view when playing fortress mode? Ie North to South etc?
Logged

HraTaika

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2046 on: June 29, 2012, 03:57:03 pm »

Good news, everyone!

After much rigamarole and trying various options, we finally have a build of DFHack for Mac OS X that should work for most people.

You can get it here for now.

Please try it out, and let us know if it works for you.



Muchos Gracias, will try it out and return with info.
Logged

Hesuchia

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2047 on: June 29, 2012, 04:32:40 pm »

Would it be possible to write the 'quicksave' command with an argument that specifies a new folder name?  A couple times now I've had DF crash on saving and had to go back to a previous save.  It'd be nice to have a couple save "slots" in case one gets corrupt like that.  The vanilla program does this somehow with one of the init backup options, but it'd be nice to have more control. :).
Logged

Makbeth

  • Bay Watcher
  • His lower body is melted.
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2048 on: June 29, 2012, 05:50:01 pm »

Think it could be possible to change the point of view when playing fortress mode? Ie North to South etc?

I'm betting that's among the hardest of hardcoded things in the game.  Almost certainly not.
Logged
Diso Faintpuzzles was born in 120.  Although accounts vary it is universally agreed that Diso was chosen by fate as the vanguard of destiny.

In the early spring of 143 Diso began wandering the wilds.

In the early spring of 143 Diso starved to death in the Horn of Striking.

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2049 on: June 29, 2012, 06:11:58 pm »

Think it could be possible to change the point of view when playing fortress mode? Ie North to South etc?

I'm betting that's among the hardest of hardcoded things in the game.  Almost certainly not.

It might technically be possible to just rotate the entire damn map by changing EVERYTHING in memory but it would be extremely difficult to do and would probably be slow.
Logged

khearn

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2050 on: June 29, 2012, 09:11:19 pm »

Think it could be possible to change the point of view when playing fortress mode? Ie North to South etc?

I'm betting that's among the hardest of hardcoded things in the game.  Almost certainly not.

It might technically be possible to just rotate the entire damn map by changing EVERYTHING in memory but it would be extremely difficult to do and would probably be slow.
And it would possibly break a lot of tracks that are based on directions. Your NE track might now need to be SW.
Logged
Have them killed. Nothing solves a problem quite as effectively as simply having it killed.

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2051 on: June 29, 2012, 09:18:03 pm »

Basically, probably not worth it.
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Hesuchia

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2052 on: June 29, 2012, 10:42:52 pm »

Heh I'm completely new to lua and am only mildly experienced in Python as my only programming background, but I've been spending a couple days straining my eyes decoding these structures and figuring out why stuff works and what doesn't.  Anyway, finally got a working command to change all your clothing on all your dwarves to 0 wear.

Code: [Select]
--THIS WILL SET ALL YOUR DWARVES' EQUIPMENT TO NO WEAR
for k,v in ipairs(df.global.world.items.all) do
if v.flags.owned and (v:getType() >= 25 and v:getType() <= 29 or v:getType() == 58) then
v:setWear(0)
v.wear_timer = 0
end
end

The conditionals for item type checks might not be strictly necessary for wear alone, but I was also tweaking with item quality which breaks on some quality-less item types. But the script here only resets wear and the incrementing timer. If you want max-quality equips too, just add v:setQuality(5) after the wear_timer line.

Note: I don't know how to make it so the equipment doesn't wear ever.  Probably like the modest mod does with setting armor quality to a certain level but this works for me.

Someone else posted a snippet here that did the wear stuff one item at a time so I just had to figure out how to iterate it :P. I think I got the feel for some of it now though.  Thank goodness. Maybe now I can actually play :P.
Logged

Makbeth

  • Bay Watcher
  • His lower body is melted.
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2053 on: June 29, 2012, 10:47:58 pm »

It's been an interesting night.  I have extremely limited knowledge of lua and how everything is structured, but I recently found out where the raws live in memory after world-generation, among several other exciting things, and have found the generated interactions.  While I'm grateful to finally be able to mod the procedural interactions after worldgen, for now I'm trying to figure out how to apply it to my adventurer.  I could have sworn that while digging around in unit.status or something that I found a place for active interactions, but I don't see it now.

Things are getting very fun.  It also appears that I may be able, with some effort, to print out a map of curious structure locations for the whole world.  I need to gain a few levels in lua scripting first though.

EDIT:

So, I've identified a syndrome that causes vampirism.  It is in df.global.world.raws.syndromes.all as syndrome 479, with the value <syndrome: 0x1b0490a8>.  (I know the exact values are meaningless to anyone without the save file, just using them for reference)

I'm trying to make unit.syndromes.active[0] equal the vampire syndrome.  This is a brand new adventurer, so his syndromes table started empty.  I was able to figure out how to add a null entry with unit.syndromes.active:changesize(1), but have been unable to set the first syndrome in the table to the vampire syndrome.  I've tried the following commands, posted with the errors they brought up:

Code: [Select]
[lua]# unit.syndromes.active[0]=df.global.world.raws.syndromes.all[479]
(interactive):1: Cannot write field vector<unit_syndrome*>.0: incompatible point
er type.
stack traceback:
        [C]: in function '__newindex'
        (interactive):1: in main chunk
        [C]: in function 'safecall'
        ....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:267: in func
tion <....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:193>



[lua]# unit.syndromes.active[0]=syndrome: 0x1b0490a8
(interactive):1: <name> expected near '0x1b0490a8'



[lua]# unit.syndromes.active[0]=0x1b0490a8
(interactive):1: Cannot write field vector<unit_syndrome*>.0: incompatible point
er type.
stack traceback:
        [C]: in function '__newindex'
        (interactive):1: in main chunk
        [C]: in function 'safecall'
        ....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:267: in func
tion <....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:193>



[lua]# unit.syndromes.active[0]=unit_syndrome: 0x1b0490a8
(interactive):1: <name> expected near '0x1b0490a8'



[lua]# unit.syndromes.active[0]=<syndrome: 0x1b0490a8>
(interactive):1: unexpected symbol near '<'



[lua]# unit.syndromes.active[0]=479
(interactive):1: Cannot write field vector<unit_syndrome*>.0: incompatible point
er type.
stack traceback:
        [C]: in function '__newindex'
        (interactive):1: in main chunk
        [C]: in function 'safecall'
        ....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:267: in func
tion <....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:193>



[lua]# unit.syndromes.active[0]=df.global.world.raws.syndromes.all[479]
(interactive):1: Cannot write field vector<unit_syndrome*>.0: incompatible point
er type.
stack traceback:
        [C]: in function '__newindex'
        (interactive):1: in main chunk
        [C]: in function 'safecall'
        ....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:267: in func
tion <....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:193>



[lua]# unit.syndromes.active[0]=df.global.world.raws.syndromes.all[479].type
(interactive):1: Cannot read field syndrome.type: not found.
stack traceback:
        [C]: in function '__index'
        (interactive):1: in main chunk
        [C]: in function 'safecall'
        ....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:267: in func
tion <....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:193>



[lua]# unit.syndromes.active[0]=<syndrome: 0x1b0490a8>
(interactive):1: unexpected symbol near '<'



[lua]# unit.syndromes.active[0]=syndrome: 0x1b0490a8
(interactive):1: <name> expected near '0x1b0490a8'



[lua]# nit.syndromes.active[0]=df.global.world.raws.syndromes.all[479].syn_name
(interactive):1: Cannot write field vector<unit_syndrome*>.0: incompatible point
er type.
stack traceback:
        [C]: in function '__newindex'
        (interactive):1: in main chunk
        [C]: in function 'safecall'
        ....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:267: in func
tion <....34.11] [V13]\Dwarf Fortress 0.34.11\hack\lua\dfhack.lua:193>



[lua]# unit.syndromes.active[0]=syndrome: df.global.world.raws.syndromes.all[479
(interactive):1: function arguments expected near '.'

I must be missing something about the basic syntax of adding an element to a table in lua.  Can anyone point me in the right direction?
« Last Edit: June 30, 2012, 12:04:11 am by Makbeth »
Logged
Diso Faintpuzzles was born in 120.  Although accounts vary it is universally agreed that Diso was chosen by fate as the vanguard of destiny.

In the early spring of 143 Diso began wandering the wilds.

In the early spring of 143 Diso starved to death in the Horn of Striking.

Hesuchia

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r1
« Reply #2054 on: June 30, 2012, 12:32:46 am »

I'm not entirely sure about it since I haven't touched the memory locations directly, but there are some functions that seem pretty useful for that in utils.lua.  Specifically the assign(tgt,src) and at the bottom insert_or_update(vector,item,field,cmp).  I'm still a lua noob but they seem like they pertain ;). From what I've seen in other scripts people just add a

utils = require 'utils'
utils.function()

into their scripts. i'm not sure if it's loaded at runtime and the require assignment is unnecessary but it works :P
Logged
Pages: 1 ... 135 136 [137] 138 139 ... 373