Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 199 200 [201] 202 203 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1457522 times)

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3000 on: February 11, 2013, 01:27:05 am »

No idea, but it has a bunch of numbers (hist fig ids for units the player has talked to?) if the unit is an adventurer and nothing at all if unit is not an adventurer.

This function successfully found my adventurer:

Code: [Select]
function find_adventurer()
for _uid,unit in ipairs(df.global.world.units.all) do
if #unit.adventurer_knows~=0 then return unit end
end
end

player = find_adventurer()
better way to find adventurer:
Code: [Select]
-- some code to check if advmode here --
return df.global.world.units.active[0]
:)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3001 on: February 11, 2013, 01:30:27 am »

Haha, much simpler!

EDIT: Is there a way to check if a tile is a wall or similarly non-walkable terrain?
« Last Edit: February 11, 2013, 02:01:02 am by Putnam »
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3002 on: February 11, 2013, 02:20:06 am »

Haha, much simpler!

EDIT: Is there a way to check if a tile is a wall or similarly non-walkable terrain?
There is no sure way to tell without in depth analysis of surounding area (due to ramps) but there was:
Code: [Select]
local ttype=dfhack.maps.getTileType(coords)
local tileshape=df.tiletype.attrs[ttype].shape
return  df.tiletype_shape.attrs[tileshape]
you can see more info about this here:
https://github.com/angavrilov/df-structures/blob/master/df.tile-types.xml#L11
PS i'm not sure if that code snippet works, can't test it here.
« Last Edit: February 11, 2013, 02:29:03 am by Warmist »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3003 on: February 11, 2013, 07:00:53 pm »

getTileType() apparently doesn't exist.

snooptodd

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3004 on: February 12, 2013, 07:38:54 am »

Hello! I cannot run DFhack. I have installed it as the directions say, but every time I run DF, I get the message "Main index file missing/corrupted. The file "index" must be in the data folder. Make sure DF compressed into its folders properly". The problem is, it only does this when DFhack is installed. Index is in the data folder, and it is not corrupted.
I don't know anybody who can read minds. There is not enough info in this post to help you.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3005 on: February 12, 2013, 09:00:33 am »

getTileType() apparently doesn't exist.
hmm it will soon exist :)
you could use "dfhack.maps.getTileBlock(coords)" and then a tile type lookup from it with modulo 16.

Dragoon209

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3006 on: February 12, 2013, 09:28:18 am »

To whoever is adding the additional notes and pictures to the Readme: THANK YOU!

My only gripe with DF Hack has been the documentation, which looks like its getting a nice update.  Thanks to all involved for making such an amazing tool!
Logged
Check out my mini-mods:
Upgradable Leather Tiers
Block Crafting Workshop

Have you played Webfort yet?  It's a way to play Dwarf Fortress in a web browser with your friends!  Come check it out at:
Community Web Fortress

peterix

  • Bay Watcher
    • View Profile
    • Dethware
Re: DFHack 0.34.11 r2
« Reply #3007 on: February 13, 2013, 12:42:50 pm »

I've moved the downloads to a different server because github is nuking its downloads section: http://dethware.org/dfhack/download/

If you link to the old download place somewhere, please fix your links.

IRIS_EYE_AZURE

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3008 on: February 13, 2013, 03:19:47 pm »

Can someone help explain autoSyndrome to me?

I've been playing around with it, and it appears to be very limited in functionality. When the job complete event is called, the unit reference has already been removed from the job.

The lua eventful interface adds in the unit and building references, in addition to the job itself. I'm not sure why the cpp event isn't implemented in the same way.

Edit: I'm referring to a a built copy of the latest git files at https://github.com/peterix/dfhack
« Last Edit: February 13, 2013, 05:28:48 pm by IRIS_EYE_AZURE »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3009 on: February 13, 2013, 09:39:22 pm »

Give the syndrome the "\LOCATION" or "\UNIT_ID" synclass and it should give you more or less what you want.

https://github.com/peterix/dfhack/blob/master/plugins/autoSyndrome.cpp#L357
Logged

kragnoth

  • Bay Watcher
  • !!noble!! is the most noble of all.
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3010 on: February 14, 2013, 11:33:19 am »

Is there an adventure mode command to change current units stats and skills?  (built in command that I can't find, or am misusing, not a lua script I could create)

If not, I'll look into the scripting.  Thanks
Logged

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3011 on: February 14, 2013, 12:04:17 pm »

Is there an adventure mode command to change current units stats and skills?  (built in command that I can't find, or am misusing, not a lua script I could create)

If not, I'll look into the scripting.  Thanks
my 'armoks_blessing' script works in adventure mode.  Just tested it with DF34.11 & DFHack34.11r2
You could likely adjust that to your needs.

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3012 on: February 15, 2013, 09:56:33 am »

Recently, I looked through the readme and GitHub for a way to cancel a dwarf party. About all I found was siren.lua. But that's not exactly what I was looking for:
Quote
Wakes up sleeping units, cancels breaks and stops parties either everywhere, or in the burrows given as arguments. In return, adds bad thoughts about noise, tiredness and lack of protection. Also, the units with interrupted breaks will go on break again a lot sooner...

Looking at the code, this is the part used to stop parties:
Code: [Select]
-- Stop parties
for _,v in ipairs(df.global.ui.parties) do
    local pos = utils.getBuildingCenter(v.location)
    if is_in_burrows(pos) then
        v.timer = 0
        for _, u in ipairs(v.units) do
            add_thought(unit, df.unit_thought_type.Tired)
        end
    end
end

If all I wanted to do was to stop a party without causing a negative thought and without the option to specify a burrow, could I simplify it down to this?
Code: [Select]
-- Stop parties
for _,v in ipairs(df.global.ui.parties) do
    v.timer = 0
end
The above would work as long as I included the "local utils = require 'utils'" line above it, correct? That's all I would need?
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3013 on: February 15, 2013, 11:34:39 am »

Code: [Select]
-- Stop parties
for _,v in ipairs(df.global.ui.parties) do
    v.timer = 0
end
The above would work as long as I included the "local utils = require 'utils'" line above it, correct? That's all I would need?
That is right, and you don't need the "local utils = require 'utils'" line.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3014 on: February 15, 2013, 06:37:40 pm »

I think you do, since the utils functions don't work when I try them.
Pages: 1 ... 199 200 [201] 202 203 ... 373