Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 345 346 [347] 348 349 ... 360

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

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5190 on: February 01, 2017, 03:03:22 pm »

@Roses: Yes, there is a script (actually a plugin) for creating trees called "plant". It creates saplings or shrubs, and it can also grow trees from saplings, so getting a grown tree is a two step process.
Logged

TheFlame52

  • Bay Watcher
  • Master of the randomly generated
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5191 on: February 01, 2017, 05:10:28 pm »

It was renamed to drain-aquifer.

Also, it's mentioned in http://dfhack.readthedocs.io/en/stable/docs/History.html. If you ever have similar questions, http://dfhack.readthedocs.io/en/stable/NEWS.html and that page are good places to look.
I looked through the list like three times and missed it. I am blind. Thanks for the help.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5192 on: February 01, 2017, 06:02:50 pm »

It was renamed to drain-aquifer.

Also, it's mentioned in http://dfhack.readthedocs.io/en/stable/docs/History.html. If you ever have similar questions, http://dfhack.readthedocs.io/en/stable/NEWS.html and that page are good places to look.
I looked through the list like three times and missed it. I am blind. Thanks for the help.
I use ctrl+f for exactly this reason :)
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5193 on: February 02, 2017, 03:23:12 am »

Yeah, ctrl+f is so easy to forget.

Oh, I meant to ask, is there anywhere known that the info displayed on the adventurer quest log would be saved? I'm guessing it's in there buried under a bunch of unk entries if you look through gview or one of the deeper piles of unk entries in ui_advmode.

Besides the gview.view.child.child.viewscreen_adventure_logst entry of course, unless it's likely that one of the unks in there has the links I'm looking for.

Always wanted to make a script to move your travel army to a position chosen on the quest log map but never got it going right.

Nevermind, I figured out that it was crashy trying to check out the items under the adventurer log so then I tried to hack gm-editor into doing this but fuck it, it's good enough for a script by itself:
Spoiler (click to show/hide)
Code: (questport.lua) [Select]
local qmap=dfhack.gui.getCurViewscreen()
local qx=qmap.cursor_x*48
local qy=qmap.cursor_y*48
local rx=qmap.player_region_x*48
local ry=qmap.player_region_y*48
  local qarm=df.global.world.armies.all
for k,v in ipairs(qarm) do
if v.flags[0] then
local my_arm=df.global.world.armies.all[k].pos
if rx~=qx then do
my_arm.x=qx
my_arm.y=qy
qmap.player_region_x=qmap.cursor_x
qmap.player_region_y=qmap.cursor_y
end
end
end
end
I wanted to put in a check attempt to make it look for the requisite screens (dfhack.gui.getCurViewscreen()==viewscreen_adventurer_logst)/travel state(df.global.ui_advmode.menu==26) but it got annoying figuring out which one wasn't working so I'll bother with that later when I push it upstream probably, since it just doesn't do anything outside of travel/quest combo.
« Last Edit: February 02, 2017, 06:13:58 am by Max™ »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5194 on: February 02, 2017, 11:54:09 am »

So I managed to get around the internet limitation by writing the script on a piece of paper and then typing it in at work, here is a script for butchering a corpse. It takes a unit id (checks for it's corpse) or a corpse item id (checks to make sure it's actually a corpse) or a location (butchers the first corpse it finds on that location). Enjoy!

Code: [Select]
local utils=require 'utils'
local gui = require 'gui'
 
validArgs = --[[validArgs or]]utils.invert({
  'help',
  'unit',
  'corpse',
  'location',
  'kill',
 
})

local args = utils.processArgs({...}, validArgs)
if args.help then
  print('')
  return
end

corpse = nil
if args.unit and tonumber(args.unit) then
 unit = df.unit.find(tonumber(args.unit))
 if not unit then return end
 if unit.flags1.dead then
  for _,id in pairs(unit.corpse_parts) do
   item = df.item.find(id)
   if df.item_corpsest:is_instance(item) and not item.body.components.body_part_status[0].missing and item.corpse_flags.unbutchered then
    corpse = item
    break
   end
  end
 else
  if args.kill then
   print('-kill not currently working')
  else
   print('Unit is still alive and has not been ordered -kill')
  end
 end
elseif args.corpse and tonumber(args.corpse) then
 item = df.item.find(tonumber(args.corpse))
 if not item then return end
 if df.item_corpsest:is_instance(item) then
  if not item.body.components.body_part_status[0].missing and item.corpse_flags.unbutchered then
   corpse = item
  end
 end
elseif args.location then
 locx = tonumber(args.location[1])
 locy = tonumber(args.location[2])
 locz = tonumber(args.location[3])
 block = dfhack.maps.ensureTileBlock(locx,locy,locz)
 if block.occupancy[locx%16][locy%16].item then
  for _,id in pairs(block.items) do
   item = df.item.find(id)
   if df.item_corpsest:is_instance(item) then
    if item.pos.x == locx and item.pos.y == locy and item.pos.z == locz then
     if not item.body.components.body_part_status[0].missing and item.corpse_flags.unbutchered then
      corpse = item
      break
     end
    end
   end
  end
 end
end
if not corpse then return end

local view_x = df.global.window_x
local view_y = df.global.window_y
local view_z = df.global.window_z
local curViewscreen = dfhack.gui.getCurViewscreen()
local dwarfmodeScreen = df.viewscreen_dwarfmodest:new()
curViewscreen.child = dwarfmodeScreen
dwarfmodeScreen.parent = curViewscreen
local oldMode = df.global.ui.main.mode
df.global.ui.main.mode = df.ui_sidebar_mode.LookAround
local old_gametype = df.global.gametype
df.global.gametype = df.game_type.DWARF_ARENA

df.global.cursor.x = corpse.pos.x
df.global.cursor.y = corpse.pos.y
df.global.cursor.z = corpse.pos.z
for i,_ in pairs(df.global.ui_look_list.items) do
 df.global.ui_look_cursor = i
 if dfhack.gui.getCurFocus() == 'dwarfmode/LookAround/Item' then
  if corpse.id == dfhack.gui.getSelectedItem().id then
   break
  end
 end
end
gui.simulateInput(dfhack.gui.getCurViewscreen(), 'D_LOOK_ARENA_ADV_MODE')

df.global.gametype = old_gametype
curViewscreen.child = nil
dwarfmodeScreen:delete()
df.global.ui.main.mode = oldMode

df.global.window_x = view_x
df.global.window_y = view_y
df.global.window_z = view_z
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5195 on: February 02, 2017, 04:09:53 pm »

So I managed to get around the internet limitation by writing the script on a piece of paper and then typing it in at work

I commend your dedication! I would never have the patience to do that...

The script looks very interesting, I may (finally) be able to get rid of the butchershop in Underhive Settlement... If I can come up with a way to replace slaughtering too...
« Last Edit: February 02, 2017, 04:11:53 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

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5196 on: February 02, 2017, 07:57:35 pm »

So I managed to get around the internet limitation by writing the script on a piece of paper and then typing it in at work

I commend your dedication! I would never have the patience to do that...

The script looks very interesting, I may (finally) be able to get rid of the butchershop in Underhive Settlement... If I can come up with a way to replace slaughtering too...

Well the script does have an added argument -kill which kills the creature and then butchers it. But I disabled that particular feature because it caused crashes. I think it will work if you just allow one in-game tick to occur between killing and butchering.
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5197 on: February 03, 2017, 01:54:34 pm »

I have a question, what is going on with animals turned with GM editor turning back and reverting to what they once were? Doing this more than once crashes the game.
« Last Edit: February 03, 2017, 03:59:24 pm by FantasticDorf »
Logged

Nahere

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5198 on: February 03, 2017, 06:25:30 pm »

Is there a working version of bodyswap somewhere? Or some equivalent?
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5199 on: February 03, 2017, 07:48:26 pm »

Hmmm, I remember there was an extra step needed in there for the actual transfer, trying to just flip the relevant flags gives you the creepy "I am a bat in a cave in the far northwest, I have no mouth, and I must scream" bug.

Changing animals and other creatures with gm-editor properly would involve tracking down everything that points to that animal being a specific species.

Anybody know offhand what all is needed to put yourself into travel mode fully? Setting the menu type to 26 and travel_not_moved to true in arena mode lets you move around there but that isn't what I was looking for with the questport, but until you've moved or entered a wait timer you don't get an army entry you can edit.
« Last Edit: February 03, 2017, 09:43:15 pm by Max™ »
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5200 on: February 04, 2017, 09:07:29 am »

Hmmm, I remember there was an extra step needed in there for the actual transfer, trying to just flip the relevant flags gives you the creepy "I am a bat in a cave in the far northwest, I have no mouth, and I must scream" bug.

Changing animals and other creatures with gm-editor properly would involve tracking down everything that points to that animal being a specific species.

Anybody know offhand what all is needed to put yourself into travel mode fully? Setting the menu type to 26 and travel_not_moved to true in arena mode lets you move around there but that isn't what I was looking for with the questport, but until you've moved or entered a wait timer you don't get an army entry you can edit.

oh wait adv body swap isn't fully put out oh crud uhh.... yeah here's one, though mostly this will do is make the character your swapping into a permanent adventurer so on retirement you could choose them.
gotta give warmist credit for making these small functions(and originally making bodyswap script), those were like building blocks to writing dfusion/dfhack lua scripts for me.

Spoiler (click to show/hide)
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Nahere

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5201 on: February 05, 2017, 04:58:38 pm »

@Rumrusher
Given that the units I'm trying to bodyswap to are already retired adventurers, that won't really help. Didn't you have a way of cutting the two week waiting period down though? That would work.
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5202 on: February 05, 2017, 08:41:37 pm »

Hmmm, my gui skills aren't up to the task so I just use gm-editor to open df.global.gview.view.child.child I think, and set the year_tick up or down if I want now/much later, but a script which popped up a prompt when the calendar starts to update would be doable.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5203 on: February 06, 2017, 12:25:07 am »

@Rumrusher
Given that the units I'm trying to bodyswap to are already retired adventurers, that won't really help. Didn't you have a way of cutting the two week waiting period down though? That would work.

uhh gui/gm-editor dfhack.gui.getCurViewscreen() at the calendar then change either the tick or a year to 0 and you will instantly jump to the adv menu.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5204 on: February 06, 2017, 01:15:37 am »

gui/gm-editor dfhack.gui.getCurViewscreen()
"gui/gm-editor scr" does the same thing, by the way.
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.
Pages: 1 ... 345 346 [347] 348 349 ... 360