Malekitsu / Maw-Mod-MMMerge

Maw Mod code adapted for MMMerge
16 stars 4 forks source link

Exception originating from 'getSFTItem' function on Linux with Lutris/Steam #4

Closed Izowiuz closed 6 months ago

Izowiuz commented 8 months ago

Hello.

I'm trying to run this mod on Linux via Lutris and/or Steam and I'm getting a crash with stacktrace when staring the game:

`...G Games\Might and Magic 8\Scripts\General\zMaw-hooks.lua:8: array index (-71561118.266667) out of bounds [0, 23421]

stack traceback: [C]: in function 'error' C:\GOG Games\Might and Magic 8\Scripts/Core/RSMem.lua:1429: in function '__index' ...G Games\Might and Magic 8\Scripts\General\zMaw-hooks.lua:8: in function 'getSFTItem' ...G Games\Might and Magic 8\Scripts\General\zMaw-hooks.lua:14: in function 'f' C:\GOG Games\Might and Magic 8\Scripts/Core/RSMem.lua:2025: in function <C:\GOG Games\Might and Magic 8\Scripts/Core/RSMem.lua:2023> [C]: in function 'pcall' C:\GOG Games\Might and Magic 8\Scripts/Core/Common.lua:203: in function 'pcall2' C:\GOG Games\Might and Magic 8\Scripts/Core/RSMem.lua:1779: in function <C:\GOG Games\Might and Magic 8\Scripts/Core/RSMem.lua:1776>

arguments of 'getSFTItem': p = -7285000

local variables of 'getSFTItem': i = -71561118.266667 (temporary) = (table: 0x02dc6078) (temporary) = 1.2261390524573e-290`

Obvious solution of commenting out whole contents of zMaw-hooks.lua allows me to get in game. As I'm running MMMerge in not-so-common setup I would like to debug this issue on my own. Any pointers here would be welcome :]

Malekitsu commented 8 months ago

looks like it isn't in my capabilities to fix that. I'll be using that hooks shortly, I'll make sure to add a check in case someone deleted/commented that file!

Izowiuz commented 7 months ago

I will try to look at this closer, it's just that MMExtension modding is not my specialty : P How do we get memory addresses for hooks? For example from zMaw-hooks.lua file:

-- outdoor autohook2(0x47AC26, scaleHook()) autohook2(0x47AC46, scaleHook())

-- indoor autohook2(0x43D02E, scaleHook(true)) autohook2(0x43D04D, scaleHook(true))

Do we have some known memory addresses table which we can modify?

Eksekk commented 7 months ago

Does the crash always happen? Does it happen on Windows?

I can give you my database, but it's not very big, messy and for x64dbg. Grayface, cthscr or Rodril may or may not want to share their own if you ask them. Other than that, you might want to check first two files (lexicographically) in Structs folder, they contain "points of interest" in memory in mmextension structure definition format.

Malekitsu commented 7 months ago

were you able to solve?

olegrumiancev commented 6 months ago

The only way I found around that is to switch to software rendering

Malekitsu commented 6 months ago

Ok! That's at least a partial solution. If you have more info let me know! For now I close the issue ;)