Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 6 7 [8] 9 10 11

Author Topic: M.O.U.S.E Fortress - Old Thread, see New Thread  (Read 63097 times)

Shukaro

  • Bay Watcher
    • View Profile

Quick update, I'm writing a dll to call the proper offsets out of dfhack, but currently it doesn't have the offsets for the mouse coordinates. That means that I won't be able to make the cursorfollow function work until those are implemented.  :'( The good news is, it looks like Peterix wants to add those in, so they'll probably be available in the next release or two.  :D In the mean time, I'll be focusing on improving other aspects of the program.

Also, to profit: Sweet! That could help possibly with custom reactions, I'll have to see how DF handles those.
Logged
Urist McHauler Cancels Give Food: Patient Insane
------------------------------------------------------------------
Mouse Fortress | Custom Menu and Hotkey Framework
Dwarven Higher Learning Mod | Alternative Skill Training

Shukaro

  • Bay Watcher
    • View Profile

I've added in a failsafe system to prevent cursorfollow going crazy, and a tutorial to put your own offsets in as a temporary fix. The offsets need to be updated each time DF is opened, but it will let people see how cursorfollow works for now. Configuring the offsets isn't necessary though.
Logged
Urist McHauler Cancels Give Food: Patient Insane
------------------------------------------------------------------
Mouse Fortress | Custom Menu and Hotkey Framework
Dwarven Higher Learning Mod | Alternative Skill Training

s20dan

  • Bay Watcher
    • View Profile

Just back from holiday to be welcomed by some shitty english weather. But seeing that this mod is stil being worked on makes me happier hehe.
Logged

perpetual

  • Escaped Lunatic
    • View Profile

About a week after discovering the wonders of DF, the slow and fatiguing numpad navigation was getting to me. Your script has been a godsend, and I just wanted to add my input.

(cursor follow has been working like a charm with your instructions, by the way)

I still like using the keyboard commands for certain menus, and find it annoying using the right click menu to enter cursor follow mode.

Solution 1 - A hotkey in the script to toggle cursor following behaviour (or perhaps alternate calling cursor follow and back commands)
(If this isn't too complex would you mind just showing me the commands to do this)

Solution 2 - keep track of the current menu 'state' by tracking key presses, and use this to decide what type of cursor behaviour is needed (Probably either impossible or incredibly tedious and not worth it)

It would also be a nice addition to have the hardcoded hotkeys changed to variables at the top of the program file. I'd be willing to do this if it's a fairly simple task.

Thanks for your work at making DF more accessible to us non-ascii, non-keyboard softies.
Logged

Shukaro

  • Bay Watcher
    • View Profile

For the hotkey for cursorfollow, simply add

Code: [Select]
^f::
{
    if followback = 0
    {
        gosub back
        followback := 1
    }
    if followback = 1
    {
         Cursorfollow()
         followback := 0
    }
}

To the hotkey section, and add

Code: [Select]
followback := 1

Right under the line with needback = 1 (Just saw a typo there, it should be needback := 1)

That should alternate between cursorfollow and back admirably (with control-f).

As for the modifiable hotkeys, that's a great idea, I'll update the script with that, and possibly a keybinding gui.

Still working on deeper menu support, and it's shaping up very nicely so far.  :D
« Last Edit: August 27, 2010, 04:47:04 pm by Shukaro »
Logged
Urist McHauler Cancels Give Food: Patient Insane
------------------------------------------------------------------
Mouse Fortress | Custom Menu and Hotkey Framework
Dwarven Higher Learning Mod | Alternative Skill Training

Nabobalis

  • Bay Watcher
    • View Profile

Good work. So far I've used it a little and its really great.
Logged

perpetual

  • Escaped Lunatic
    • View Profile

I was playing around with cheat engine and noticed that manually changing the values of the cursor offset memory locations appears to work just as using the numpad keys. (i.e the screen scrolls when it gets close to the edge and so forth)

I was wondering if there was any reason you couldn't just continually write the mouse offset values to the cursor offset values instead of the sending numpad commands for cursor following.

I'm a very novice programmer, so apologies for my lack of knowledge.
Logged

Shukaro

  • Bay Watcher
    • View Profile

That would probably work (although you can't write the mouse values directly to the cursor offsets because the mouse coordinates are screen-relative and the cursor coordinates are world-relative, but you just apply the math that's already in place in the program to fix that). I'll be testing that out once I'm able to reliably retrieve coordinate offsets from DF, but be aware, writing to DF's memory might produce some Fun results.
Logged
Urist McHauler Cancels Give Food: Patient Insane
------------------------------------------------------------------
Mouse Fortress | Custom Menu and Hotkey Framework
Dwarven Higher Learning Mod | Alternative Skill Training

Z1000000m

  • Bay Watcher
    • View Profile

Why didn't i see this earlier :|

Anyway, thumbs up and keep the good stuff going.
Logged

Shukaro

  • Bay Watcher
    • View Profile

Thanks for the support! For those of you wondering when the next release will be, it is currently about 50% done, so it should be out in a few days.
Logged
Urist McHauler Cancels Give Food: Patient Insane
------------------------------------------------------------------
Mouse Fortress | Custom Menu and Hotkey Framework
Dwarven Higher Learning Mod | Alternative Skill Training

WormSlayer

  • Bay Watcher
    • View Profile
    • WormSlayer.com

I love it when a plan comes together :)-~
Logged

Shukaro

  • Bay Watcher
    • View Profile

Hehe, always found that cool. As for the update, providing I don't get mauled by giant cave spiders, it should be out tonight. Hopefully.
Logged
Urist McHauler Cancels Give Food: Patient Insane
------------------------------------------------------------------
Mouse Fortress | Custom Menu and Hotkey Framework
Dwarven Higher Learning Mod | Alternative Skill Training

profit

  • Bay Watcher
  • Finely Crafted Engravings... Or it didn't happen.
    • View Profile

someone asked me for a write memory function so I am going to drop it here as well..

I would highly recommend you pause DF before any writes occur though.

Code: [Select]
WriteMemory(WVALUE,MADDRESS,PROGRAM)
{
winget, pid, PID, %PROGRAM%

ProcessHandle := DllCall("OpenProcess", "int", 2035711, "char", 0, "UInt", PID, "UInt")
DllCall("WriteProcessMemory", "UInt", ProcessHandle, "UInt", MADDRESS, "Uint*", WVALUE, "Uint", 4, "Uint *", 0)

DllCall("CloseHandle", "int", ProcessHandle)
return
}
Logged
Mods and the best utilities for dwarf fortress
Community Mods and utilities thread.

Shukaro

  • Bay Watcher
    • View Profile

Ooh, that'll be a big help, once dfhack is updated and I update the utility to take advantage of that.

Curse you schoolwork, stop distracting me from what's truly important!
Logged
Urist McHauler Cancels Give Food: Patient Insane
------------------------------------------------------------------
Mouse Fortress | Custom Menu and Hotkey Framework
Dwarven Higher Learning Mod | Alternative Skill Training

s20dan

  • Bay Watcher
    • View Profile

Don't mean to badger, but did you have any luck Shukaro?
Logged
Pages: 1 ... 6 7 [8] 9 10 11