Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 147 148 [149] 150 151 ... 244

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

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2220 on: March 15, 2020, 03:36:33 pm »

Yeah, map unloads happen a lot more frequently in adventure mode than fortress mode. What kinds of scripts are breaking specifically?
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.

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2221 on: March 15, 2020, 04:49:34 pm »

I took a look at what it does edit to see if any of it links to syndromes indirectly, and it looks like wounds are created for syndromes. What might be happening is that some syndrome effects reference either just the wound or both the wound and the syndrome, and deleting the wound breaks those effects. However, I tried a couple of tests and full heal only deleted those wounds for a single tick - they were back again in the wounds vector the next tick, and stuff like nausea was applied properly despite being momentarily removed by full-heal. I wouldn't be surprised if the recreation of syndrome related wounds and the correct reapplication of the associated effects wasn't universal, though.

If that is what is creating your problem, then the fix for full-heal would require skipping the deletion of wounds that have associated syndromes. This may potentially lead to undefined behavior when it comes to things like werecreature bites, however, since as far as I know wounds created by those would have both a syndrome and "conventional" wound info (or it might be fine, who knows).

This is correct; most of the effects of a syndrome are mediated through a special wound created upon infection (via the wound_curse_info data), and deleting this wound hence removes the pertinent syndrome effects. However, the persistence of the syndrome within unit.syndromes causes the generation of a new wound as soon as the game realises that this is missing. (Similarly, the early version of syndrome-utils consistently failed at properly removing syndromes as it deleted the syndrome data whilst leaving the wound untouched). The issue is rather easy to solve; just add an "if not wound.curse" check and clear any actual injury data instead of deleting the wound outright in that case. In addition, thorough syndrome removal could be implemented and made optional via a separate arg, possibly with the option of whitelisting certain syndromes to prevent their deletion (specified by syndrome name or class). Thoughts?

Afaik it was always that way. In the source (not eventful as it wraps (among other stuff) eventmanager module) here it's called more explicit: SC_MAP_UNLOADED.

Why is SC_MAP_UNLOADED used as opposed to SC_WORLD_UNLOADED? It seems to me that the latter would surely make more sense in the context of adventure mode, with no difference in fort mode functionality (I think).
« Last Edit: March 15, 2020, 04:54:56 pm by Atomic Chicken »
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. 

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2222 on: March 16, 2020, 01:00:59 am »

<...>
Afaik it was always that way. In the source (not eventful as it wraps (among other stuff) eventmanager module) here it's called more explicit: SC_MAP_UNLOADED.

Why is SC_MAP_UNLOADED used as opposed to SC_WORLD_UNLOADED? It seems to me that the latter would surely make more sense in the context of adventure mode, with no difference in fort mode functionality (I think).

Both have their uses. However most stuff is developed without adventure mode in mind. I.e. what scripts are braking? Why are they running in adventure mode in first place?

Also IIRC map unload might still have useful data not destroyed, while world unload would have more stuff unavailable (same applies to map vs world load).

thefriendlyhacker

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2223 on: March 16, 2020, 04:27:25 am »

<...>
Afaik it was always that way. In the source (not eventful as it wraps (among other stuff) eventmanager module) here it's called more explicit: SC_MAP_UNLOADED.

Why is SC_MAP_UNLOADED used as opposed to SC_WORLD_UNLOADED? It seems to me that the latter would surely make more sense in the context of adventure mode, with no difference in fort mode functionality (I think).

Both have their uses. However most stuff is developed without adventure mode in mind. I.e. what scripts are braking? Why are they running in adventure mode in first place?
...
modtools/item-trigger breaks, for starters. All the set item triggers get cleared on site offloading.

The scripts interaction-trigger, random-trigger, syndrome-trigger, projectile-trigger and outside-only (all modtools scripts) use the same style of clearing triggers using onUpload, and thus have the same problem.

modtools/reaction-trigger and modtools/reaction-product-trigger are exceptions solely because they currently do not support adventure mode at all. If support was added (AFAICT just handling reactions/jobs without associated buildings), then they would have the same problem.

modtools/invader-item-destroyer also has the same problem, but frankly I have no idea how adventure mode armies/invasions work so I can't say whether this even should be running at all in adventure mode. EDIT: I suppose the same goes for outside-only, should it even run in adv mode?

These are all the scripts that use onUpload, according to the github search I did. Every script that touches onUpload uses it as if it is synonymous with leaving a world, and as such every one of those scripts that could apply to adventure mode breaks as soon as a site is offloaded.

EDIT:
The issue is rather easy to solve; just add an "if not wound.curse" check and clear any actual injury data instead of deleting the wound outright in that case.
Would that play nicely with syndromes that do stuff on a body part by body part basis? Like, say, bruising or blistering whatever body parts the syndrome's material comes in contact with?
« Last Edit: March 16, 2020, 04:41:11 am by thefriendlyhacker »
Logged
Fallout Equestria Redux - that's right, it's back

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2224 on: March 19, 2020, 10:43:39 am »

<...>
Afaik it was always that way. In the source (not eventful as it wraps (among other stuff) eventmanager module) here it's called more explicit: SC_MAP_UNLOADED.

Why is SC_MAP_UNLOADED used as opposed to SC_WORLD_UNLOADED? It seems to me that the latter would surely make more sense in the context of adventure mode, with no difference in fort mode functionality (I think).

Both have their uses. However most stuff is developed without adventure mode in mind. I.e. what scripts are braking? Why are they running in adventure mode in first place?
...
modtools/item-trigger breaks, for starters. All the set item triggers get cleared on site offloading.

The scripts interaction-trigger, random-trigger, syndrome-trigger, projectile-trigger and outside-only (all modtools scripts) use the same style of clearing triggers using onUpload, and thus have the same problem.

modtools/reaction-trigger and modtools/reaction-product-trigger are exceptions solely because they currently do not support adventure mode at all. If support was added (AFAICT just handling reactions/jobs without associated buildings), then they would have the same problem.

modtools/invader-item-destroyer also has the same problem, but frankly I have no idea how adventure mode armies/invasions work so I can't say whether this even should be running at all in adventure mode. EDIT: I suppose the same goes for outside-only, should it even run in adv mode?

These are all the scripts that use onUpload, according to the github search I did. Every script that touches onUpload uses it as if it is synonymous with leaving a world, and as such every one of those scripts that could apply to adventure mode breaks as soon as a site is offloaded.
I believe all of those scripts were originally just made with fort mode in mind (Expwnent was the author for most of them IIRC). It probably would be a good idea to update them though so that they don't break in adventure mode

EDIT:
The issue is rather easy to solve; just add an "if not wound.curse" check and clear any actual injury data instead of deleting the wound outright in that case.
Would that play nicely with syndromes that do stuff on a body part by body part basis? Like, say, bruising or blistering whatever body parts the syndrome's material comes in contact with?
Sort of. Syndromes are notoriously tricky in their application and removal, although removal usually is easier. You will typically just get a single wound with a single syndrome, but for each instance of the syndrome you can get a different wound for a different body part. I'm not sure if syndrome-util handles all of that (I know it was previously not working for any syndromes that needed to function through wounds, both for application and removal), but you should be able to handle removal fairly easily with a lua script
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2225 on: March 21, 2020, 03:10:36 am »

then there's the historical figure syndromes and interactions that come back on reload of the map or a while if you use any heal script.
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

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2226 on: March 21, 2020, 05:54:30 am »

I cooked up a script to dampen the not quite regular loyalty cascade conflicts that seems to have become more common:
It seemed to work on two test cases, although I had to reapply the script when a character died (anyway?) in one case.
Spoiler (click to show/hide)
Logged

Lewa263

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2227 on: March 23, 2020, 03:48:13 pm »

Does anybody know of a nightly build with a working exportlegends command, that gives functional XML files for Legends Viewer? I had it working fine a little over a week ago, but all the more recent builds seem to be unable to generate the files correctly. I don't know which build it was that I got it to work on, so I guess I'm just hoping that somebody else still has a build where it works and can give me the number for it.
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2228 on: March 23, 2020, 03:58:58 pm »

Does anybody know of a nightly build with a working exportlegends command, that gives functional XML files for Legends Viewer? I had it working fine a little over a week ago, but all the more recent builds seem to be unable to generate the files correctly. I don't know which build it was that I got it to work on, so I guess I'm just hoping that somebody else still has a build where it works and can give me the number for it.
If you have problems, please report them. Nobody's going to fix problems unless they're reported or accidentally detected by someone who actually goes about fixing the issues.

Having said that, I made a pull request 12 hour ago or so for an updated version that fixes the things I encountered. Due to the way DF is organized, it won't appear in a "nightly build" until it's been approved and then "imported" into the main DFHack repository. However, it should be possible for you to get that version off of Github to see if it works for your problems. The good thing with scripts is that they don't need to be compiled, so you don't need the rest of the infrastructure. The bad thing with scripts is that they're not compiled, so there is no compiler available to flag things that don't compile (any longer).
Logged

Lewa263

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2229 on: March 23, 2020, 04:34:57 pm »

Does anybody know of a nightly build with a working exportlegends command, that gives functional XML files for Legends Viewer? I had it working fine a little over a week ago, but all the more recent builds seem to be unable to generate the files correctly. I don't know which build it was that I got it to work on, so I guess I'm just hoping that somebody else still has a build where it works and can give me the number for it.
If you have problems, please report them. Nobody's going to fix problems unless they're reported or accidentally detected by someone who actually goes about fixing the issues.

Having said that, I made a pull request 12 hour ago or so for an updated version that fixes the things I encountered. Due to the way DF is organized, it won't appear in a "nightly build" until it's been approved and then "imported" into the main DFHack repository. However, it should be possible for you to get that version off of Github to see if it works for your problems. The good thing with scripts is that they don't need to be compiled, so you don't need the rest of the infrastructure. The bad thing with scripts is that they're not compiled, so there is no compiler available to flag things that don't compile (any longer).

OK, I don't have much useful to give as a bug report because most of this stuff is beyond my understanding. But here's a screenshot of the error that I get with the current build 200322005: https://imgur.com/a/Z9cq8p4. Before I downloaded that one, the other nightly build that I had wouldn't give any errors in the DFHack window, but Legends Viewer would always say the file needed repair when it got down to the Events part. Allowing it to attempt a repair never accomplished anything, which was disappointing but not surprising. I have to assume the problem there was still on the DFHack side, because I didn't have that problem before I downloaded a newer build. I should probably stop doing that just because it's new and there are green checks on the nightly build site.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2230 on: March 24, 2020, 12:32:11 am »

Thanks - PatrikLundell fixed it here. The error was probably causing the script to leave behind a partial/truncated XML file, which isn't exactly easy to repair. Build 200324000 should work (when it's done, anyway); hopefully newer versions don't break again.
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.03-beta1
« Reply #2231 on: March 24, 2020, 01:46:08 am »

And, for your information Lewa263, what's in the screenshot is exactly what we'd need to understand the problem in most cases.
Logged

Silverwing235

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2232 on: March 24, 2020, 06:35:45 pm »

*ahem* I wonder if, perhaps, a codeblock would also suffice as a substitute?  Like so:
Code: [Select]
...ettlingrPack\df_47_04_win/hack/scripts/exportlegends.lua:228: Cannot read field abstract_building_templest.deity: not found.
stack traceback:
        [C]: in metamethod '__index'
        ...ettlingrPack\df_47_04_win/hack/scripts/exportlegends.lua:228: in global 'export_more_legends_xml'
        ...ettlingrPack\df_47_04_win/hack/scripts/exportlegends.lua:826: in global 'export_legends_info'
        ...ettlingrPack\df_47_04_win/hack/scripts/exportlegends.lua:879: in local 'script_code'
        ...\DF4704W64VettlingrPack\df_47_04_win\hack\lua\dfhack.lua:680: in function 'dfhack.run_script_with_env'
        (...tail calls...)
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2233 on: March 24, 2020, 07:13:21 pm »

*ahem* I wonder if, perhaps, a codeblock would also suffice as a substitute?  Like so:
Code: [Select]
...ettlingrPack\df_47_04_win/hack/scripts/exportlegends.lua:228: Cannot read field abstract_building_templest.deity: not found.
stack traceback:
        [C]: in metamethod '__index'
        ...ettlingrPack\df_47_04_win/hack/scripts/exportlegends.lua:228: in global 'export_more_legends_xml'
        ...ettlingrPack\df_47_04_win/hack/scripts/exportlegends.lua:826: in global 'export_legends_info'
        ...ettlingrPack\df_47_04_win/hack/scripts/exportlegends.lua:879: in local 'script_code'
        ...\DF4704W64VettlingrPack\df_47_04_win\hack\lua\dfhack.lua:680: in function 'dfhack.run_script_with_env'
        (...tail calls...)
Yes - in fact, text is usually better, in case we need to copy something from it. (It's a bit annoying to copy from the console on Windows - one way to do it is by right-clicking in the title bar, or maybe in the console too, depending on your Windows version.)
Also, is this a separate bug report? I'm not sure, but I'll double-check that part of the script to see if it's up-to-date.

Edit: your error appears to be related to something accessing the "deity" field, which the current version doesn't do - my advice (if you're experiencing the issue) is to try upgrading.
« Last Edit: March 24, 2020, 07:18:58 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.

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r3 | 0.47.03-beta1
« Reply #2234 on: March 25, 2020, 01:30:39 am »

Expanding on lethosor's response, the field(s) Silverwing235's version of the script tries to read is most likely one that changed its name during the last month or so, and the current version of the script (well, as of about 24 hours ago, which is the latest time I synchronized the data) actually does provide the contents of the deity_type field as well as the deity_data.Deity one. Thus, the current version of the script should handle it correctly.
Logged
Pages: 1 ... 147 148 [149] 150 151 ... 244