Bay 12 Games Forum

Please login or register.

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

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

Shukaro

  • Bay Watcher
    • View Profile

What the cursor xyz offset is, is the Cursor's X position, add 4 (hex) to it to get the Y, and (probably) do it again to get the Z.

Now all I need to do I figure out how to use the DFHack library to get the offsets every time the script is loaded. Too bad there isn't much documentation of DFHack.
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

That is actually what I tried, but it didnt seem to work.

EG my cursorxyz address is 0x14a62d8
So I did the folowing:

   CursorX := ReadMemory(0x14a62d8,"Dwarf Fortress")
   CursorY := ReadMemory(0x14a62dc,"Dwarf Fortress")

 Which didnt seem to do much so I tried it in the mouse entry:

   MouseX := ReadMemory(0x14a62d8,"Dwarf Fortress")
   MouseY := ReadMemory(0x14a62dc,"Dwarf Fortress")

This caused the cursor to head bottom right instead of top left.

 I also tried adding in window x and window y along with that, but it didn't seem to change anything. :(
Logged

Shukaro

  • Bay Watcher
    • View Profile

Right now, dfhack won't find the mouse tile XY offsets, so you'd have to get those manually. I suggest using something like Cheat Engine for that. The origin (0/0) for those coordinate is the top leftmost tile on the DF screen. If the cursor XY, the mouse XY and the window XY are all correct, it will work. Right now, I think I'm going to dllcall the offsets out of dfhack.dll every time cursorfollow or another function that uses the offsets is called.
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

Cant you take the mouse_x and mouse_y from the OS instead of DF but still take Cursor_x and Cursor_y from DF?

 And have something like :  If mouse_x > Cursor_x
                                                    Cursor_x = Cursor_x + 1

 Just a thought... maybe you can't do that I dunno....
Logged

Shukaro

  • Bay Watcher
    • View Profile

Yeah, you can take Mouse X/Y from the system, but that will be in pixels. DF stores the coordinates in tiles, which is very useful, as I care more about what tile the mouse is on than where it is physically.
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

Did you have any luck with your idea Shukaro? : Dllcall from DFHack.dll
Logged

ra2phoenix

  • Bay Watcher
    • View Profile

I tried using the different modes (inspect, unit status, etc) and the cursor ran away to the top left of the map.  I'll keep using MOUSE just for the scroll wheel z-level though, that's awesome considering that the graphics zoom gives me flickering edges and isn't worth bothering with.  Even that feature alone is much more convenient than spamming >>>>><<<<< all the time.

Also when I try to click and hold to move a designating cursor, it seems to measure from the center of the screen, not where the mouse is clicking on the map.  I expect the desired behavior is the cursor moves to the mouse position and stops? (it's also very slow)
Logged

s20dan

  • Bay Watcher
    • View Profile

I tried using the different modes (inspect, unit status, etc) and the cursor ran away to the top left of the map.  ...

 With any luck this will be fixed soon. But if your impatient, just read Shukaro's posts above and on the previous page on how to fix it.

.....that's awesome considering that the graphics zoom gives me flickering edges and isn't worth bothering with. .....

 Press F11 twice and the flickering stops. Or change to a different display mode.
« Last Edit: August 08, 2010, 12:55:43 pm by s20dan »
Logged

Shukaro

  • Bay Watcher
    • View Profile

The next update is coming along, it just seems that I have to learn a bit of C++ first. Although, more testing still has to be done, and I'm going to be severely short on time this week.  :'(

Just hope I can sort this out quickly, so I can work on other features.

I would appreciate any advice or help you might be able to offer. If you'd like.
« Last Edit: August 08, 2010, 06:32: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

Askot Bokbondeler

  • Bay Watcher
  • please line up orderly
    • View Profile

subscribing

ghostxxx

  • Bay Watcher
  • and my Axe!
    • View Profile

Hey what are some of the features you're working on?
Logged

WormSlayer

  • Bay Watcher
    • View Profile
    • WormSlayer.com

This is an exceptionally designed interface by Shukaro.
 On the item is an image of Shukaro and Dwarves. Shukaro is surrounded by the dwarves, the dwarves are cheering. The artwork relates to the creation of the new interface.
 On the item is an image of a Dwarf and a mouse, the dwarf is hugging the mouse.
 On the item is an image of a dwarf and a keyboard, the keyboard is making a plaintative gesture, the dwarf is laughing.

This.

But I hope you fix it soon :D
Logged

Shukaro

  • Bay Watcher
    • View Profile

Yeah, sorry about the hiatus guys. I've had all-day band camp for the past few weeks, so I haven't had much of a chance to do much in the way of coding. But, that's over, so I'll try to get back to a steady stream of updates.

As for the features I'm working on. Right now it's fixing up cursorfollow and adding support for the various menus in the game, as well as more gui cues (like tooltips).
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

Hey there, I was not able to get a decent memory location finder sadly =/  However I did make you a new function.   This one is for pulling strings from memory... I don't know if you will have any use for it but here it is *it chokes on nulls which irks me*.

Use it like the other ones except add how many characters you want to retrieve.  IE:

MemoryBlock:=ReadMemoryBlock(%MemAdress%,"Dwarf Fortress",16)

Code: [Select]
ReadMemoryBlock(MADDRESS,PROGRAM,BLOCKSIZE)
{
winget, pid, PID, %PROGRAM%
VarSetCapacity(MVALUE,BLOCKSIZE,0)
ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",BLOCKSIZE,"UInt *",0)
return, MVALUE 
}


I will see about converting nulls to spaces maybe but I don't know what is going to be possible.

I was trying to use it to find memory locations which are relative to the mouse coordinate variables but sadly no dice yet.
« Last Edit: August 21, 2010, 03:18:01 am by profit »
Logged
Mods and the best utilities for dwarf fortress
Community Mods and utilities thread.

Gatallorsith

  • Bay Watcher
    • View Profile

Thumbs up for the project  ;)

I've just tried it and got the crazy-cursor issue, but a look at all the menus was enough to make me happy ^^

If possible, I'd like to leave the mouse wheel with the zooming function (and maybe with menu scrolling, later, when over a menu), and maybe in the future use the central button (click) to move the map (as in starcraft 2 and other rts). That would be all I need. :)
Logged
Pages: 1 ... 5 6 [7] 8 9 ... 11