Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 25 26 [27] 28 29 ... 360

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

YAHG

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.08-r1.2
« Reply #390 on: August 15, 2014, 08:47:20 am »

Attention: Do NOT use either of these versions, as they were built against outdated structures data where the virtual method table for the "item" class is misaligned, which will cause various plugins to crash Dwarf Fortress if they try to manipulate items in certain ways.

A new version will be available shortly.

That's like giving a man a lil bit o crack, then leaving the rest on the table (with the pipe and lighter) and telling him not to finish it  >:).

Then again if we do not listen to you we will all be turned into a Oprelian Amoeba  :-X

OzoneGrif

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.08-r1.2
« Reply #391 on: August 15, 2014, 09:04:37 am »

Thanks a lot for DFHack !

I'm doing some tests :
- Search in the stock screen crashes.
- "stocks show" in the command line crashes.
- "strangemood" in the command crashes
- "Ctrl+Shift+I" keybinding crashes
- Creating a workflow in the GUI (Z then Alt+W) crashes
- The Job assign text under Stockpiles (J:) hide some of the listed links

Overrall, it works quite well :)
« Last Edit: August 15, 2014, 09:06:54 am by OzoneGrif »
Logged

smjjames

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #392 on: August 15, 2014, 09:06:01 am »

A what amoeba?

Anyway, I was going to grab Peridexis's pack before I saw Quietusts warning about the fact that it's bugged. Can't wait for a functional DFhack to play around with.

Been frustrated by my curiosity about what is causing the spam of pathing errors from underground critters (mostly crundles, but anything down there can do it) and being unable to see what the heck is happening down there.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #393 on: August 15, 2014, 09:57:28 am »

Basically everything will crash in r1. r2 should be mostly ok, but still be careful with it.
Logged

Aquathug

  • Bay Watcher
  • This text is personal.
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #394 on: August 15, 2014, 09:58:56 am »

Basically everything will crash in r1. r2 should be mostly ok, but still be careful with it.

Sweet. Thank you sir.
« Last Edit: August 15, 2014, 10:01:22 am by Aquathug »
Logged

gosam

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #395 on: August 15, 2014, 11:11:54 am »

Praise the coders!

It's working so far for me. Had to fiddle a bit with the LD_LIBRARY_PATH due to my setup (problems with libtiff), but it's all good now.
Thanks to everyone involved!
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #396 on: August 15, 2014, 12:03:57 pm »

You're using an old, unworking version of hackwish. Like, literally doesn't work. Here's one that does:

Code: [Select]
-- Allows for script-based wishing.
 
function getGenderString(gender)
 local genderStr
 if gender==0 then
  genderStr=string.char(12)
 elseif gender==1 then
  genderStr=string.char(11)
 else
  return ""
 end
 return string.char(40)..genderStr..string.char(41)
end
 
function getCreatureList()
 local crList={}
 for k,cr in ipairs(df.global.world.raws.creatures.alphabetic) do
  for kk,ca in ipairs(cr.caste) do
   local str=ca.caste_name[0]
   str=str..' '..getGenderString(ca.gender)
   table.insert(crList,{str,nil,ca})
  end
 end
 return crList
end
 
function getMatFilter(itemtype)
  local itemTypes={
   SEEDS=function(mat,parent,typ,idx)
    return mat.flags.SEED_MAT
   end,
   PLANT=function(mat,parent,typ,idx)
    return mat.flags.STRUCTURAL_PLANT_MAT
   end,
   LEAVES=function(mat,parent,typ,idx)
    return mat.flags.LEAF_MAT
   end,
   MEAT=function(mat,parent,typ,idx)
    return mat.flags.MEAT
   end,
   CHEESE=function(mat,parent,typ,idx)
    return (mat.flags.CHEESE_PLANT or mat.flags.CHEESE_CREATURE)
   end,
   LIQUID_MISC=function(mat,parent,typ,idx)
    return (mat.flags.LIQUID_MISC_PLANT or mat.flags.LIQUID_MISC_CREATURE or mat.flags.LIQUID_MISC_OTHER)
   end,
   POWDER_MISC=function(mat,parent,typ,idx)
    return (mat.flags.POWDER_MISC_PLANT or mat.flags.POWDER_MISC_CREATURE)
   end,
   DRINK=function(mat,parent,typ,idx)
    return (mat.flags.ALCOHOL_PLANT or mat.flags.ALCOHOL_CREATURE)
   end,
   GLOB=function(mat,parent,typ,idx)
    return (mat.flags.STOCKPILE_GLOB)
   end,
   WOOD=function(mat,parent,typ,idx)
    return (mat.flags.WOOD)
   end,
   THREAD=function(mat,parent,typ,idx)
    return (mat.flags.THREAD_PLANT)
   end,
   LEATHER=function(mat,parent,typ,idx)
    return (mat.flags.LEATHER)
   end
  }
  return itemTypes[df.item_type[itemtype]] or getRestrictiveMatFilter(itemtype)
end
 
function getRestrictiveMatFilter(itemType)
 if not args.veryRestrictive then return nil else
 local itemTypes={
   WEAPON=function(mat,parent,typ,idx)
    return (mat.flags.ITEMS_WEAPON or mat.flags.ITEMS_WEAPON_RANGED)
   end,
   AMMO=function(mat,parent,typ,idx)
    return (mat.flags.ITEMS_AMMO)
   end,
   ARMOR=function(mat,parent,typ,idx)
    return (mat.flags.ITEMS_ARMOR)
   end,
   SHOES,SHIELD,HELM,GLOVES=ARMOR,ARMOR,ARMOR,ARMOR,
   INSTRUMENT=function(mat,parent,typ,idx)
    return (mat.flags.ITEMS_HARD)
   end,
   GOBLET,FLASK,TOY,RING,CROWN,SCEPTER,FIGURINE,TOOL=INSTRUMENT,INSTRUMENT,INSTRUMENT,INSTRUMENT,INSTRUMENT,INSTRUMENT,INSTRUMENT,
   AMULET=function(mat,parent,typ,idx)
    return (mat.flags.ITEMS_SOFT or mat.flags.ITEMS_HARD)
   end,
   EARRING,BRACELET=AMULET,AMULET,
   ROCK=function(mat,parent,typ,idx)
    return (mat.flags.IS_STONE)
   end,
   BOULDER=ROCK,
   BAR=function(mat,parent,typ,idx)
    return (mat.flags.IS_METAL or mat.flags.SOAP or mat.id==COAL)
   end
   
  }
 return itemTypes[df.item_type[itemType]]
 end
end
 
function createItem(mat,itemType,quality,creator,description)
dfhack.items.createItem(itemType[1], itemType[2], mat[1], mat[2], creator)
 if df.item_type[itemType[1]]=='SLAB' then
  item.description=description
 end
end
 
function qualityTable()
 return {{'None'},
 {'-Well-crafted-'},
 {'+Finely-crafted+'},
 {'*Superior*'},
 {string.char(240)..'Exceptional'..string.char(240)},
 {string.char(15)..'Masterwork'..string.char(15)}
 }
end
 
local script=require('gui.script')
 
function showItemPrompt(text,item_filter,hide_none)
 require('gui.materials').ItemTypeDialog{
  prompt=text,
  item_filter=item_filter,
  hide_none=hide_none,
  on_select=script.mkresume(true),
  on_cancel=script.mkresume(false),
  on_close=script.qresume(nil)
 }:show()
 
 return script.wait()
end
 
function showMaterialPrompt(title, prompt, filter, inorganic, creature, plant) --the one included with DFHack doesn't have a filter or the inorganic, creature, plant things available
 require('gui.materials').MaterialDialog{
  frame_title = title,
  prompt = prompt,
  mat_filter = filter,
  use_inorganic = inorganic,
  use_creature = creature,
  use_plant = plant,
  on_select = script.mkresume(true),
  on_cancel = script.mkresume(false),
  on_close = script.qresume(nil)
 }:show()
 
 return script.wait()
end
 
function usesCreature(itemtype)
 typesThatUseCreatures={REMAINS=true,FISH=true,FISH_RAW=true,VERMIN=true,PET=true,EGG=true,CORPSE=true,CORPSEPIECE=true}
 return typesThatUseCreatures[df.item_type[itemtype]]
end
 
function getCreatureRaceAndCaste(caste)
 return df.global.world.raws.creatures.list_creature[caste.index],df.global.world.raws.creatures.list_caste[caste.index]
end
 
function hackWish(unit)
 script.start(function()
  local amountok, amount
  local matok,mattype,matindex,matFilter
  local itemok,itemtype,itemsubtype=showItemPrompt('What item do you want?',function(itype) return df.item_type[itype]~='CORPSE' and df.item_type[itype]~='FOOD' end ,true)
  if not args.notRestrictive then
   matFilter=getMatFilter(itemtype)
  end
  if not usesCreature(itemtype) then
   matok,mattype,matindex=showMaterialPrompt('Wish','And what material should it be made of?',matFilter)
  else
   local creatureok,useless,creatureTable=script.showListPrompt('Wish','What creature should it be?',COLOR_LIGHTGREEN,getCreatureList())
   mattype,matindex=getCreatureRaceAndCaste(creatureTable[3])
  end
  local qualityok,quality=script.showListPrompt('Wish','What quality should it be?',COLOR_LIGHTGREEN,qualityTable())
  local description
  if df.item_type[itemtype]=='SLAB' then
   local descriptionok
   descriptionok,description=script.showInputPrompt('Slab','What should the slab say?',COLOR_WHITE)
  end
  if args.multi then
   repeat amountok,amount=script.showInputPrompt('Wish','How many do you want? (numbers only!)',COLOR_LIGHTGREEN) until tonumber(amount)
    if mattype and itemtype then
     for i=1,tonumber(amount) do
      createItem({mattype,matindex},{itemtype,itemsubtype},quality,unit,description)
     end
    end
  else
   if mattype and itemtype then
    createItem({mattype,matindex},{itemtype,itemsubtype},quality,unit,description)
   end   
  end
 end)
end
 
scriptArgs={...}

utils=require('utils')

validArgs = validArgs or utils.invert({
 'startup',
 'all',
 'restrictive',
 'unit',
 'multi'
})

args = utils.processArgs({...}, validArgs)
 
eventful=require('plugins.eventful')

if not args.startup then
 local unit=args.unit and df.unit.find(args.unit) or dfhack.gui.getSelectedUnit(true)
 hackWish(unit)
else
 eventful.onReactionComplete.hackWishP=function(reaction,unit,input_items,input_reagents,output_items,call_native)
  if not reaction.code:find('DFHACK_WISH') then return nil end
  hackWish(unit)
 end
end
« Last Edit: August 29, 2014, 08:42:07 pm by Putnam »
Logged

smjjames

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #397 on: August 15, 2014, 12:30:40 pm »

Two questions here:

1. If I load up Peridexis's starter pack, which uses r1, is the only thing I have to replace to update DFhack to r2 is the DFhack.init in the newer download, right?

2. How do I view the coordinates like those in the 'path fail' errors?
Logged

scamtank

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #398 on: August 15, 2014, 12:52:03 pm »

1. No. r1 is fucked under the hood in more ways than just those tweaks. Get the r2 version.
Logged

smjjames

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #399 on: August 15, 2014, 12:53:57 pm »

I get that, but is the only thing I have to replace is one file or is there more? I'm just checking on that.
Logged

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #400 on: August 15, 2014, 12:58:52 pm »

I get that, but is the only thing I have to replace is one file or is there more? I'm just checking on that.
At least the complete /hack directory and the .init.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.40.08-r2
« Reply #401 on: August 15, 2014, 01:24:22 pm »

I get that, but is the only thing I have to replace is one file or is there more? I'm just checking on that.
At least the complete /hack directory and the .init.
Most notably, you need to update all of the DLLs - SDL.dll, protobuf-lite.dll, lua.dll, libruby.dll, dfhack-client.dll, and all of the plugins - failing to update any of those can and will cause it to continue crashing.
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.

SeelenJägerTee

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #402 on: August 15, 2014, 01:24:35 pm »

https://github.com/DFHack/dfhack#lua
Quote
lua (without any parameters)

This starts an interactive lua interpreter.
But I can't find any documentation about what do do when IN the interpreter.
E.g. this post tells me what to do. But where can I find info on the data structure if I wanted to come up with sth. like this myself?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #403 on: August 15, 2014, 01:28:06 pm »

https://github.com/DFHack/dfhack/blob/master/Lua%20API.rst

gui/gm-editor is a good tool that does pretty much the same thing.

smjjames

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #404 on: August 15, 2014, 01:28:36 pm »

I get that, but is the only thing I have to replace is one file or is there more? I'm just checking on that.
At least the complete /hack directory and the .init.
Most notably, you need to update all of the DLLs - SDL.dll, protobuf-lite.dll, lua.dll, libruby.dll, dfhack-client.dll, and all of the plugins - failing to update any of those can and will cause it to continue crashing.

I'll wait for peridexis to update it in a couple hours, unless I can just swap files? Then again, I wouldn't be 100% sure on what I'm doing.

Anybody know anything about the second question? Lethosor says in http://www.bay12games.com/dwarves/mantisbt/view.php?id=7821 that they are cursor coordinates, but how do I get that to show?
« Last Edit: August 15, 2014, 01:32:21 pm by smjjames »
Logged
Pages: 1 ... 25 26 [27] 28 29 ... 360