Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 207 208 [209] 210 211 ... 360

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

qorthos

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3120 on: September 15, 2015, 10:23:47 pm »

Got it runs.  Small typo had to fixed.  floor needs to become math.floor

Code: [Select]
local xOffset = pos.x - 16*math.floor(pos.x / 16)
local yOffset = pos.y - 16*math.floor(pos.y / 16)

But then it spawns water, and said water doesn't move.  Scratching my head over that one...
« Last Edit: September 15, 2015, 10:27:15 pm by qorthos »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3121 on: September 15, 2015, 10:40:32 pm »

For just magma, change

tileBlock.designation[xOffset][yOffset].liquid_type = df.tile_liquid[args.liquidType]

to

tileBlock.designation[xOffset][yOffset].liquid_type = true

and add

tileBlock.flags.update_liquid_twice = true

should work.
Logged

qorthos

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3122 on: September 15, 2015, 11:05:35 pm »

That fixed it.  Finished and working script:

Code: [Select]
utils = require 'utils'
validArgs = validArgs or utils.invert({
  'help',
  'location',
  'type',
  'amount',
  'offset'
})

local args = utils.processArgs({...}, validArgs)

if args.help then
  print([[scripts/liquidMaker.lua
    -help
        print this help message
    -location [ x y z ]
        specify the target location coordinates
    -offset [ x y z ]
        add this vector to location in order to get the real target location
        this argument is optional
    -amount n
        specify the desired depth of the liquid
    -liquidType liquidType
        specify whether you want magma or water
        liquidType should be Water or Magma
]])
  return
end

local pos = {}
pos.x = tonumber(args.location[1])
pos.y = tonumber(args.location[2])
pos.z = tonumber(args.location[3])

if args.offset then
  pos.x = pos.x + tonumber(args.offset[1])
  pos.y = pos.y + tonumber(args.offset[2])
  pos.z = pos.z + tonumber(args.offset[3])
end

local tileBlock = dfhack.maps.ensureTileBlock(pos.x, pos.y, pos.z)
tileBlock.flags.update_temperature = true
tileBlock.flags.update_liquid = true
local xOffset = pos.x - 16*math.floor(pos.x / 16)
local yOffset = pos.y - 16*math.floor(pos.y / 16)

tileBlock.designation[xOffset][yOffset].flow_size = tonumber(args.amount)
tileBlock.designation[xOffset][yOffset].liquid_type = true
tileBlock.flags.update_liquid_twice = true
Logged

Abaddon

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3123 on: September 16, 2015, 09:17:20 am »

Is there a script which can show me my adventurers stats and stat caps?
Logged

qorthos

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3124 on: September 16, 2015, 10:11:19 am »

The liquidType is no ignored (now surprise).  Found that out while trying to spawn water.  Gonna have to root around the API docs and see if I can figure it out.  I think LUA is casting 'true' into the liquidType magma enum is.  Lua, y u no strongly typed?   :'(

My first minimod will be an Ice Furnace that takes a block of glacial ice, fuel (mebbe magma) and pipes it to the floor below.




Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3125 on: September 16, 2015, 01:40:36 pm »

Ran into a dead-end so far, I was trying to get it where I could add a -all flag and have it show the entire map but so far the only one I can toggle the visibility on is the northwesternmost square because it's 0 by 0 and the structures file defaults to that one in the world_data.region_map stuff I think.

Still works for sites that you can't find anyone to point out, which is super handy in things like a nearly dead world as I was playing in earlier (total remaining pop is like 150 or so I think) because nobody has a clue where anything is anymore.

Code: ("revealsites.lua") [Select]
local hid = df.global.world.world_data.sites
for k, v in ipairs(hid) do
hid[k].flags.Undiscovered=false
hid[k].flags[8]=true
end

Weirdly it doesn't unhide the map block where the lair is (so you're still limited to the locally visible stuff from your travels) but it will unhide all the stuff on visible map blocks for you.

Well, not sure if it's revealing the vaults right, might be another flag in there that needs to be flipped, I just copied the settings from some of the lairs I'd found until it worked as I expected.

Probably try to add toggles so you can have it do lairs, camps, vaults, and everything. Still not sure where to toggle map block visibility is though.
« Last Edit: September 16, 2015, 01:42:44 pm by Max™ »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3126 on: September 16, 2015, 03:23:24 pm »

The liquidType is no ignored (now surprise).  Found that out while trying to spawn water.  Gonna have to root around the API docs and see if I can figure it out.  I think LUA is casting 'true' into the liquidType magma enum is.  Lua, y u no strongly typed?   :'(

My first minimod will be an Ice Furnace that takes a block of glacial ice, fuel (mebbe magma) and pipes it to the floor below.

Change

Code: [Select]
tileBlock.designation[xOffset][yOffset].liquid_type = true
to

Code: [Select]
if df.tile_liquid[args.liquidType] == 0 then
 tileBlock.designation[xOffset][yOffset].liquid_type = false
elseif df.tile_liquid[args.liquidType] == 1 then
 tileBlock.designation[xOffset][yOffset].liquid_type = true
end

Should handle water and magma now
Logged

qorthos

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3127 on: September 16, 2015, 05:07:02 pm »

My fix was similar. 

Code: [Select]
if args.liquidType == "Magma" then
tileBlock.designation[xOffset][yOffset].liquid_type = 1
else
tileBlock.designation[xOffset][yOffset].liquid_type = 0
end

(also changed type to liquidType in args)

Everything seems to work except I sometimes get a stack of 7/7 water that just hangs out for a little and then later collapses.  A bit odd...

Working on the building now...
Logged

Jazzeraint

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3128 on: September 16, 2015, 07:11:23 pm »

Would it be possible through DFHack to create a syndrome that infected a Dwarf and made them periodically grow Plump Helmet Men (i.e. spawn a unit) until the Dwarf eventually died? Say, ill for 1 - 4 years, started sprouting PHM that jumped off after the 6 - 12 month mark?

Just an idea. (And if this is the wrong thread to ask this, please let me know~)
Logged
The silver is responsible for this How?

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3129 on: September 16, 2015, 09:47:45 pm »

Are you trying to recreate a doctor who episode?
Logged

Jazzeraint

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3130 on: September 16, 2015, 09:53:04 pm »

Are you trying to recreate a doctor who episode?

Actually no, but I see the resemblance now that you mention it.
I was thinking of how to make raw Plump Helmets less than ideal to eat, and I imagined tumors that burst open and out popped creepy crawlies... and then with the PMH mod already in place, it clicked.
Logged
The silver is responsible for this How?

qorthos

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3131 on: September 17, 2015, 11:43:56 am »

Water&Magma seems to inconsistently sticking in a 7/7 column.  Sometimes it just takes a few DF days and then it'll fall out, sometimes longer.  Not sure what the deal is.  Should I try setting the flag for liquid updating on adjacent blocks?
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3132 on: September 17, 2015, 11:52:28 am »

Water&Magma seems to inconsistently sticking in a 7/7 column.  Sometimes it just takes a few DF days and then it'll fall out, sometimes longer.  Not sure what the deal is.  Should I try setting the flag for liquid updating on adjacent blocks?
I know that fluid updates are staggered a bit for FPS concerns, but a few game days seems long.  Hopefully setting the update flag on that and the eight neighboring tiles helps.  There are only seven units of water, so it won't look too strange even if the water stays inside that box for a while.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Jazzeraint

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3133 on: September 17, 2015, 03:21:30 pm »

Are there any scripts out there that modify the hunger rates for Dwarves?
If not, could someone direct me toward making one?
Logged
The silver is responsible for this How?

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3134 on: September 17, 2015, 08:20:36 pm »

Edit: Never mind, the whole problem was due to a stupid typo.
« Last Edit: September 21, 2015, 07:21:07 am by Dirst »
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map
Pages: 1 ... 207 208 [209] 210 211 ... 360