Might and Magic 6, 7, 8 merge redone

The role-playing games (I-X) that started it all and the various spin-offs (including Dark Messiah).
User avatar
toadking
Leprechaun
Leprechaun
Posts: 26
Joined: 22 Jul 2022

Re: Might and Magic 6, 7, 8 merge redone

Unread postby toadking » 24 Jul 2022, 12:38

I played all afternoon, and this problem has not occurred any more. Thank you for your job, The UI is really beautiful.

User avatar
DaveHer
Marksman
Marksman
Posts: 434
Joined: 13 Mar 2019

Re: Might and Magic 6, 7, 8 merge redone

Unread postby DaveHer » 27 Jul 2022, 17:00

toadking wrote: 24 Jul 2022, 12:38 I played all afternoon, and this problem has not occurred any more. Thank you for your job, The UI is really beautiful.
Thank You. :)

User avatar
toadking
Leprechaun
Leprechaun
Posts: 26
Joined: 22 Jul 2022

Re: Might and Magic 6, 7, 8 merge redone

Unread postby toadking » 02 Aug 2022, 09:44

I have been passed MM6,7,8, now I stucked of task in the breach,here are some issues and workaround I recorded in the game,for your reference. I can't find the way for issue3,4,5 especially issue5,Could you please give me some tips?

*Issue1*:
When a "Greater Vampire" is near teams and attacks teams with his magic, the game reports an error and exit. Error message as below:

Code: Select all

D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:1467: array index (4) out of bounds [0, 3]

stack traceback:
	[C]: in function 'error'
	D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:1426: in function '__index'
	D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:1467: in function '__index'
	D:\MMMergeRedone2.02EN\Scripts/Core/events.lua:2109: in function 'f'
	D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:2199: in function <D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:2197>
	[C]: in function 'pcall'
	D:\MMMergeRedone2.02EN\Scripts/Core/Common.lua:203: in function 'pcall2'
	D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:1772: in function <D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:1769>
	[C]: in function 'def'
	D:\MMMergeRedone2.02EN\Scripts\Structs\After\Spells.lua:131: in function 'callDef'
	D:\MMMergeRedone2.02EN\Scripts\Structs\After\Spells.lua:151: in function 'f'
	D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:2199: in function <D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:2197>
	[C]: in function 'pcall'
	D:\MMMergeRedone2.02EN\Scripts/Core/Common.lua:203: in function 'pcall2'
	D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:1772: in function <D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:1769>

arguments of '__index':
	t = (table: 0x0676a3e8)
	a = 4

local variables of '__index':
	(*temporary) = (table: 0x21963bd8)
	(*temporary) = 6.4396995542242e-295

upvalues of '__index':
	name = "Players"
Workaround:
Modify RSMem.lua Line 1423:
from

Code: Select all

 "if a1 >= 0 and a1 < n then" 
to

Code: Select all

 "if a1 >= 0 and a1 <= n then"
*Issue2*:
When entering stone city, report an error and exit,this problem occurred several times later. After many tests, it was found that the issue was related to hardware acceleration(Maybe it's my case),some of messages:

Code: Select all

Exception EAccessViolation in module mm8.exe at 0007024C.
Access violation at address 0047024C in module 'mm8.exe'. Read of address DA1E4452.

Function Calls:

0047024C | D:\MMMergeRedone2.02\mm8.exe + 7024C
60002B7E ? D:\MMMergeRedone2.02\ExeMods\MMExtension.dll + 2B7E
60002C41 ? D:\MMMergeRedone2.02\ExeMods\MMExtension.dll + 2C41
004712A6 | D:\MMMergeRedone2.02\mm8.exe + 712A6
0046A3EF | D:\MMMergeRedone2.02\mm8.exe + 6A3EF
...
Workaround:
Right click mm8.exe and mm8setup.exe respectively, uncheck "use administrator to execute" and "compatibility", then execute mm8setup.exe and select "software 3D" to play game, the issue disappears.Save the game and exit after entering stone city,then setup mm8.exe and mm8setup.exe, use hardware acceleration to play the game and load the saved progress, it could be continued.

*Issue3*:
Use dark magic "realimate" revive some kind of dead monster, it report "club" and failed, but sometimes the magic works.

*Issue4*:
For some NPC recruited, his skill become useless after several times of use, especially flying(NPC:wind master) ,healing(NPC:Healther master) ,is there a limit on the number of skill uses?

*Issue5*:
After I entered the breach, the following quests have been completed:
1. Found teammates
2. Found runaway chaos.
3. Give the right answer for all the riddles that runaway chaos and villagers given.
Then, I took "runaway chaos" to the front of the dark dwarves' compound. Clicking the door,then clicked "OK" on the next screen, nothing happend. I don't know why I can't go in,Could you please give me a tip?

User avatar
raekuul
Demon
Demon
Posts: 349
Joined: 05 Jul 2019

Re: Might and Magic 6, 7, 8 merge redone

Unread postby raekuul » 02 Aug 2022, 12:01

Issue 1: Was that an MM7 Greater Vampire or an MM8 Greater Vampire? It sounds like their attack logic wasn't correctly upgraded to handle a five-person party. Your workaround is going to create subtle bugs elsewhere since that's a change to the underlying MMExtension (and therefore the entire lua bridge) rather than to MMMerge itself.

Issue 3 is an engine bug, not a MMMerge bug: Reanimate fails if your skill level provides less HP than the monster has in total HP, the error message for "this monster cannot be reanimated at your current skill level" is faulty and instead shows "club."

Issue 4 is a limitation on the non-combat hirelings: if you have to activate them, you can only activate them once every 24 hours.

User avatar
toadking
Leprechaun
Leprechaun
Posts: 26
Joined: 22 Jul 2022

Re: Might and Magic 6, 7, 8 merge redone

Unread postby toadking » 02 Aug 2022, 13:12

Issue1: Greater Vampire in MM8 ,this issue appears when he is near the team and uses magic attacks(his common attack will not cause this problem). I found that in the error message"D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:1467: array index (4) out of bounds [0, 3]" ,4 will be number of team members,if the team have 3 members ,error message will be"D:\MMMergeRedone2.02EN\Scripts/Core/RSMem.lua:1467: array index (3) out of bounds [0, 2]", only solo can work normally, the issue will be appeared when member>1. After I update the RSMem.lua, the issue disappeared. I don't know whether it will have other effects, it seems that the game go normally until now :D

Issue 3:Now I get it, thank your for explanation. :tsup:

Issue4: I can use the NPC's skill by activating them once every 24 hours, In this way, it will be invalid after using it several times. For example, after the NPC cast the flying magic, it displays OK, but there is no flying skill icon, and it can't fly. Click again to say "Sorry, come back another day".

Issue5:I found it is related to scripts\maps\bralvar.lua,from line 259,following "if" statement return false resulting in failure to enter the compound:

Code: Select all

evt.map[53] = function()
	if evt.MoveToMap{0,0,0,0,0,0,710,3,"BrBase.blv"} then
		QSet.EnteredBasement = false
		evt.MoveToMap{0,0,0,0,0,0,0,0,"BrBase.blv"}
	end
end
I don't know which tasks have not been completed. Can you give me a tip?

cthscr
Blood Fury
Blood Fury
Posts: 456
Joined: 12 Jan 2020

Re: Might and Magic 6, 7, 8 merge redone

Unread postby cthscr » 03 Aug 2022, 07:04

toadking wrote: 02 Aug 2022, 13:12 Issue5:I found it is related to scripts\maps\bralvar.lua,from line 259,following "if" statement return false resulting in failure to enter the compound:

Code: Select all

evt.map[53] = function()
	if evt.MoveToMap{0,0,0,0,0,0,710,3,"BrBase.blv"} then
		QSet.EnteredBasement = false
		evt.MoveToMap{0,0,0,0,0,0,0,0,"BrBase.blv"}
	end
end
I don't know which tasks have not been completed. Can you give me a tip?
This (and other similar) part of code wasn't updated by DavidHer. First MoveToMap should be called without "if", its behavior was changed in new MMExtension. See for example https://gitlab.com/cthscr/mmmerge/-/blo ... r.lua#L259

User avatar
toadking
Leprechaun
Leprechaun
Posts: 26
Joined: 22 Jul 2022

Re: Might and Magic 6, 7, 8 merge redone

Unread postby toadking » 03 Aug 2022, 08:29

cthscr wrote: 03 Aug 2022, 07:04
toadking wrote: 02 Aug 2022, 13:12 Issue5:I found it is related to scripts\maps\bralvar.lua,from line 259,following "if" statement return false resulting in failure to enter the compound:

Code: Select all

evt.map[53] = function()
	if evt.MoveToMap{0,0,0,0,0,0,710,3,"BrBase.blv"} then
		QSet.EnteredBasement = false
		evt.MoveToMap{0,0,0,0,0,0,0,0,"BrBase.blv"}
	end
end
I don't know which tasks have not been completed. Can you give me a tip?
This (and other similar) part of code wasn't updated by DavidHer. First MoveToMap should be called without "if", its behavior was changed in new MMExtension. See for example https://gitlab.com/cthscr/mmmerge/-/blo ... r.lua#L259
These three scripts "BrAlvar.lua,BrBase.lua,Breach.lua" all have this phenomenon. Modify the call statement "if evt.movetomap..." To "evt.movetomap..." in these three scripts, and the breach of the game can end normally.

Thank you for your advice. It's a beautiful day today :applause:

cthscr
Blood Fury
Blood Fury
Posts: 456
Joined: 12 Jan 2020

Re: Might and Magic 6, 7, 8 merge redone

Unread postby cthscr » 03 Aug 2022, 09:19

toadking wrote: 02 Aug 2022, 09:44 When a "Greater Vampire" is near teams and attacks teams with his magic, the game reports an error and exit.
Finally it can be reproduced.
toadking wrote: 02 Aug 2022, 09:44 Workaround:
Modify RSMem.lua Line 1423:
from

Code: Select all

 "if a1 >= 0 and a1 < n then" 
to

Code: Select all

 "if a1 >= 0 and a1 <= n then"
This is not a workaround but current bug redirection and new bugs introduction. Please do not.

Issue is caused by Spirit Lash being casted on entire party (and in this case target is marked as party slot equal to Party.count). And MMExtension doesn't expect this.

Code: Select all

diff --git a/Scripts/Core/events.lua b/Scripts/Core/events.lua
index 506912c..82248e1 100644
--- a/Scripts/Core/events.lua
+++ b/Scripts/Core/events.lua
@@ -2156,12 +2156,14 @@ do
                local t = {
                        -- table returned by #WhoHitPlayer:#
                        Attacker = attacker,
-                       -- :structs.Player
-                       Player = Party[slot],
                        PlayerSlot = slot,
                        Handled = false,
                }
-
+               if slot < Party.count then
+                       -- :structs.Player
+                       t.Player = Party[slot]
+               end
+
                -- Called when a monster or a projectile tries to hit a player. Can be used to completely replace what happens.
                events.cocall("PlayerAttacked", t, attacker)
                if not t.Handled then
Looks to me like MMExtension (or even MM8) will also damage Party.PlayersArray[Party.count] by spell damage value as well.

User avatar
toadking
Leprechaun
Leprechaun
Posts: 26
Joined: 22 Jul 2022

Re: Might and Magic 6, 7, 8 merge redone

Unread postby toadking » 03 Aug 2022, 12:20

OK, I will wait for your solution to issue1

User avatar
toadking
Leprechaun
Leprechaun
Posts: 26
Joined: 22 Jul 2022

Re: Might and Magic 6, 7, 8 merge redone

Unread postby toadking » 04 Aug 2022, 07:11

I modified scripts/core/events.lua according to your tip, then I tested it and found that the issue1 no longer exists,Could this be your recommended solution?
Code as below,modified line remarked with string "20220804":

Code: Select all

local function HitPlayer(d, def, attackerID, action, speed, slot)
...
		local t = {
			-- table returned by #WhoHitPlayer:#
			Attacker = attacker,
			-- :structs.Player
---			Player = Party[slot],      ----20220804,remark it
			PlayerSlot = slot,
			Handled = false,
		}
		
        if slot < Party.count then    ----20220804,add
             -- :structs.Player       ----20220804,add   
            t.Player = Party[slot]    ----20220804,add
        end                  -------------20220804,add
		-- Called when a monster or a projectile tries to hit a player. Can be used to completely replace what happens.
		events.cocall("PlayerAttacked", t, attacker)
thank you for your advice again.

User avatar
DaveHer
Marksman
Marksman
Posts: 434
Joined: 13 Mar 2019

Re: Might and Magic 6, 7, 8 merge redone

Unread postby DaveHer » 05 Aug 2022, 09:52

I was not aware of Rodril's Gitlab until I saw the link above. I have downloaded all the necessary files to update the merge redone. I need to check the map file first before I upload a patch to Mod Jobs.
David

User avatar
DaveHer
Marksman
Marksman
Posts: 434
Joined: 13 Mar 2019

Re: Might and Magic 6, 7, 8 merge redone

Unread postby DaveHer » 06 Aug 2022, 02:23

@ All that have downloaded the mod. There is an important patch two for the Merge Redone 2.0 at Mod Job site. There is a readme file in the zip file.
David

User avatar
toadking
Leprechaun
Leprechaun
Posts: 26
Joined: 22 Jul 2022

Re: Might and Magic 6, 7, 8 merge redone

Unread postby toadking » 06 Aug 2022, 14:19

good job,I will apply this patch to my game :applause:

User avatar
DaveHer
Marksman
Marksman
Posts: 434
Joined: 13 Mar 2019

Re: Might and Magic 6, 7, 8 merge redone

Unread postby DaveHer » 06 Aug 2022, 20:27

toadking wrote: 06 Aug 2022, 14:19 good job,I will apply this patch to my game :applause:
Thank You :-D

User avatar
toadking
Leprechaun
Leprechaun
Posts: 26
Joined: 22 Jul 2022

Re: Might and Magic 6, 7, 8 merge redone

Unread postby toadking » 13 Aug 2022, 07:18

Issue4 is occured again after applied the patch Patch_two_for_MergeRedone_v2.0.zip,the skills of NPCs are usually normal when they are first hired.This time it happened a few days later after I received alliance mission in MM8, the phenomenon as follows:
NPC--Wind master:
Click "Cast Fly", the sound effect is same as the sound of magic failure, but message "Done!" is displayed. After returning to the screen, there is no flying icon and nothing happened .

NPC--master Healer:
Click "Heal Party", the sound effect is same as the sound of magic failure, but message "Done!" is displayed, nothing happened.

Click them again, message will change to "Sorry, come back another day".

When the issue occurs, I modify the file "Scripts\Struct\after\HardcodedTopicFunctions.lua",

From:

Code: Select all

	function CastSpellDirect(SpellId, Skill, Mastery, Caster, Target)
		mem.u2[0x51d820] = SpellId
		mem.u2[0x51d822] = Caster or 49 -- Caster - rosterId
		mem.u2[0x51d824] = Target or 49 -- Target - rosterId
		mem.u2[0x51d828] = 1
		mem.u2[0x51d82a] = JoinSkill(Skill or 1, Mastery or 0)
	end
to :

Code: Select all

	function CastSpellDirect(SpellId, Skill, Mastery, Caster, Target)
		mem.u2[0x51d820] = SpellId
	     --mem.u2[0x51d822] = Caster or 49 -- Caster - rosterId  ,remark it 20220813
		mem.u2[0x51d824] = Target or 49 -- Target - rosterId
		mem.u2[0x51d828] = 1
		mem.u2[0x51d82a] = JoinSkill(Skill or 1, Mastery or 0)
	end
and re-open game, the issue resolved.

For the issue is not 100% occured, I don't know if this modification will affect the game?

User avatar
DaveHer
Marksman
Marksman
Posts: 434
Joined: 13 Mar 2019

Re: Might and Magic 6, 7, 8 merge redone

Unread postby DaveHer » 13 Aug 2022, 14:56

Thanks for the information. The "--" in front of line 3 tells the computer to ignore the line. Why not delete it?
David

User avatar
toadking
Leprechaun
Leprechaun
Posts: 26
Joined: 22 Jul 2022

Re: Might and Magic 6, 7, 8 merge redone

Unread postby toadking » 14 Aug 2022, 00:30

Thank you for your advice, in other words, do you mean that this line can be deleted without any impact?
mem.u2[0x51d822] = Caster or 49

User avatar
DaveHer
Marksman
Marksman
Posts: 434
Joined: 13 Mar 2019

Re: Might and Magic 6, 7, 8 merge redone

Unread postby DaveHer » 14 Aug 2022, 01:24

toadking wrote: 14 Aug 2022, 00:30 Thank you for your advice, in other words, do you mean that this line can be deleted without any impact?
mem.u2[0x51d822] = Caster or 49
Those two dashes are used in front of Statements to explain a code Or a line. See ThreeEllesiaQuests.lua as an example. It is in the Global folder. Yes, you can delete the line if it did solve the issue. Use notepad++ to open the file. It is an excellent program for editing lua files.
David

User avatar
toadking
Leprechaun
Leprechaun
Posts: 26
Joined: 22 Jul 2022

Re: Might and Magic 6, 7, 8 merge redone

Unread postby toadking » 14 Aug 2022, 03:47

get it,thanks a lot.

cthscr
Blood Fury
Blood Fury
Posts: 456
Joined: 12 Jan 2020

Re: Might and Magic 6, 7, 8 merge redone

Unread postby cthscr » 14 Aug 2022, 08:58

toadking wrote: 13 Aug 2022, 07:18 and re-open game, the issue resolved.

For the issue is not 100% occured, I don't know if this modification will affect the game?
Now try to fly with you first party member being Knight or just having 0 sp. Oops.


Return to “Might and Magic”

Who is online

Users browsing this forum: No registered users and 11 guests