Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 51 52 [53] 54 55 ... 360

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

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #780 on: September 10, 2014, 10:16:09 am »

Thank you for answers and suggestion. I have no idea why it doesn't work for me, I even tried the steps you describe, starting with downloading df_40_11_win_s.zip. Could you please tell what "check" function of binpatch returns after successfully applying the patch?

When I apply the patch, like this
Code: [Select]
binpatch apply pressureplate_04011the prompt says that the patch was applied (if it doesn't find the file it clearly states in red that it can't find the patch). But when I check for changes like this
Code: [Select]
binpatch check pressureplate_04011it always says that the patch is removed, which means that no changes were actually made.

What worries me is if I deliberately put a wrong value in the patch file, like changing expected original value of 4B to 4A for example, then applying the patch also says that it was applied. Which means the function returned success even though it shouldn't/couldn't, instead it that example it should write something like "conflict at address" I think.

Luckily, I didn't delete that install yet.

[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: patch is removed
[DFHack]# binpatch apply pressureplate_04011
pressureplate_04011: applied the patch
[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: patch is applied
[DFHack]# binpatch remove pressureplate_04011
pressureplate_04011: removed the patch
[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: patch is removed
[DFHack]#


No errors.

Editing the original 4B to 4A:

[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: conflict at address db8310
[DFHack]#



Let's see... you apply the patch, no complaints, but check says it's removed.  Same thing when you deliberately corrupt the patch.

The file is being treated as garbage.

Lines in a patch file that don't have three hexnumbers, with a colon between the first and the second, are silently ignored.

And binpatch doesn't give a warning if no valid patch lines are found.

Check that the contents are exactly as you posted, and check that it's an ASCII text file instead of Unicode or word-processor formatted.  Open it in Notepad Wordpad, then Save-As and make sure the Encoding is ANSI or UTF-8.

Another thing I just noticed: you can't edit the patch file while Dwarf Fortress is still running.  You have to stop and restart DF every time.  (Or use an editor that can overwrite a locked file.)  That's due to a bug in binpatch.luaEDIT: I've reported the bug on the Github tracker.

So your tests may be invalid.

« Last Edit: September 10, 2014, 10:58:27 am by 0x517A5D »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.10-r1
« Reply #781 on: September 10, 2014, 10:27:44 am »

5. does not persist. Need to run each load (also just had an idea to extend this to run some code and check some prerequisites). No need for permissions (iirc)
6. removes native reactions. To be used for disabling hardcoded workshops or replacing (with 5.) their reactions
7. no. it needs a bit more tweaking after creation. I'm a bit rusty on this front... and still haven't finished "THE IMPLEMENTATION THAT WILL BE USED FOR EVERYTHING" of this (i.e. more stable, more features, other plugins could use it, etc...)
8. yes (i think) there is tame level, also there is civ id and a few flags (hopefully somebody has more info)

2. it's possible (have been doing that) but never with any intention of real use.
3. i'm pretty sure they don't have any effect on game
1 might be possible, but you'd have to be careful to catch worldgen fast enough and use a CoreSuspend object in C++.
Thanks for all the responses, two more slightly specific questions

9. If I have two scripts that enable the same eventful event type (e.g. events.enableEvent(events.eventType.UNIT_DEATH,100)) will both get run, or will one be overwritten/ignored?
10. Is there any way to make tile temperature changes more permanent? It seems like every time I change the tiles temperature (both temperature1 and temperature2) it just reverts back to the surrounding, even if I set temperature update to false.

EDIT: Heres another one just for expwnent;
11. The old LUA_HOOK system allowed us access to the items used in a reaction, have you given any thought to trying the same functionality in the new reaction-trigger system?

The one that registers the event to be checked more frequently is the one that counts.

There really isn't a way to make temperature updates permanent other than turning temperature off and reimplementing it yourself.

I would have to rejigger EventManager. It's on the list of things to do.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.10-r1
« Reply #782 on: September 10, 2014, 01:45:05 pm »

The one that registers the event to be checked more frequently is the one that counts.

There really isn't a way to make temperature updates permanent other than turning temperature off and reimplementing it yourself.

I would have to rejigger EventManager. It's on the list of things to do.

So if one is checked every 100 and another every 1000, the one that gets checked every 1000 will never be checked? Or will it instead be checked every 100?

That's too bad, at least it works some of the time.

And now for a new batch of questions!

12. In df.global.world.entities.all.x.resources there is a vector called 'discovered_creatures' is that a list of all the creatures an entity has encountered? And if so, is it updated as you play fortress mode? Meaning if a megabeast or semimegabeast attacks, or a sieger brings a new creature will they be added to that list? If that's not what that vector tracks, is there another vector that does track which animals a civilization has encountered?
13. What is the df.global.world.entities.all.x.training_knowledge.level vector telling me? It seems there is an entry for each creature, I am assuming 0 means your civ does not have access to them?
14. Is there an easy function (like dfhack.matinfo.find) for looking up creatures? For instance if I wanted to find the creature id for TOAD is there a dfhack.creatureinfo.find(TOAD,MALE) or something?
15. Similarily, is there some way to find the mat type and index of organic mats? matinfo.find works great for inorganics, but I can't say matinfo.find(TOAD:LEATHER) or matinfo.find(COTTON:FIBER) etc...

There are a couple others that I thought of when I was going through everything, but they escape me at the moment.
« Last Edit: September 10, 2014, 02:20:07 pm by Roses »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #783 on: September 10, 2014, 02:10:43 pm »

It will check all of them on the smallest check interval.

EDIT: You may just want to replace df.global.world.entities.all[\#].x there with df.historical_entity.x so that the syntax isn't so wonky

Anyway, as for 14: no, I think the fastest way would be a binary search in the alphabetic creatures vector using the NAME instead of the ID
15. matinfo.find does work for that, last I checked
« Last Edit: September 10, 2014, 02:13:43 pm by Putnam »
Logged

Saiko Kila

  • Bay Watcher
  • Dwarven alchemist
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #784 on: September 10, 2014, 03:07:26 pm »

[spoiler]Thank you for answers and suggestion. I have no idea why it doesn't work for me, I even tried the steps you describe, starting with downloading df_40_11_win_s.zip. Could you please tell what "check" function of binpatch returns after successfully applying the patch?

When I apply the patch, like this
Code: [Select]
binpatch apply pressureplate_04011the prompt says that the patch was applied (if it doesn't find the file it clearly states in red that it can't find the patch). But when I check for changes like this
Code: [Select]
binpatch check pressureplate_04011it always says that the patch is removed, which means that no changes were actually made.

What worries me is if I deliberately put a wrong value in the patch file, like changing expected original value of 4B to 4A for example, then applying the patch also says that it was applied. Which means the function returned success even though it shouldn't/couldn't, instead it that example it should write something like "conflict at address" I think.
/spoiler]
[

Luckily, I didn't delete that install yet.

[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: patch is removed
[DFHack]# binpatch apply pressureplate_04011
pressureplate_04011: applied the patch
[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: patch is applied
[DFHack]# binpatch remove pressureplate_04011
pressureplate_04011: removed the patch
[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: patch is removed
[DFHack]#


No errors.

Editing the original 4B to 4A:

[DFHack]# binpatch check pressureplate_04011
pressureplate_04011: conflict at address db8310
[DFHack]#



Let's see... you apply the patch, no complaints, but check says it's removed.  Same thing when you deliberately corrupt the patch.

The file is being treated as garbage.

Lines in a patch file that don't have three hexnumbers, with a colon between the first and the second, are silently ignored.

And binpatch doesn't give a warning if no valid patch lines are found.

Check that the contents are exactly as you posted, and check that it's an ASCII text file instead of Unicode or word-processor formatted.  Open it in Notepad Wordpad, then Save-As and make sure the Encoding is ANSI or UTF-8.

Thank you, that was it - it wasn't ANSI but Unicode BOM format, as reported by Notepad2. I normally use other editor, probably pressed some non-standard character accidentally and it changed the coding.

Quote
Another thing I just noticed: you can't edit the patch file while Dwarf Fortress is still running.  You have to stop and restart DF every time.  (Or use an editor that can overwrite a locked file.)  That's due to a bug in binpatch.luaEDIT: I've reported the bug on the Github tracker.

So your tests may be invalid.

Well, for most tests I used HxD, which bypasses lock protection, unless explicitly called in read only mode. It even doesn't inform me that the file is write-locked, just renames the old file as *.bak. So when I remove patch with binpatch I can edit the file on-fly, without restarts. Actually, I don't even have to exit the building menu, and can see the string changing when I press enter.

Other thing I can still edit (with any editor) is binpatch.lua from \hack\scripts itself (so I can edit some warnings for binpatch while in session) - I used it to test if binpatch.lua is really invoked every time, and not some copy in memory. The binpatch.lua from \hack\lua can be edited too, but this one is apparently loaded only when invoked for the first time since DFhack started. I suppose ability to edit scripts while DF runs is intended though.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.10-r1
« Reply #785 on: September 10, 2014, 03:44:38 pm »

I have a question about customizing the spawn script: How can you tell "what time it is" to set the spawned creature's birth time exactly?  In my case, the creature comes into being the moment the script is called (no backdated birthdays), so unit.relations.birth_year=df.global.cur_year gets the year right.  Is it unit.relations.birth_time=df.global.curr_year_ticks to set the birth time?  The historical figure data seems to want hf.born_seconds and I'm not sure how "ticks" relate to "seconds" here.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Euius

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #786 on: September 10, 2014, 05:15:32 pm »

Is there any way to resolve this alt key mis-registered as pressed problem?  I know why it happens, when alt-tabbing out of the game it's never receiving the keyup

The problem is that alt-tabbing out of the game is pretty much constant for me, which means everytime I enter text in a search list or similar, it becomes quite annoying.  Effectively, this means that two entire modifier keysets can't be used (Alt-x can't be used and Cntrl-Alt-x has to duplicate Cntrl-x)

For instance, I'd like to bind gui/unit-info-viewer to Alt-I, but that setup is absolutely unplayable due to this issue.
Logged

Nopenope

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #787 on: September 10, 2014, 05:31:23 pm »

You could use the F9 to F12 keys, as far as I know they're not taken by the game.

In other news, DFHack appears to build and run fine for .40.12, except for falconne's plugins (and hotkey hooks) who somehow don't initialize. Here's a "bleeding-edge" binary for GNU/Linux (with DF included): http://a.pomf.se/gzajej.tar.gz

Use at own risk, etc.
« Last Edit: September 11, 2014, 02:53:26 am by Nopenope »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.10-r1
« Reply #788 on: September 11, 2014, 08:36:41 am »

So if one is checked every 100 and another every 1000, the one that gets checked every 1000 will never be checked? Or will it instead be checked every 100?

It will check for events every 100 ticks. When that happens, all listeners will be notified, regardless of how often or rarely they requested EventManager to check for events.

As for the rest, I don't know.
Logged

Ovg

  • Bay Watcher
  • ♥ Pretty Princess ♥
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #789 on: September 11, 2014, 03:12:05 pm »

You could use the F9 to F12 keys, as far as I know they're not taken by the game.

F11 is full screen
F12 is true type
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #790 on: September 11, 2014, 03:20:10 pm »

Also, F10 resets the zoom level, and DFHack only supports F1-F9 in keybindings.
It might be possible to reset modifier keys when the window focus changes through DFHack, but it would require interposing additional SDL functions (and would only be necessary on Windows, and possibly some Linux distributions).
« Last Edit: September 11, 2014, 03:24:55 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.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #791 on: September 11, 2014, 05:09:27 pm »

It might be possible to reset modifier keys when the window focus changes through DFHack, but it would require interposing additional SDL functions (and would only be necessary on Windows, and possibly some Linux distributions).

That would definitely be worth doing if it's possible, since this is one of the most common problems new players have with dfhack.
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

salithus

  • Bay Watcher
  • gottagofast
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #792 on: September 11, 2014, 05:11:10 pm »

It might be possible to reset modifier keys when the window focus changes through DFHack, but it would require interposing additional SDL functions (and would only be necessary on Windows, and possibly some Linux distributions).

That would definitely be worth doing if it's possible, since this is one of the most common problems new players have with dfhack.
I just assumed I was doing something incompetent until it got brought up in this thread. D:
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #793 on: September 11, 2014, 05:47:29 pm »

It might be possible to reset modifier keys when the window focus changes through DFHack, but it would require interposing additional SDL functions (and would only be necessary on Windows, and possibly some Linux distributions).

That would definitely be worth doing if it's possible, since this is one of the most common problems new players have with dfhack.
Wait, is this only a DFHack-specific bug? I was under the impression that this occurs with any key combinations that use 'Alt' on Windows.
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.

LeoCean

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #794 on: September 11, 2014, 05:52:45 pm »

It's mainly a dfhack one, you can change keyboard language by pressing something a few times but that's about it. I believe you only need to press ALT again to get rid of the bug with dfhack so it isn't that big of a deal.
Logged
Pages: 1 ... 51 52 [53] 54 55 ... 360