Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 151 152 [153] 154 155 ... 244

Author Topic: DFHack 50.14-r1.1  (Read 889080 times)

thurin

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2280 on: April 07, 2020, 09:20:55 am »

Is there a DFHack which supports DF 0.47.04 ? I got an error about an unknown DF version.

Yes, the info is in the first post.
Logged

LordBalkan

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2281 on: April 14, 2020, 07:48:12 am »

So, I'm having problems while using DFHack.
To be fair, the game runs normally and so far there was no crashes or that sort of things.
But there is this Error Flood on DFHack console that is annoying and I don't know how to fix.

Spoiler (click to show/hide)

I've tried with PyLNP and with a fresh new downloaded vanilla version+DFhack direct from GitHub.

As I said, its not preventing me to play but I would like to know how to fix this, if its possible of course.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2282 on: April 14, 2020, 01:03:16 pm »

From http://www.bay12forums.com/smf/index.php?topic=164123.msg8037202#msg8037202, that may have something to do with non-ASCII characters in the path to DF, so you could try addressing this by either renaming parts of the path to DF that have special characters in them or by moving DF somewhere else. We haven't figured out how to fix it yet. Are you using 64-bit DF? (I'm assuming it's at least on Windows, from the screenshot, but let me know if it's not.)
It should only prevent Ruby scripts from working in any case.

(For reference, you can copy text from the console on Windows by right-clicking in the console or in the title bar. That makes it possible for other people to search and find these posts more easily - a screenshot isn't searchable.)

Spoiler: text version (click to show/hide)
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.

LordBalkan

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2283 on: April 14, 2020, 01:33:32 pm »

(For reference, you can copy text from the console on Windows by right-clicking in the console or in the title bar. That makes it possible for other people to search and find these posts more easily - a screenshot isn't searchable.)
Oh me, oh my!! Sorry about that!

Here follows the code as was present in console itself:

Spoiler (click to show/hide)

About your sugestion on special characters and move the game to a different folder, yeah it totally works. I was using a "ã" letter to name the folder the game was in and when I renamed it the dfhack was back on trail.

Thanks for that!
Logged

Vorox

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2284 on: April 15, 2020, 09:47:51 am »

Does siege-engine work with ballistae or catapults only? Can I put ballistae on a tower above ground and have it shoot down into a target area?
Logged
Vorox likes gremlins for their tears.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2285 on: April 15, 2020, 06:20:21 pm »

Oh me, oh my!! Sorry about that!

Here follows the code as was present in console itself:

-snip-

About your sugestion on special characters and move the game to a different folder, yeah it totally works. I was using a "ã" letter to name the folder the game was in and when I renamed it the dfhack was back on trail.
No worries; I'd already copied the text from the earlier post above.

Unfortunately I was unable to reproduce this on Linux, so it seems to be a Windows-specific bug, probably either in Ruby's string handling or DFHack's filesystem layer. Someone else may need to tackle this.

Just to help us out, are you using 64-bit or 32-bit DF+DFHack? I think the Ruby versions bundled with those are different.

Does siege-engine work with ballistae or catapults only? Can I put ballistae on a tower above ground and have it shoot down into a target area?
It appears to work with a ballista in 0.47.04 for me (at least, gui/siege-engine recognizes and rotates the ballista properly; I didn't try actually firing anything).

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.

LordBalkan

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2286 on: April 15, 2020, 06:29:02 pm »

Just to help us out, are you using 64-bit or 32-bit DF+DFHack? I think the Ruby versions bundled with those are different.

I'm using a 64bit DF + DFHack.
Logged

Nilsolm

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2287 on: April 15, 2020, 06:40:04 pm »

I've managed to cobble together a script that lists all guildhall and temple petitions in fortress mode. I've tested it on a few saves I had strewn about on my hard drive and it seems to work reliably.

Spoiler: list-agreements.lua (click to show/hide)

It outputs all agreements in a list. It prints out the location tier (temple/temple complex or guildhall/grand guildhall, resp.), the profession in the case of guildhalls, the religion in the case of temples, and the date on which the agreement was made. It also shows whether the agreement was satisfied or denied. Here are some examples:

Spoiler: Example output (click to show/hide)

One thing I am not sure about is what happens if the petition is accepted but not satisfied in time. I haven't been able to test that.
Logged

Vorox

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2288 on: April 16, 2020, 04:44:07 am »

Thanks for answering my question.

Also, is tweak makeown supposed to work on invaders? Because I tried it, and it doesn't make them join me, just gives me "ownership for x clothes fixed". If the answer is no, then is there any script/plugin that can do this?
Logged
Vorox likes gremlins for their tears.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2289 on: April 16, 2020, 04:52:24 pm »

I've managed to cobble together a script that lists all guildhall and temple petitions in fortress mode. I've tested it on a few saves I had strewn about on my hard drive and it seems to work reliably.

Just a couple things I noticed that you might want to keep in mind for future development (not asking you to address them or anything):

Quote
Code: [Select]
function get_location_type(agr)
    loctype = agr.details[0].data.Location.type
    return loctype
end

function get_location_name(agr)
    if get_location_type(agr) == 2 and get_location_tier(agr) == 1 then
        return "temple"

...

    elseif get_location_type(agr) == 11 and get_location_tier(agr) == 2 then
        return "grand guildhall"
    end

You should generally use named enum values instead of magic numbers (1, 2, 11, etc). In this case, I had to look in df.entities.xml to find the definition of the agreement_details_data_location type. The "type" field's type is abstract_building_type, so in Lua, 2 = df.abstract_building_type.TEMPLE and 11 = df.abstract_building_type.GUILDHALL. gui/gm-editor will also show a human-friendly list if you can navigate to this structure in it.

tier doesn't correspond to an enum, though - it's different for each abstract_building_type value, as you've found.


Quote
Code: [Select]
function is_satisfied(agr)
    satisfied = agr.anon_3.convicted_accepted
    return satisfied
end

function is_denied(agr)
    denied = agr.anon_3.petition_not_accepted
    return denied
end

You should generally avoid using anon names, because they're generated (for fields that don't have a "name=" attribute in the XML files at all) and not stable (any changes to whether nearby fields have names affect the number after "anon_" for other fields). I realize this isn't particularly helpful when you need that field, so the best practice is generally to make a pull request in df-structures or suggest a name for the field some other way.

In this case, anon_3 should probably be named "flags" for convention, so I'll tackle that. (If you're curious, it was identified as a bitfield here and flags were identified here, but the bitfield itself never got named.)

Quote
Code: [Select]
for agr, _ in pairs(allagreements) do
    if allagreements[agr].details[0].data.Location.site == playerfortid then
        if get_location_type(allagreements[agr]) == 2 then
            table.insert(templeagreementids, agr)
        elseif get_location_type(allagreements[agr]) == 11 then
            table.insert(guildhallagreementids, agr)
        end
    end
end

The second thing returned by pairs is the item itself, so you could rewrite the loop as "for _, agr in pairs(...)" and then just use "agr" everywhere you're using "allagreements[agr]". The only place I see you using the index by itself is in table.insert() - the agreements you're getting are just pointers, so there isn't really any more overhead in storing the agreements themselves in the tables instead of storing their indices.
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.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2290 on: April 16, 2020, 05:30:26 pm »

Adding to lethosor's comments: gui/gm-editor doesn't just provide the names of enums, but it does also provide the names of the types the enums belong to. I find it very much easier to use that to find the exact name of types rather than guessing at which XML files they might be defined in.
Logged

Nilsolm

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2291 on: April 16, 2020, 06:17:44 pm »

Alright, thanks for the suggestions! I see if I can improve the script a bit over the weekend.
Logged

Iä! RIAKTOR!

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2292 on: April 18, 2020, 05:16:35 am »

I report about some bugs in beta1. When I play testing fort, I spawn two harpies. They was asexual, so I try to change their orientation to "marry females", but multiple using of script has no effect - in DT harpies still was asexual, also not work current orientation showing by command. I try catsplosion to harpies without marring, but this cause crash. What go wrong? For elven visitors and spawned trolls catsplosion work normal, babies from it has no fathers. 
Logged

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2293 on: April 18, 2020, 06:58:35 am »

I report about some bugs in beta1. When I play testing fort, I spawn two harpies. They was asexual, so I try to change their orientation to "marry females", but multiple using of script has no effect - in DT harpies still was asexual, also not work current orientation showing by command. I try catsplosion to harpies without marring, but this cause crash. What go wrong? For elven visitors and spawned trolls catsplosion work normal, babies from it has no fathers.

Providing the exact script commands used would be beneficial.

I suspect that the orientation problem is due to harpies being a female-only species. Units created using modtools/create-unit have their orientation set by the game, so if this isn't happening for female-only creatures it's likely a bug in the game itself, not DFHack.

I successfully set the "marry female" orientation of a spawned harpy via "set-orientation -female 2" with the target unit selected.

The catsplosion crash appears to be due to following on line 81:
Code: [Select]
female.pregnancy_caste = 1The script for some reason assumes that a caste ID of 1 is valid for all creatures instead of checking for it. Harpies only have one caste with an ID of 0. On testing, changing the value from 1 to 0 before running this on a harpy allowed it to give birth without crashing the game.
Logged
As mentioned in the previous turn, the most exciting field of battle this year will be in the Arstotzkan capitol, with plenty of close-quarter fighting and siege warfare.  Arstotzka, accordingly, spent their design phase developing a high-altitude tactical bomber. 

Iä! RIAKTOR!

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.04-beta1
« Reply #2294 on: April 18, 2020, 12:12:42 pm »

I report about some bugs in beta1. When I play testing fort, I spawn two harpies. They was asexual, so I try to change their orientation to "marry females", but multiple using of script has no effect - in DT harpies still was asexual, also not work current orientation showing by command. I try catsplosion to harpies without marring, but this cause crash. What go wrong? For elven visitors and spawned trolls catsplosion work normal, babies from it has no fathers.

Providing the exact script commands used would be beneficial.

I suspect that the orientation problem is due to harpies being a female-only species. Units created using modtools/create-unit have their orientation set by the game, so if this isn't happening for female-only creatures it's likely a bug in the game itself, not DFHack.

I successfully set the "marry female" orientation of a spawned harpy via "set-orientation -female 2" with the target unit selected.

The catsplosion crash appears to be due to following on line 81:
Code: [Select]
female.pregnancy_caste = 1The script for some reason assumes that a caste ID of 1 is valid for all creatures instead of checking for it. Harpies only have one caste with an ID of 0. On testing, changing the value from 1 to 0 before running this on a harpy allowed it to give birth without crashing the game.
Thanks! Now catsplosion works fine. Maybe, harpy orientation bug needs some RAW solving.
Logged
Pages: 1 ... 151 152 [153] 154 155 ... 244