Bay 12 Games Forum

Please login or register.

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

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

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #795 on: September 11, 2014, 06:22:45 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.

It's not strictly limited to DFHack, but almost all cases I see are people confused when, for example, trying to make a job repeat brings up the rooms menu.  Between the Starter Pack and all the people who use dfhack, a fix would be widely appreciated - even if it's not always dfhack causing the problem!
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

breadman

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #796 on: September 11, 2014, 11:14:08 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).

It might even be possible through the existing Core::DFH_SDL_Event().

Code: [Select]
diff --git a/library/Core.cpp b/library/Core.cpp
index 0196413..fc63fc1 100644
--- a/library/Core.cpp
+++ b/library/Core.cpp
@@ -1605,6 +1605,15 @@ int Core::DFH_SDL_Event(SDL::Event* ev)
             hotkey_states[ke->ksym.sym] = false;
         }
     }
+    else if (ev->type == SDL::ET_ACTIVEEVENT && ev->active.state == 2)
+    {
+        // There's probably a good enum or macro for that state value somewhere.
+        // Basically, state == 1 means mouse moved in or out of the window,
+        // state == 2 means the window gained or lost focus.
+        // At least on Linux, anyway...
+        fprintf(stderr, "Window Focus Event.\n");
+        fflush(stderr);
+    }
     return true;
     // do stuff with the events...
 }

Unfortunately, I don't know how to reset the modifier keys once I get to that point, though it looks like modState in g_src/enabler_input.cpp just needs to be cleared.  (Can we get away with calling enabler_inputst::clear_input() somehow?)  The worst part is that I can't reproduce the problem on my Linux system, and can't currently compile for Windows, so I can't test any possible solution myself.

If we're lucky, the result will basically be a no-op on the unaffected operating systems.
Logged
Quote from: Kevin Wayne, in r.g.r.n
Is a "diety" the being pictured by one of those extremely skinny aboriginal statues?

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: DFHack 0.40.11-r1
« Reply #797 on: September 12, 2014, 04:32:10 am »

what's the correct, most accurate way of getting a unit's body size? is it from body_size_info.size_cur, or size_base, or is it necessary to calculate it by taking the caste's average size and applying appearance modifiers?

another method i've seen was in unit-info-viewer where it appears to report strength:agility as the size?

gunpowdertea

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #798 on: September 12, 2014, 06:00:33 am »

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.

It's not strictly limited to DFHack, but almost all cases I see are people confused when, for example, trying to make a job repeat brings up the rooms menu.  Between the Starter Pack and all the people who use dfhack, a fix would be widely appreciated - even if it's not always dfhack causing the problem!

It counts (under linux, with some terminals) as an intended behaviour. It is all a matter of which keys are caught by which program first. Ticks me off, many utilities designed for terminals have hotkeys F1 or F10 in use, that get caught by (I believe) e.g. gnome-terminal (probably gnome, which passes it on to gnome-terminal, which then brings up some config menu or help or somesuch). This is not a dfhack bug (unless you would count "using keys that the OS is likely to catch and not pass down to the program" as a bug).
Logged
I don't care. I have discovered that if you spawn elves this way, cats will chase them down and eat them.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #799 on: September 12, 2014, 06:25:33 am »

It counts (under linux, with some terminals) as an intended behaviour. It is all a matter of which keys are caught by which program first. Ticks me off, many utilities designed for terminals have hotkeys F1 or F10 in use, that get caught by (I believe) e.g. gnome-terminal (probably gnome, which passes it on to gnome-terminal, which then brings up some config menu or help or somesuch). This is not a dfhack bug (unless you would count "using keys that the OS is likely to catch and not pass down to the program" as a bug).

We're not talking about Fx keys or the dfhack terminal window (or at least I'm not).  I'm referring to the vanilla DF bug which has been traced to an old version of the SDL library, where if you alt-tab away the game thinks alt is still held when it comes back into focus.  Which results in pressing "r" being interpreted as "alt-r", which brings up something confusing and unexpected. 

In short, fixing this bug, since dfhack arguably makes it worse. 
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

GenericOverusedName

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #800 on: September 12, 2014, 09:42:40 am »

Do we have the memory layouts for .12 yet?
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #801 on: September 12, 2014, 09:51:25 am »

Do we have the memory layouts for .12 yet?
Zohan just posted this under General Discussion.  Not sure if this is a big or small fraction of the layouts needed for DFHack, but it's a start.
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

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #802 on: September 12, 2014, 02:08:50 pm »

Do we have the memory layouts for .12 yet?
Yes: https://github.com/dfhack/df-structures. In fact, DT offsets are often generated from df-structures. Official DFHack releases simply take longer to put together.
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.

tase

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #803 on: September 12, 2014, 08:03:04 pm »

Still no Windows symbols for 40.12 ?
« Last Edit: September 12, 2014, 08:05:34 pm by tase »
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.40.11-r1
« Reply #804 on: September 12, 2014, 09:27:47 pm »

Still no Windows symbols for 40.12 ?
Last I checked, df-structures has all of them...
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

salithus

  • Bay Watcher
  • gottagofast
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #805 on: September 12, 2014, 09:31:28 pm »

Still no Windows symbols for 40.12 ?
Last I checked, df-structures has all of them...
The \windows folder says the last change was 9 days ago, vs \linux and \osx being 2 days ago and saying "Update version to v0.40.12".

Note: I have no idea what that means.
Logged

salithus

  • Bay Watcher
  • gottagofast
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #806 on: September 12, 2014, 09:49:34 pm »

Compiling DFHack for Windows is actually really easy if explained, and it doesn't require a zillion programs, just four.

You need:
CMake
Git - I prefer Github or mysysgit for these purposes (simple command line stuff).
Perl - Strawberry Perl is simplest
Visual Studio 2010 Express for C#
  • Install all four of the above programs.
  • Hold down Shift and right-click in an empty space on your desktop. Select "Open command window here".
  • Type "git clone -b develop git://github.com/dfhack/dfhack.git" and hit Enter. (Remove the "-b develop" part if you don't want the development branch version, but you usually will.)
  • Type "cd dfhack" and hit Enter.
  • Type "git submodule init" and hit Enter.
  • Type "git submodule update" and hit Enter.
  • Close the command prompt and open the DFHack folder you just made and then open the Build folder inside of that.
  • Double-click on 'generate-MSVC-gui.bat'.
  • In the window that pops up, uncheck the box that says "DL_RUBY", then click Configure, and lastly click Generate.
  • Close that window and enter the new VC2010 directory that was created and double-click on dfhack.sln.
  • Open the "Solution Explorer" tab to the right, scroll down to "PACKAGE", and then right-click on it and hit "Build".
  • When it eventually finishes running, open the new folder "_CPack_Packages", then the folder "win32", then the folder "ZIP", and you will have your very own zipped-up DFHack build.
also I just tried this and it worked, but no idea how I'd make it even try to generate something for 40.12 ("96>  CPack: - package: C:/Users/salithus/Desktop/dfhack/build/VC2010/dfhack-0.40.11-r1-Windows.zip generated.")

E: figured it out - dunno if it matters but symbols.xml on github shows "<symbol-table name='v0.40.11 SDL' os-type='windows'>", but I replaced the file the above generated with the github one and it fired up just fine on .40.12
« Last Edit: September 12, 2014, 10:03:59 pm by salithus »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #807 on: September 12, 2014, 10:03:06 pm »

Still no Windows symbols for 40.12 ?
Last I checked, df-structures has all of them...
The \windows folder says the last change was 9 days ago, vs \linux and \osx being 2 days ago and saying "Update version to v0.40.12".

Note: I have no idea what that means.
Those folders only contain generated files (e.g. DT layouts and CSV files). The changes in the rest of the repo include globals for all platforms (see symbols.xml).
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.

salithus

  • Bay Watcher
  • gottagofast
    • View Profile
Re: DFHack 0.40.11-r1
« Reply #808 on: September 12, 2014, 10:04:27 pm »

Still no Windows symbols for 40.12 ?
Last I checked, df-structures has all of them...
The \windows folder says the last change was 9 days ago, vs \linux and \osx being 2 days ago and saying "Update version to v0.40.12".

Note: I have no idea what that means.
Those folders only contain generated files (e.g. DT layouts and CSV files). The changes in the rest of the repo include globals for all platforms (see symbols.xml).
yeah - what confused me is that it still says .40.11 in it
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.08-r2
« Reply #809 on: September 12, 2014, 10:09:46 pm »

Compiling DFHack for Windows is actually really easy if explained, and it doesn't require a zillion programs, just four.

You need:
CMake
Git - I prefer Github or mysysgit for these purposes (simple command line stuff).
Perl - Strawberry Perl is simplest
Visual Studio 2010 Express for C#
  • Install all four of the above programs.
  • Hold down Shift and right-click in an empty space on your desktop. Select "Open command window here".
  • Type "git clone -b develop git://github.com/dfhack/dfhack.git" and hit Enter. (Remove the "-b develop" part if you don't want the development branch version, but you usually will.)
  • Type "cd dfhack" and hit Enter.
  • Type "git submodule init" and hit Enter.
  • Type "git submodule update" and hit Enter.
  • Close the command prompt and open the DFHack folder you just made and then open the Build folder inside of that.
  • Double-click on 'generate-MSVC-gui.bat'.
  • In the window that pops up, uncheck the box that says "DL_RUBY", then click Configure, and lastly click Generate.
  • Close that window and enter the new VC2010 directory that was created and double-click on dfhack.sln.
  • Open the "Solution Explorer" tab to the right, scroll down to "PACKAGE", and then right-click on it and hit "Build".
  • When it eventually finishes running, open the new folder "_CPack_Packages", then the folder "win32", then the folder "ZIP", and you will have your very own zipped-up DFHack build.
also I just tried this and it worked, but no idea how I'd make it even try to generate something for 40.12 ("96>  CPack: - package: C:/Users/salithus/Desktop/dfhack/build/VC2010/dfhack-0.40.11-r1-Windows.zip generated.")

E: figured it out - dunno if it matters but symbols.xml on github shows "<symbol-table name='v0.40.11 SDL' os-type='windows'>", but I replaced the file the above generated with the github one and it fired up just fine on .40.12
The develop branch of DFHack/dfhack still points to the df-structures commit used in 0.40.11-r1. If you want to use the latest df-structures commit, you'll have to run the following commands in <DFHack directory>/library/xml before building:
Code: [Select]
git fetch origin
git checkout origin/master
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 ... 52 53 [54] 55 56 ... 360