MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

The role-playing games (I-X) that started it all and the various spin-offs (including Dark Messiah).
cthscr
Golem
Golem
Posts: 613
Joined: 12 Jan 2020

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby cthscr » 06 Mar 2020, 13:15

nixosmm678 wrote:hi there, any chance you could mod my file, to make it work ?
Sorry, no. But here's procedure code:

Code: Select all

sub_48E18E      proc near 

arg_0           = dword ptr  4

                mov     ecx, dword_4FE0AC
                xor     eax, eax
                jmp     short loc_48E1A6

loc_48E198:
                test    cx, cx
                jz      short loc_48E1AF
                mov     cx, word ptr dword_4FE0AC+2[eax*2]
                inc     eax

loc_48E1A6:
                movsx   edx, cx
                cmp     [esp+arg_0], edx
                jl      short loc_48E198

loc_48E1AF:
                movsx   eax, byte_4FE0E8[eax]
                retn    4
sub_48E18E      endp
Hope this can help.

nixosmm678
Leprechaun
Leprechaun
Posts: 5
Joined: 03 Mar 2020

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby nixosmm678 » 07 Mar 2020, 13:32

nah, but thanks anyway :D

User avatar
andrey
Peasant
Peasant
Posts: 98
Joined: 29 Jul 2019
Location: Luxembourg

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby andrey » 08 Mar 2020, 00:47

Hello everyone! Does anyone know, is it possible to do the following things using LUA debug commands?
- Load a game from certain slot
- Go to the main menu
Thanks!

kkolyan
Leprechaun
Leprechaun
Posts: 7
Joined: 12 Sep 2018

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby kkolyan » 18 Mar 2020, 16:53

Hi!

I'd like to make very minimalistic mod that introduces "Druid" class to MM8.

There are options
1. just play Necromancer and change skills via mm8che. Not aceptable, because it should be done every time I'm ready to get new rank of non-standard skill.
2. Use MMExtenstions and just modify some existing class by editing "Class Skills.txt". Acceptable to play once, but breaks donor class.
3. Add new character editing some another tables used by MMExtensions? Ok, I added class (two - initial and promoted) to "Data/Tables/Class *.txt" tables, but how to link paperdolls/portraits to it? How to configure event to convert Druid to Arch Druid on Druid Circlet delivery to a specific NPC? Are there any examples how to script it (generally, I'm ok in Lua, but I failed to find adequate extension point in decompiled scripts by myself)? Please give any hints.

Skill matrix
the same skill matrix as Necromancer's but with Body/Mind/Spirit instead of Dark. Maybe allow to use shield and maces or/and GM Monster ID.

Paper dolls and portraits
it's better to get it from MM7/MM6, but paper dolls adjustment may be difficult. Maybe one of paperdoll mods from nexus will fit. Actually just reuse any paper dolls/portraits from another MM8 class is enough.

Promotional quest
(only for option #3)
given by existing NPC (or new if it is easy enough). Find "Druid Circlet" (useless item that already present in game and "surprizingly" well fits this quest by lore). Difficulty seems to be comparable with another MM8 promotional quests.

Motivation
I had much fun playing mm6-8 games with different parties configuration years ago. But recently discovered that soloeing not is only pissible, but also very joyful with some characters. I've complete MM8 with solo necromancer and want to try it without Dark Magic, so looking for tools to make it fun.

UPDATE1
Looks like 6 sample quests in manual and decompiled scripts clearly shows how to implement promotional quest. But it is not clear how to add new class into game.

UPDATE2
Looks like I need somehow to add new value to the "structs.GameClasses", but can't understand how to do it (MM678 merge mod sources doesn't help).
Last edited by kkolyan on 18 Mar 2020, 18:37, edited 10 times in total.

Rodril
Swordsman
Swordsman
Posts: 579
Joined: 18 Nov 2016

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby Rodril » 18 Mar 2020, 21:26

andrey wrote:Hello everyone! Does anyone know, is it possible to do the following things using LUA debug commands?
- Load a game from certain slot
- Go to the main menu
Thanks!
There's no exact functions for that, but you can emulate player's actions:

Code: Select all

while Game.CurrentScreen ~= 0 do
	ExitCurrentScreen()
	Sleep(20)
end -- exit house/npc/inventory etc screen to avoid graphic glitches.
DoGameAction(132, 0, 0, true) -- press quit button, true in forth param forces game to execute action right now, 
-- if param is false or nil, action will be executed in next tick.
DoGameAction(132) -- press quit button second time
After executing these lines, you'll exit to main menu.
You can track player actions by executing this code (do it only once):

Code: Select all

RecentActions = {}
function events.Action(t)
	table.insert(RecentActions, t)
end
execute next line in debug console to view recent actions (there will be only parameters and action code, though).

Code: Select all

dump(RecentActions)
execute this to clear current "log":

Code: Select all

RecentActions = {}
After you'll find all necessary action codes, you'll be able to emulate saving game to certain slot.

Rodril
Swordsman
Swordsman
Posts: 579
Joined: 18 Nov 2016

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby Rodril » 18 Mar 2020, 21:42

kkolyan wrote:(MM678 merge mod sources doesn't help).
:cry:

You need scripts "RemoveClassLimits.lua" and "CharacterOutfits.lua" from MMMerge source. Put them into your Script subfolders accordingly. After next launch few additional tables will be generated in "Data\Tables" folder, use them to add new paperdoll, edit it's availability at start and it's default class. To create new class - add new lines and columns into "Class*.txt" tables. Set value "Def class" of "Character portraits.txt" to new class' index, put "x" symbol int "Available at start" for new paperdoll.
Last edited by Rodril on 18 Mar 2020, 21:43, edited 1 time in total.

kkolyan
Leprechaun
Leprechaun
Posts: 7
Joined: 12 Sep 2018

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby kkolyan » 19 Mar 2020, 12:15

Rodril wrote:
kkolyan wrote:(MM678 merge mod sources doesn't help).
:cry:

You need scripts "RemoveClassLimits.lua" and "CharacterOutfits.lua" from MMMerge source. Put them into your Script subfolders accordingly. After next launch few additional tables will be generated in "Data\Tables" folder, use them to add new paperdoll, edit it's availability at start and it's default class. To create new class - add new lines and columns into "Class*.txt" tables. Set value "Def class" of "Character portraits.txt" to new class' index, put "x" symbol int "Available at start" for new paperdoll.
Wow... I underestimated MM Extensions and MM678! Thanks, your hints are very helpful. It almost works!

Issues I faced:

1. "Delete me" instead of class name in bothe "New Game" menu and in game (in popups, in dialogs "this skill cannot be learned by Delete me"). What am I doing wrong? What table is the primary source of class name?

2. "Class Extra.txt" generated with reversed "Step" value for some reason:

Code: Select all

#	Kind	Step	Note
0	1	1	Necromancer
1	1	0	Lich
2	2	1	Cleric
3	2	0	Priest of the Sun
4	3	1	Knight
5	3	0	Champion
6	4	1	Troll
...
As I see from MM678 tables, 0 means initial, 1 and 2 - promoted. But here it is opposite. So by default it breaks all characters. Not very big deal, because easy to correct. Is it known issue and I just need to correct table or I do something wrong?

UPDATE1: Do you use any IDE/editor to work with this tables and see them as tables while editing? Excel export/import?

UDPATE2: I also added my class to ConstAndBits.lua:

Code: Select all

	const.Class = {
                ...
		Nosferatu = 13,
		Dragon = 14,
		GreatWyrm = 15,
		Druid = 16,
		ArchDruid = 17
	}
but it doesn't help.
Last edited by kkolyan on 19 Mar 2020, 12:38, edited 6 times in total.

Rodril
Swordsman
Swordsman
Posts: 579
Joined: 18 Nov 2016

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby Rodril » 19 Mar 2020, 16:35

kkolyan wrote:1. "Delete me" instead of class name in bothe "New Game" menu and in game (in popups, in dialogs "this skill cannot be learned by Delete me"). What am I doing wrong? What table is the primary source of class name?
Open EnglishT.lod in "Data" folder with MMArchive, extract "class.txt", edit it and put back.
kkolyan wrote:2. "Class Extra.txt" generated with reversed "Step" value for some reason:
This is not intended. I have not used it with original version of game for a while, will fix this bug.
kkolyan wrote:UPDATE1: Do you use any IDE/editor to work with this tables and see them as tables while editing? Excel export/import?
This one: https://grayface.github.io/mm/#Txt-Edit

kkolyan
Leprechaun
Leprechaun
Posts: 7
Joined: 12 Sep 2018

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby kkolyan » 19 Mar 2020, 17:03

Open EnglishT.lod in "Data" folder with MMArchive, extract "class.txt", edit it and put back.
Is it possible to make it without modification of LODs? For example by creating own additive lod or just putting class.txt at some right place in Data folder?
thanks, will try it.

UPDATE1: regarding frist question, I see, I need https://grayface.github.io/mm/#LodCompare

UPDATE2: actually I do not even need LodMerge. GrayFace patch supports overriding LOD contents by placing unpacked and modified files to DataFiles dir. I've tested and it works well. Now time for promotional quest coding :oex:
Last edited by kkolyan on 19 Mar 2020, 17:40, edited 2 times in total.

cthscr
Golem
Golem
Posts: 613
Joined: 12 Jan 2020

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby cthscr » 21 Mar 2020, 12:17

Game.SkillNames and Game.SkillDescriptions arrays in MM8 should have size of 39 rather than 37.

Patch: Scripts/Structs/00 structs.lua, lines 52-53:

Code: Select all

		[mmv(nil, 0xAE3150, 0xBB3060)].array(mmv(nil, 37, 39)).EditPChar  'SkillNames'
		[mmv(nil, 0x5C88F0, 0x5E4CB0)].array(mmv(nil, 37, 39)).EditPChar  'SkillDescriptions'
Merge678 issue.

kkolyan
Leprechaun
Leprechaun
Posts: 7
Joined: 12 Sep 2018

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby kkolyan » 21 Mar 2020, 23:56

kkolyan wrote:Hi!

I'd like to make very minimalistic mod that introduces "Druid" class to MM8.
If someone interested in similar things - I've finished and implemented all I wanted and slightly more.

Here the result: https://www.nexusmods.com/mightandmagicviii/mods/3
There are 2 additional classes (Druid and Sorcerer) with promotion quests for them and additional "service" to transform character of any class to one of these new classes with skills respec.

Rodril, thanks for your help!

User avatar
SpectralDragon
Swordsman
Swordsman
Posts: 579
Joined: 15 May 2019

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby SpectralDragon » 22 Mar 2020, 07:27

GrayFace wrote: :gong:
Hey, apologies I'm telling you about those stuff here, seeing how most of those bugs and issues relate to MMExtension and MMEditor, but some of them are pretty jarring as well as bad while testing Community Branch's MMMerge and we'd wish to you take a look into them as well as fix them if you can.

You can find these bugs listed as Issues here:
https://gitlab.com/templayer/mmmerge/-/ ... D=GrayFace

I hope you're alright during those difficult times and and hear ya later (I won't mention the newly colored monster sprites for base MM8 because we're both sure we know about those. ^^; ). :tsup:
Last edited by SpectralDragon on 22 Mar 2020, 07:29, edited 1 time in total.
Yes?

User avatar
SpectralDragon
Swordsman
Swordsman
Posts: 579
Joined: 15 May 2019

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby SpectralDragon » 03 Apr 2020, 19:13

Rodril wrote: You need scripts "RemoveClassLimits.lua" and "CharacterOutfits.lua" from MMMerge source. Put them into your Script subfolders accordingly. After next launch few additional tables will be generated in "Data\Tables" folder, use them to add new paperdoll, edit it's availability at start and it's default class. To create new class - add new lines and columns into "Class*.txt" tables. Set value "Def class" of "Character portraits.txt" to new class' index, put "x" symbol int "Available at start" for new paperdoll.
Sadly this causes everyone to lose their pre-determined stat and skill limits as well as stops Dragons from breathing fire overall (they can only attack in melee). Tried it when trying to add new character paperdolls within the game (base MM8) as a test. :(
Yes?

Rodril
Swordsman
Swordsman
Posts: 579
Joined: 18 Nov 2016

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby Rodril » 03 Apr 2020, 22:37

SpectralDragon wrote:Sadly this causes everyone to lose their pre-determined stat and skill limits as well as stops Dragons from breathing fire overall (they can only attack in melee). Tried it when trying to add new character paperdolls within the game (base MM8) as a test. :(
I did not use these scripts with original version of game for a long time, thus i made mistakes in algorythm of default table generation. I'll fix it in next merge update, but if you want to test them now, all you need to do is:
1. Open "Class Extra.txt" table in "Data\Tables" folder, and fix promotion steps, they are basicaly shifted by one: Necromancer is 1, Lich is 0, make opposite Necromancer should be 0, Lich - 1 same for other classes.
2. Open "Character portraits.txt" table in "Data\Tables" folder and set 137 for portraits 24 and 25 in columns Def Attack (melee) and Def Attack (range).

User avatar
SpectralDragon
Swordsman
Swordsman
Posts: 579
Joined: 15 May 2019

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby SpectralDragon » 04 Apr 2020, 09:06

Rodril wrote:I did not use these scripts with original version of game for a long time, thus i made mistakes in algorithm of default table generation. I'll fix it in next merge update, but if you want to test them now, all you need to do is:
1. Open "Class Extra.txt" table in "Data\Tables" folder, and fix promotion steps, they are basically shifted by one: Necromancer is 1, Lich is 0, make opposite Necromancer should be 0, Lich - 1 same for other classes.
2. Open "Character portraits.txt" table in "Data\Tables" folder and set 137 for portraits 24 and 25 in columns Def Attack (melee) and Def Attack (range).
Thanks, that did the trick. :tsup: I now wonder how can you align Adventurer´s Inn roster so that they don˙t clip into each other (character roster icons, that are) and what do you need to do in order to change both standard NPC and PC roster images (example, tried to turn Brimstone into a Gold Dragon as both NPC and PC as a test, didn´t manage to do it even when I changed all of his values in "NPC" files inside the .lod into an appropriate number for a Gold Dragon as he˙s presented in Character portraits.txt . He still remains brown. ^^; ) though.

Ok, stuff got really messed up when I tried to play the game: apparently even mentioning the promoted class broke the game even if I did what you told me to do, so yeah, that update to the default table generation is critical because currently your CharacterOutfits.lua and RemoveClassLimits.lua is breaking the base MM8 hardcore. ^^;
Last edited by SpectralDragon on 04 Apr 2020, 14:49, edited 3 times in total.
Yes?

cthscr
Golem
Golem
Posts: 613
Joined: 12 Jan 2020

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby cthscr » 11 Apr 2020, 10:50

What's the difference between evt.map and evt.Map and which one should be used in Scripts/Maps/ ?

Same question with evt.global and evt.Global.

(As I can see they are references to the same table. And people use both of them.)

cthscr
Golem
Golem
Posts: 613
Joined: 12 Jan 2020

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby cthscr » 20 May 2020, 18:39

MM8 GameParty.GetRepuataion [why don't rename it to GetReputation with compatibility alias?(*)] should call 0x47603F rather than jump into the middle of its caller (and cause a game crash).

(*) same with GameParty.PritsonTerms

kkolyan
Leprechaun
Leprechaun
Posts: 7
Joined: 12 Sep 2018

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby kkolyan » 21 May 2020, 15:52

Sorry for posible offtopic, but looks like people in this thread are the most competent for this question.

How MM6 stores mapping between MONSTERS.TXT entries and monster sprite images in SPRITES.LOD?

Rodril
Swordsman
Swordsman
Posts: 579
Joined: 18 Nov 2016

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby Rodril » 26 May 2020, 12:19

kkolyan wrote:How MM6 stores mapping between MONSTERS.TXT entries and monster sprite images in SPRITES.LOD?
There's file "MonList.txt" in "...Data\Tables" folder, it contains entries for each monster and it's SFT group names for each kind of animation.
cthscr wrote:What's the difference between evt.map and evt.Map and which one should be used in Scripts/Maps/ ?
Same question with evt.global and evt.Global.
I'm sure evt.map and evt.Map are synonyms made for convinience.
Last edited by Rodril on 26 May 2020, 12:21, edited 1 time in total.

User avatar
GrayFace
Round Table Hero
Round Table Hero
Posts: 1660
Joined: 29 Nov 2005

Re: MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Unread postby GrayFace » 27 May 2020, 20:03

cthscr wrote:MM8 GameParty.GetRepuataion [why don't rename it to GetReputation with compatibility alias?(*)] should call 0x47603F rather than jump into the middle of its caller (and cause a game crash).

(*) same with GameParty.PritsonTerms
Yes, I should provide backward compatibility options, but I usually just rename things that are messed up. This time I did it right.
Last edited by GrayFace on 27 May 2020, 20:06, edited 1 time in total.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.


Return to “Might and Magic”

Who is online

Users browsing this forum: No registered users and 6 guests