Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 332 333 [334] 335 336 ... 360

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

scourge728

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4995 on: December 08, 2016, 09:54:07 pm »

So I'm using the alpha for the new version, where do I get the "ruby library" to use startdwarves?
Which is "the" alpha? There have been two, 0.43.05-alpha1 and 0.43.05-alpha2. The latter comes with a ruby plugin and runtime library
Oh, there was an update? I should probably install that then

EDIT: Where do I obtain alpha 2, I have alpha 1 but the file thing where I got the alpha 1 apperentley only has an Alpha 0 which makes me very confused as to how exactly I even have alpha 1

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4996 on: December 08, 2016, 10:24:58 pm »

Which "file thing"? All of the DFHack releases are at https://github.com/dfhack/dfhack/ under the "Releases" link.
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.

scourge728

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4997 on: December 08, 2016, 10:41:40 pm »

Sorry that I'm so bad at this but this ZIP has... quite a lot more files then the one that I had and frankly, I've got no idea what they do or what to do with them

utunnels

  • Bay Watcher
  • Axedwarf
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4998 on: December 09, 2016, 02:57:56 am »

Was that 32-bit DFHack? I wouldn't expect 64-bit DFHack to launch at all on a 32-bit system, but that's very strange.

Yeah, it was.  The system I tried was windows 2003, which I used to run the game remotely to skip time.
Logged
The troglodyte head shakes The Troglodyte around by the head, tearing apart the head's muscle!

Risen Asteshdakas, Ghostly Recruit has risen and is haunting the fortress!

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4999 on: December 09, 2016, 09:00:35 am »

Sorry that I'm so bad at this but this ZIP has... quite a lot more files then the one that I had and frankly, I've got no idea what they do or what to do with them
Did you download a release archive for Windows or something else?

To be clear, under DFHack 0.43.05-alpha2, you want either "dfhack-0.43.05-alpha2-Windows-32.zip" or "dfhack-0.43.05-alpha2-Windows-64.zip".
« Last Edit: December 09, 2016, 09:35:04 am by lethosor »
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.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5000 on: December 09, 2016, 02:07:13 pm »

New update on tree deletion. Successfully deleting the tree from the three different lists (plants.all, plants.tree_dry/tree_wet and map_block_column.plants) will remove the tree from the game and leave all tiles connected to that tree as just saying Tree. The game was fully able to be saved and reloaded as well. Even without changing the tile types. I have also figured out how to identify the position of each branch, thick branch, trunk, and twig of the tree so that they can be set to the correct tiletype.

So small hiccup. Got it all working perfectly except for the crashes... Namely it crashes when you are searching tree.tree_info.body and you go outside a certain value. Code copied below for reference. The main issue is the z search. Most trees I have examined have a tree_info.body_height of 10, but rarely actually go up 10 z levels. This causes the game to crash if it starts searching for more z levels then the tree has. If I manually set the height to the actual height of the tree everything is fine, but if it is even one more than the height it will crash. Anyone know of an easy way to get the actual tree height, or to prevent crashes when looking at a point in the tree_info.body vector outside of its boundaries?

Code: [Select]
function getTreePositions(tree)
 n = 0
 nTrunk = 0
 nTwigs = 0
 nBranches = 0
 nTBranches = 0
 positions = {}
 positionsTrunk = {}
 positionsTwigs = {}
 positionsBranches = {}
 positionsTBranches = {}
 local x1 = tree.pos.x - math.floor(tree.tree_info.dim_x / 2)
 local x2 = tree.pos.x + math.floor(tree.tree_info.dim_x / 2)
 local y1 = tree.pos.y - math.floor(tree.tree_info.dim_y / 2)
 local y2 = tree.pos.y + math.floor(tree.tree_info.dim_y / 2)
 local z1 = tree.pos.z
 local z2 = tree.pos.z + tree.tree_info.body_height
 for x = x1,x2 do
  for y = y1,y2 do
   for z = z1,z2 do
    pos = {x=x,y=y,z=z}
    body = tree.tree_info.body[pos.z-z1]:_displace((pos.y - y1) * tree.tree_info.dim_x + (pos.x - x1))
    if body.trunk then
     n = n + 1
     positions[n] = pos
     nTrunk = nTrunk + 1
     positionsTrunk[nTrunk] = pos
    elseif body.twigs then
     n = n + 1
     positions[n] = pos
     nTwigs = nTwigs + 1
     positionsTwigs[nTwigs] = pos
    elseif body.branches then
     n = n + 1
     positions[n] = pos
     nBranches = nBranches + 1
     positionsBranches[nBranches] = pos
    elseif body.thick_branches_1 or body.thick_branches_2 or body.thick_branches_3 or body.thick_branches_4 then
     n = n + 1
     positions[n] = pos
     nTBranches = nTBranches + 1
     positionsTBranches[nTBranches] = pos
    end
   end
  end
 end
 return positions,positionsTrunk,positionsTBranches,positionsBranches,positionsTwigs
end
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5001 on: December 09, 2016, 03:54:20 pm »

Shouldn't it be "local z2 = tree.pos.z + tree.tree_info.body_height - 1"?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5003 on: December 09, 2016, 04:34:39 pm »

Shouldn't it be "local z2 = tree.pos.z + tree.tree_info.body_height - 1"?

Possibly, but it would actually need to be -4 for the tree I tested on (actual height of 6)

Have you seen thick_branches_* being actually set?

I have not checked, I just use all the positions in my tree removal script so I've never actually gone through the individual tiles. Just figured I should put them there  because they are there, but if they never show up I could just as easily remove them.
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5004 on: December 09, 2016, 04:51:03 pm »

If tree.tree_info.body_height isn't accurate then how does the game know where the tree stops? Is there a "last item" marker of some kind?
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

scourge728

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5005 on: December 09, 2016, 05:41:27 pm »

Sorry that I'm so bad at this but this ZIP has... quite a lot more files then the one that I had and frankly, I've got no idea what they do or what to do with them
Did you download a release archive for Windows or something else?

To be clear, under DFHack 0.43.05-alpha2, you want either "dfhack-0.43.05-alpha2-Windows-32.zip" or "dfhack-0.43.05-alpha2-Windows-64.zip".

thank you, I now have an updated version

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5006 on: December 09, 2016, 06:19:05 pm »

It seems the x, y, z figures for a tree are the bounding box rather than the current values.

You can figure out how tall a tree can be by checking the age and the time for it to grow another level. It's still possible for the tree to be stunted due to obstacles, though.

When I've fiddled with it it seems some trees have a null pointer for tree_info. When I iterated over all dry trees in my world and skipped those with a null pointer it completed (I had reduced z2 by one as well, though).
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5007 on: December 10, 2016, 03:48:11 pm »

For anyone who compiles DFHack on Linux/OS X:

Are there objections to removing support for GCC 4.5? The last couple builds have all used GCC 4.8 with no (reported) problems, and GCC 4.5 has incomplete C++11 support. Now that we're using MSVC 2015, which does have good C++11 support, GCC 4.5 is the only thing holding us back from nice C++11 things.

GCC 4.6 should still be supported, so I don't expect that this would cause a lot of problems on older systems, since most that come with GCC 4.5 as the default compiler have 4.6 available somewhere.

Edit: The minimum might be be pushed to 4.7 later. I think 4.6 will work for the features we're interested in now, though (range-based for, variadic templates, etc.)
« Last Edit: December 10, 2016, 04:00:21 pm by lethosor »
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.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5008 on: December 10, 2016, 06:55:44 pm »

I'm not even sure if the previous LTS ubuntu would still be stuck with GCC 4.5, and can't think of any reason an OS couldn't update to a newer version.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #5009 on: December 11, 2016, 12:21:37 am »

Eswald pointed out that DFHack actually requires 4.8+ on Linux (oops), so it looks like we'll be going with that.
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 ... 332 333 [334] 335 336 ... 360