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).
User avatar
GrayFace
Round Table Hero
Round Table Hero
Posts: 1660
Joined: 29 Nov 2005

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby GrayFace » 22 Nov 2016, 08:40

mg979 wrote:
GrayFace wrote:Yes, data\Tables\Class Starting Skills.txt is the one to edit. Make sure to rune the game once with MMExt first.
Thank you but I can't find anything in \data, the only files there are
You either don't have MMExt or didn't run the game with MMExt. It creates Data\Tables on first run.
J. M. Sower wrote:GrayFace, do you know how to make the monster doesn't move after receiving damages (like Treants in MM7)? Could it depends on the size of the creature? I did a laser cannon (it isn't too big) and I don't know how to do it. :wall:
Yes, it's in exe. It can't be edited in the released version of MMExt. Here is not yet released version: https://dl.dropboxusercontent.com/u/447 ... ionTmp.rar
There you can write:

Code: Select all

function events.IsMonsterOfKind(t)
	if t.Id >= ... and t.Id <= ... and t.Kind == const.MonsterKind.Immobile then
		return true
	end
end
Though, I should probably move it into Data\Tables, so this event wouldn't be there when new version is released.
J. M. Sower wrote:Small discovery that may be useful for someone, when wrote current dialogues without using Quest function (in the old way).
Why would you do them the old way?
mg979 wrote:I'm having this kind of error with MMExtension
Unfortunately I still haven't released the new version where I've fixed this. Use the link above to download it.
Last edited by GrayFace on 22 Nov 2016, 08:51, edited 3 times in total.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

mg979
Leprechaun
Leprechaun
Posts: 14
Joined: 05 Nov 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby mg979 » 22 Nov 2016, 09:08

GrayFace wrote:
mg979 wrote:I'm having this kind of error with MMExtension
Unfortunately I still haven't released the new version where I've fixed this. Use the link above to download it.
Thanks for the quick reply, I'll try it now.

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

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby GrayFace » 22 Nov 2016, 09:13

Acomage.lua script for MM8 by Rod Letr
Rod Letr wrote me an email with a script, his forum account is pending activation. The script lets you start the Arcomage game from anywhere and specify its parameters, then there is an event when it ends and you can find out the winner.
Here is the script: http://pastebin.com/MGp1gMX1
Description:

"Arcomage.lua - script to manage arcomage games in Might and Magic 8. Put it into your "...\Scripts\General" folder.

Functions:
1. StartArcomage(TowerToWin, ResourceToWin, PlayersStartTower, PlayersStartWall, PlayerStartHammers, PlayerStartGems, PlayerStartMonsters, PlayerStartProduction, PlayerStartMagic, PlayerStartRecruitment, [Same 8 (from StartTower to Recruitment) params for enemy player in same order], Ai)
All params is numbers between 1 and 65355 (though, i cannot imagine any point to set anything to more than 1000). Params after PlayerStartRecruitment is not neccessary, if you will not define them, they'll be copied from player's params, Ai will become random.
I feel your question like: "What is Ai?", - i dont know. It is not even straight Ai. Game mechanism use house index to define arcomage rules, i found that if all rules just defined manualy, enemy in match will do nothing. So Ai - it is number between 1 and 11 accordingly to 107 - 117 - indexes of taverns in 2Devents.txt for mm8. This index will be set inside arcomage initialization function in mm8.exe where it should be to prevent lack of Ai in game. I dont know if diffrent indexes will provide diffrent Ai behaivor.

2. GetLastAMresult() - nothing to add. No params. Will return: 0 - dead heat, 1 - player won, 2 - enemy won, 3 - game was interrupted by player.

3. Eventual function - ArcomageMatchEnd() - empty by deafult. Triggered after end of match started by StartArcomage(). Define it before start of match by standart construction: function ArcomageMatchEnd(!params must be empty!) <your commands> end. Most casual way it is to use GetLastAMresult() as first command in ArcomageMatchEnd, and then do something depends on match result. Dont forget to make ArcomageMatchEnd() empty again after.

Thats all. It is briefly tested only on mm8 GOG version, for any bugs - answer in this theme, i can read it, though i can not answer due to profanity of... mmm... issues in the site registration system."

Full message with technical details: http://pastebin.com/kS5s98ZD
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

User avatar
J. M. Sower
Scout
Scout
Posts: 188
Joined: 25 Jan 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby J. M. Sower » 22 Nov 2016, 16:25

GrayFace wrote:There you can write:

Code: Select all

function events.IsMonsterOfKind(t)
	if t.Id >= ... and t.Id <= ... and t.Kind == const.MonsterKind.Immobile then
		return true
	end
end
I will try. :) It works, but not in this form. I wrote it in this way (following an older script for the undeads):

Code: Select all

function events.IsMonsterOfKind(t)
  if t.Kind == 6 and t.Id >= (202) and t.Id <= (204) then
    t.Result = true  -- Immobile
  end
end
Also, I found these types of monsters. Could you describe it a little? For example, I don't understand why there is a Demon or Titan kind.

Code: Select all

	Undead = 1,
	Demon = 2,
	Dragon = 3,
	Elf = 4,
	Swimmer = 5,
	Immobile = 6,
	Titan = 7,
	NoArena = 8,
GrayFace wrote:Here is not yet released version: https://dl.dropboxusercontent.com/u/447 ... ionTmp.rar
I found there is a file called "MM8 Blaster.lua". Does this mean that Blasters in MM8 should work now? :-D I have already tested it and it works. :D I have Blasters in MM8. :-D

GrayFace wrote:Why would you do them the old way?
I often write in the old way in complicated cases, because I am not fully acquainted with "Quest" yet. ;)
Last edited by J. M. Sower on 22 Nov 2016, 17:17, edited 8 times in total.

User avatar
J. M. Sower
Scout
Scout
Posts: 188
Joined: 25 Jan 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby J. M. Sower » 22 Nov 2016, 20:02

GrayFace wrote:Acomage.lua script for MM8 by Rod Letr
Rod Letr wrote me an email with a script, his forum account is pending activation. The script lets you start the Arcomage game from anywhere and specify its parameters, then there is an event when it ends and you can find out the winner.
Here is the script: http://pastebin.com/MGp1gMX1
Description:

"Arcomage.lua - script to manage arcomage games in Might and Magic 8. Put it into your "...\Scripts\General" folder.

Functions:
1. StartArcomage(TowerToWin, ResourceToWin, PlayersStartTower, PlayersStartWall, PlayerStartHammers, PlayerStartGems, PlayerStartMonsters, PlayerStartProduction, PlayerStartMagic, PlayerStartRecruitment, [Same 8 (from StartTower to Recruitment) params for enemy player in same order], Ai)
When I wrote this:

Code: Select all

StartArcomage  {TWin = 30, RWin = 100, TPl = 15, WPl = 5, HamPl = 12, GemPl = 12, MonPl = 12, ProdPl = 2, MagPl = 2, RecPl = 2, TEn = 15, WEn = 5, HamEn = 10, GemEn = 10, MonEn = 10, ProdEn = 2, MagEn = 2, RecEn = 2, Ai = 1}
Then I got this:
Image

When I wrote this:

Code: Select all

StartArcomage(TWin = 30, RWin = 100, TPl = 15, WPl = 5, HamPl = 12, GemPl = 12, MonPl = 12, ProdPl = 2, MagPl = 2, RecPl = 2, TEn = 15, WEn = 5, HamEn = 10, GemEn = 10, MonEn = 10, ProdEn = 2, MagEn = 2, RecEn = 2, Ai = 1)
Then I got this:
Image

And when I wrote this:

Code: Select all

StartArcomage(30, 100, 15, 5, 12, 12, 12, 2, 2, 2, 15, 5, 10, 10, 10, 2, 2, 2, 1)
Then I got this:
Image

Am I doing something wrong? :confused:

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

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby GrayFace » 23 Nov 2016, 11:55

J. M. Sower wrote:For example, I don't understand why there is a Demon or Titan kind.
For weapons that deal double damage to them. BTW, that's a table for MM7, in MM8 kinds turned out to be different.
J. M. Sower wrote: I often write in the old way in complicated cases, because I am not fully acquainted with "Quest" yet. ;)
Give me an example that's hard for you with Quest function.
J. M. Sower wrote:When I wrote this:

Code: Select all

StartArcomage  {TWin = 30, RWin = 100, TPl = 15, WPl = 5, HamPl = 12, GemPl = 12, MonPl = 12, ProdPl = 2, MagPl = 2, RecPl = 2, TEn = 15, WEn = 5, HamEn = 10, GemEn = 10, MonEn = 10, ProdEn = 2, MagEn = 2, RecEn = 2, Ai = 1}
You can do this only with "evt" commands, because they're specifically done so they support this.
J. M. Sower wrote: And when I wrote this:

Code: Select all

StartArcomage(30, 100, 15, 5, 12, 12, 12, 2, 2, 2, 15, 5, 10, 10, 10, 2, 2, 2, 1)
Could be a problem in arcomage script. I didn't test it. Maybe you must call it from within a house.
Last edited by GrayFace on 23 Nov 2016, 12:52, edited 2 times in total.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

Rodril
Swordsman
Swordsman
Posts: 579
Joined: 18 Nov 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby Rodril » 23 Nov 2016, 19:11

Hello, issue with registration have been solved and i'm here. Thanks for posting my message.
J. M. Sower, i have not tested the script on another systems then win7 x64, but after your message i've tried it on win xp x32 and error appeared. Problematic point is smackw32.dll, which win7 somewhat doesn't use durning AM initialization, while win xp do. I've added fix to script and it should work now, please, test this version:
https://www.dropbox.com/s/b9ymdpvi56dy0 ... 8.lua?dl=0
Last edited by Rodril on 23 Nov 2016, 19:12, edited 1 time in total.

User avatar
J. M. Sower
Scout
Scout
Posts: 188
Joined: 25 Jan 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby J. M. Sower » 24 Nov 2016, 16:40

GrayFace wrote:Give me an example that's hard for you with Quest function.
I don't know how to assign to current topics some scripts, but so far I didn't want to examine "Multilevel Quest.lua". I just need to finally interested in it.
Rodril wrote:Hello, issue with registration have been solved and i'm here. Thanks for posting my message.
J. M. Sower, i have not tested the script on another systems then win7 x64, but after your message i've tried it on win xp x32 and error appeared. Problematic point is smackw32.dll, which win7 somewhat doesn't use durning AM initialization, while win xp do. I've added fix to script and it should work now, please, test this version:
https://www.dropbox.com/s/b9ymdpvi56dy0 ... 8.lua?dl=0
Unfortunately, still not working.

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

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby GrayFace » 25 Nov 2016, 06:18

J. M. Sower wrote:
GrayFace wrote:Give me an example that's hard for you with Quest function.
I don't know how to assign to current topics some scripts, but so far I didn't want to examine "Multilevel Quest.lua". I just need to finally interested in it.
You don't need to. Basically, you just create stack quest topics for the same slot with a visibility condition, like

Code: Select all

Quest{"MyQuest", Slot = 0, ...}
Quest{Slot = 0, CanShow = QCheck("MyQuest", "Done")}
The second topic will be shown after the 1st quest if complete. Surely, you can make any condition.
Last edited by GrayFace on 25 Nov 2016, 06:19, 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.

User avatar
J. M. Sower
Scout
Scout
Posts: 188
Joined: 25 Jan 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby J. M. Sower » 25 Nov 2016, 15:36

GrayFace wrote:You don't need to. Basically, you just create stack quest topics for the same slot with a visibility condition, like

Code: Select all

Quest{"MyQuest", Slot = 0, ...}
Quest{Slot = 0, CanShow = QCheck("MyQuest", "Done")}
The second topic will be shown after the 1st quest if complete. Surely, you can make any condition.
Ok, but what if I want to assign to topic some text and also some scripts? For example:

Code: Select all

if (Party.Gold >= 100) == true then
	Game.PlaySound(39505)
	math.randomseed( os.time() )
	vars.PlA = math.random(1,6)
end
Last edited by J. M. Sower on 25 Nov 2016, 15:37, edited 1 time in total.

Rodril
Swordsman
Swordsman
Posts: 579
Joined: 18 Nov 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby Rodril » 26 Nov 2016, 13:48

Hello.
Arcomage script now (at least on my two PCs) supports Might and Magic 7.
Also it have been improved a bit - no more tweaking so-called event handler (function at 0x42edd8 - mm8, 0x4304d6 - mm7), variables now stored out of mm.exe module, and their adresses not predefined anymore, and no more such shame as correcting esp register. Scripts for mm7 and mm8 could be easily merged, but i don't want to hurry with it right now.

https://www.dropbox.com/s/926ejhe6d11io ... 7.lua?dl=0
https://www.dropbox.com/s/lwradka3inxe3 ... 8.lua?dl=0

I've found bug, which i can not solve (not to mention crutches), and i dont sure if it is result of my script. My desperate move was to comment whole AM script, and even after it, bug appeared. MM7 GOG, win 7 x64, hardware 3d: dword [0xf8b9b0] does not resetting to 0x0 after intro cinematics. At attempt to load saved game, jump at 0x463373 is not taken, what cause call somewhere to smackw32.dll, attempt to launch cinematics again (i can hear sound) and crash in few seconds. Though i can start newgame, then buggy dword will reset to 0x0 after newgame cinematic. After it i can load any saved game, and bug will not appear anymore untill game will not be restarted. I did not noticed this bug when game was started with software 3d, and on winXP this bug did never appear. Dont want to make wall of text, so in short words, this dword strongly affects showing of every prerenders in the game, not only intro cinematics.
MM7 script with crutch (dword forced to reset to 0x0 on first loading of saved game):
https://www.dropbox.com/s/3a6mraqst7blb ... h.lua?dl=0

J.M. Sower, i did not try, but seems you can easily implement any scripts in new quest system. Add Give, Ungive, Done, Undone, or even Execute into Quest{} Like this:

Code: Select all

Quest{
	Slot = A,
	Ungive = function(t) Game.PlaySound(130) end,
	Texts = {
		Topic = "Placeholder",
		Ungive = "Test text",
	}
}
Give, Ungive, Done, Undone represents current quest state. If you'll use Execute, then you should define each point of topic in it (even message, "Texts" will not work). Use any your commands instead of "Game.PlaySound(130)".

Also, if you can spend some time to debug AM script do this tasks, please:
Download mm8 version script from this post. Install clear version of mm8 somewhere, install patch 2.0, unpack MMExstension, unpack MMEditor, launch game - exit. Put ArcomageMM8.lua into ...scripts\general folder, start new game, open console, type this: StartArcomage(100, 200, 15, 10, 11, 12, 13, 1, 2, 3). I think it will crash again. Find in crash message button like "Show details" or "Technical information", press, printscreen or copy, send it here. After it, launch mm8setup.exe, in Video panel change option to opposite (Software 3d or Hardware 3d), start new game, use StartArcomage again, if it'll crash - send details again.
I ask for this stuff with clear installation because i wonder if crash provided by system or by ingame modifications.

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

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby GrayFace » 26 Nov 2016, 19:22

J. M. Sower wrote:Ok, but what if I want to assign to topic some text and also some scripts? For example:

Code: Select all

if (Party.Gold >= 100) == true then
	Game.PlaySound(39505)
	math.randomseed( os.time() )
	vars.PlA = math.random(1,6)
end
First of all, math.randomseed(os.time()) should be called only once. Put it at the start of your script for example. I'm adding a call to it in MMExt, so you won't need to call it.

If you want to make just a topic, do it like Rodril wrote in his example.

Maybe what you want is something like this:

Code: Select all

Quest{
	Texts = {
		Topic = "Topic",
		Ungive = "Not enough gold",
		Give = "Here you go",
		Undone = "You already got PIA",
	},
	CanGive = function()
		return Party.Gold >= 100
	end,
	OnGive = function()
		Game.PlaySound(39505)
		vars.PlA = math.random(1,6)
	end,
}
Last edited by GrayFace on 26 Nov 2016, 19:28, edited 2 times in total.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

User avatar
J. M. Sower
Scout
Scout
Posts: 188
Joined: 25 Jan 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby J. M. Sower » 27 Nov 2016, 09:37

Thanks for the explanations, I think now I understand it. I will try.

User avatar
J. M. Sower
Scout
Scout
Posts: 188
Joined: 25 Jan 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby J. M. Sower » 27 Nov 2016, 17:04

BTW, I discovered how to properly assign monsters to others as their guardians/allies. In event "ChangeGroupAlly" first number is monsters group taken from NPCGroup.txt and second is number of ally taken from Hostile.txt, eg. script to do monsters in group 38 as guardians of Bedraggled Human (peasant):

Code: Select all

evt.ChangeGroupAlly(38, 56) -- for group 38 assign Ally number 56 (based on Hostile.txt)
GrayFace, maybe add to your website a note about this.
Last edited by J. M. Sower on 27 Nov 2016, 17:08, edited 6 times in total.

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

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby GrayFace » 29 Nov 2016, 00:26

J. M. Sower, thank you, great finding! It is the other way around in the original map I checked (Nighon): warlocks (monster kind) are set as allies for peasants.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

User avatar
J. M. Sower
Scout
Scout
Posts: 188
Joined: 25 Jan 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby J. M. Sower » 29 Nov 2016, 12:13

GrayFace wrote:J. M. Sower, thank you, great finding! It is the other way around in the original map I checked (Nighon): warlocks (monster kind) are set as allies for peasants.
Yep, it can be used interchangeably. I understand that in this case the groups cointaining peasants have assigned warlocks as allies?

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

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby GrayFace » 29 Nov 2016, 16:55

Peasants themselves have warlocks set as their allies. Operations on groups just iterates monsters on current map which belong to that group. I had "Ally" attribute editing disabled in the editor, because I didn't know what it does.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

User avatar
J. M. Sower
Scout
Scout
Posts: 188
Joined: 25 Jan 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby J. M. Sower » 29 Nov 2016, 19:51

GrayFace wrote:Peasants themselves have warlocks set as their allies. Operations on groups just iterates monsters on current map which belong to that group. I had "Ally" attribute editing disabled in the editor, because I didn't know what it does.
I tested how it works by using "ChangeGroupAlly" with "SummonMonster" and "mon.Ally" and/or "mon.Group" to summon peasants and kill them. :P Below is simple version of my script (in my full version it works only when player kills) for checking killed monsters "Group" and "Ally" numbers. I just killed them with different parameters and watched what happens. :tongue:

Code: Select all

function events.MonsterKilled(index, callDef)
	SimpleMessage("Ally: " .. index.Ally .. "; Group: " .. index.Group .. ".") -- shows Ally nad Group number
end
So, You can just use a mon.Ally (it uses Hostile.txt) to determine summoned monster as ally for some other monsters without using "Group". I get it. :D
Last edited by J. M. Sower on 29 Nov 2016, 19:59, edited 8 times in total.

Rodril
Swordsman
Swordsman
Posts: 579
Joined: 18 Nov 2016

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby Rodril » 05 Dec 2016, 10:39

Hello. New thingie is here.

Town portal switcher script for Might and Magic 8.


Download: https://www.dropbox.com/s/x79qgp42fjdj3 ... h.zip?dl=0
Check readme.txt for detailed information, leave here any questions.

Video demonstration: https://www.dropbox.com/s/juh5ww2dmxqe7 ... h.mp4?dl=0

Note: Town Portal.txt table will not work with this script, refill folowing TownPortalSwitch.txt and use it instead. I think these tables could be merged somehow, but i dont want to touch original files.

I've seen projects for merging mm6-7-8, this script can be useful there (though no support for 6 and 7 for now), also you can divide your continent into few TP maps, or even invent global TP map and local TP maps. Tested on win7 x64, mm8 Gog version, but i doubt, that something can bug out here, script is very simple - almost no hooks, rest - standart lua and evt functions.
Last edited by Rodril on 06 Dec 2016, 18:19, edited 1 time in total.

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

Re: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Unread postby GrayFace » 06 Dec 2016, 00:33

Good idea!
Instead of a separate script in Globals you can use

Code: Select all

function events.BeforeLoadMap(WasInGame)
	if not WasInGame then
		TownPortalControls.SwitchTo(TownPortalControls.GetCurrentSwitch())
	end
end
To avoid quest sounds you can change Game.QBits array directly.

What are the 6+7+8 merging projects you're referring to? I only know one being done by Russian friend of mine who didn't write about it on forums AFAIK.
I'm adding a patch for descriptions to MMExt, so in the next version no hooks would be needed.
Last edited by GrayFace on 06 Dec 2016, 00:33, 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: DaveHer and 2 guests