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).

Moderator: Moderators

lightbringer23
Peasant
Peasant
Posts: 91
Joined: 02 Apr 2017

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

Postby lightbringer23 » Dec 9 2020, 17:47

I replied in your dedicated thread :)

AndrewBased
Leprechaun
Leprechaun
Posts: 4
Joined: 20 Dec 2020

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

Postby AndrewBased » Dec 24 2020, 15:33

I'm figuring out some coding, not sure if it was posted already but i hope it won't be a problem. I've found an useful way to use timer commands.
The code i'm posting will generate a friendly Angel Lord every minute nearby the starting area of MM8. I wrote this basing off the MMMerge mod, so values may change depending on the game you'll be playing

Code: Select all

function events.AfterLoadMap ()
 local Timertxt
 if Game.Map.Name == "out01.odm" then
   Timer(function()
  local mon = SummonMonster(200, 4845, 9956, Party.Z, true)
  end, const.Minute, true)
 end
end

AndrewBased
Leprechaun
Leprechaun
Posts: 4
Joined: 20 Dec 2020

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

Postby AndrewBased » Dec 28 2020, 10:48

How do i import .obj files into the maps? I've seen somebody else had the same problem but using MM8LEVELEDITOR won't work with the new patches, am i missing something? The whole model won't appear at all in the map and, instead, the whole map will disappear.

User avatar
DaveHer
Demon
Demon
Posts: 303
Joined: 13 Mar 2019

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

Postby DaveHer » Dec 28 2020, 11:36

AndrewBased wrote:How do i import .obj files into the maps? I've seen somebody else had the same problem but using MM8LEVELEDITOR won't work with the new patches, am i missing something? The whole model won't appear at all in the map and, instead, the whole map will disappear.

You have to use GrayFace Editor. While in the game press alt F1 Or Ctr F1 I forgot which but it is one of those two. Then press the middle button or wheel on your mouse. That will give you access to the menu on the left.
David

AndrewBased
Leprechaun
Leprechaun
Posts: 4
Joined: 20 Dec 2020

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

Postby AndrewBased » Dec 28 2020, 12:30

DaveHer wrote:
AndrewBased wrote:How do i import .obj files into the maps? I've seen somebody else had the same problem but using MM8LEVELEDITOR won't work with the new patches, am i missing something? The whole model won't appear at all in the map and, instead, the whole map will disappear.

You have to use GrayFace Editor. While in the game press alt F1 Or Ctr F1 I forgot which but it is one of those two. Then press the middle button or wheel on your mouse. That will give you access to the menu on the left.
David


I was already using it, seems like that the models i was trying to add were too big or somewhat bugged. I then succeeded in adding other models, thank you anyway! :D

User avatar
yarolig
Leprechaun
Leprechaun
Posts: 1
Joined: 29 Dec 2020

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

Postby yarolig » Jan 1 2021, 14:50

Hi everyone!

Could enyone help?

I'm using MMExtension, MMeditor, MMArchive, mmarch to make a mod for MM7. I have a couple of questions.

1. How can I make a "map" (the map image that you see when press M or on the minimap) for a new outdoor level? Right now full map looks like a black square without player's arrow. Automap is red with an arrow.

2. Is there any guides about making internal maps? Is it possible to delete geometry in the internal maps? I want to make a new map. I'm using Emerald Dragon Cave as a template. I selected a cave and press Delete. Nothing happens. Also when I press New the level geometry stays the same.

cthscr
Assassin
Assassin
Posts: 267
Joined: 12 Jan 2020

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

Postby cthscr » Jan 4 2021, 21:07

Could there be an option added not to add final jump on outline mem.asmpatch? 5 bytes are 5 bytes.

What is the proper way to create local static (null-terminated?) string in lua (and use it in asmpatch/asmproc)?

When I need to process new switch case (i.e. I need to add few lines of asm code without asmpatch or asmproc, called via jump address stored in dd) what is the way?

How to asmpatch hooks of MM8 Patch from MMExtension?
Last edited by cthscr on Jan 4 2021, 21:09, edited 1 time in total.

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

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

Postby GrayFace » Jan 5 2021, 17:53

yarolig wrote:1. How can I make a "map" (the map image that you see when press M or on the minimap) for a new outdoor level? Right now full map looks like a black square without player's arrow. Automap is red with an arrow.

Here's a guide I made back in the day: https://www.dropbox.com/s/kzp8ykif63nol ... p.rar?dl=1

yarolig wrote:2. Is there any guides about making internal maps? Is it possible to delete geometry in the internal maps? I want to make a new map. I'm using Emerald Dragon Cave as a template. I selected a cave and press Delete. Nothing happens. Also when I press New the level geometry stays the same.

See Editor ReadMe. Maps are done in 3D software and exported/imported as *.obj.
But first of all, download new editor scripts from https://github.com/GrayFace/MMExtension ... pts/Global as well as https://github.com/GrayFace/MMExtension ... torDlg.dll
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

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

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

Postby GrayFace » Jan 5 2021, 18:17

cthscr wrote:Could there be an option added not to add final jump on outline mem.asmpatch? 5 bytes are 5 bytes.

What do you mean? Why?

cthscr wrote:What is the proper way to create local static (null-terminated?) string in lua (and use it in asmpatch/asmproc)?

Code: Select all

local s = "Hello"
local p = mem.StaticAlloc(#s+1)
mem.copy(p, s, #s+1)


cthscr wrote:When I need to process new switch case (i.e. I need to add few lines of asm code without asmpatch or asmproc, called via jump address stored in dd) what is the way?

Why without asmproc? It's exactly the case for asmproc.

cthscr wrote:How to asmpatch hooks of MM8 Patch from MMExtension?

That's problematic. What do you want to change?
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

cthscr
Assassin
Assassin
Posts: 267
Joined: 12 Jan 2020

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

Postby cthscr » Jan 5 2021, 22:24

GrayFace wrote:
cthscr wrote:Could there be an option added not to add final jump on outline mem.asmpatch? 5 bytes are 5 bytes.

What do you mean? Why?

Quite often one (not only me) conditionally jumps back near the start of asmpatch. At the end one needs to jump unconditionally to another address. So the asmpatch code have two sequential jmp where second isn't used.
GrayFace wrote:
cthscr wrote:When I need to process new switch case (i.e. I need to add few lines of asm code without asmpatch or asmproc, called via jump address stored in dd) what is the way?

Why without asmproc? It's exactly the case for asmproc.

Uh... Have overthought, expecting changes of registers.
GrayFace wrote:
cthscr wrote:How to asmpatch hooks of MM8 Patch from MMExtension?

That's problematic. What do you want to change?

Savegames count. You have hardcoded 20 (which is also hardcoded by mm8.exe but can be changed there).

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

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

Postby GrayFace » Jan 6 2021, 17:33

cthscr wrote:
GrayFace wrote:
cthscr wrote:Could there be an option added not to add final jump on outline mem.asmpatch? 5 bytes are 5 bytes.

What do you mean? Why?

Quite often one (not only me) conditionally jumps back near the start of asmpatch. At the end one needs to jump unconditionally to another address. So the asmpatch code have two sequential jmp where second isn't used.

But it never gets in the way.

cthscr wrote:
GrayFace wrote:
cthscr wrote:How to asmpatch hooks of MM8 Patch from MMExtension?

That's problematic. What do you want to change?

Savegames count. You have hardcoded 20 (which is also hardcoded by mm8.exe but can be changed there).

Done. I've removed the limit for the new patch. I can send it for you to test.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

cthscr
Assassin
Assassin
Posts: 267
Joined: 12 Jan 2020

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

Postby cthscr » Jan 7 2021, 8:42

GrayFace wrote:
cthscr wrote:Quite often one (not only me) conditionally jumps back near the start of asmpatch. At the end one needs to jump unconditionally to another address. So the asmpatch code have two sequential jmp where second isn't used.

But it never gets in the way.

"Five bytes are five bytes."
GrayFace wrote:
cthscr wrote:
GrayFace wrote:That's problematic. What do you want to change?

Savegames count. You have hardcoded 20 (which is also hardcoded by mm8.exe but can be changed there).

Done. I've removed the limit for the new patch. I can send it for you to test.

Yes please.

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

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

Postby GrayFace » Jan 17 2021, 3:10

cthscr wrote:Yes please.

How did it go BTW?
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

cthscr
Assassin
Assassin
Posts: 267
Joined: 12 Jan 2020

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

Postby cthscr » Jan 18 2021, 12:52

GrayFace wrote:How did it go BTW?

DLL is probably fine - haven't seen anything broken yet. As for my max_save_count patches - they are far far away from being complete.
I went over 20 more or less successfully, though number is greater by 10 (current quiksaves count) than it should be.
Last edited by cthscr on Jan 18 2021, 12:57, edited 2 times in total.

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

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

Postby GrayFace » Jan 20 2021, 9:08

cthscr wrote:As for my max_save_count patches - they are far far away from being complete.

BTW, for finding references I have this script: https://github.com/GrayFace/MMExtension ... Helper.lua
For historic reasons it produces 2 lists, but treat them as one, 2nd is just more trustworthy. Of course, you'll need to check all the addresses anyway. It takes 2 addresses - the start of addresses range and the address right after it ends.
For example:

Code: Select all

local t = Game.QuestsTxt
return FR(t.?ptr - t[1].?size, t.?ptr + t.?size)

I should talk more about how my mem hooks work in general.
Last edited by GrayFace on Jan 20 2021, 9:09, 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.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Postby J. M. Sower » Feb 9 2021, 21:09

Small question. There is possibility to get in script information about which video mode is active (hardware or software)? I wan't to make some special colored lights invisible in software mode, because in this mode they looks bad. Ofcourse I can reccomend to play my mod only in hardware but heh... :tongue:

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

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

Postby GrayFace » Feb 10 2021, 13:13

J. M. Sower wrote:Small question. There is possibility to get in script information about which video mode is active (hardware or software)? I wan't to make some special colored lights invisible in software mode, because in this mode they looks bad. Ofcourse I can reccomend to play my mod only in hardware but heh... :tongue:

if not Game.IsD3D then ...
In Software they aren't colored. Don't forget there's a setting to turn off colored lights in Hardware as well.
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.2 + MMEditor v2.1 Level Editor [June 4, 2019]

Postby J. M. Sower » Feb 11 2021, 19:32

GrayFace wrote:
J. M. Sower wrote:Small question. There is possibility to get in script information about which video mode is active (hardware or software)? I wan't to make some special colored lights invisible in software mode, because in this mode they looks bad. Ofcourse I can reccomend to play my mod only in hardware but heh... :tongue:

if not Game.IsD3D then ...
In Software they aren't colored. Don't forget there's a setting to turn off colored lights in Hardware as well.

Thanks!

User avatar
Nirran
Leprechaun
Leprechaun
Posts: 14
Joined: 09 Feb 2021

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

Postby Nirran » Feb 12 2021, 16:09

hello people :)

were can i find docs on the hooks this mod adds?i wnata change the time of lvl training,it is possible isnt it?

thnx

edit : found it ,yay now training takes 0 time :P

edit 2 : in mm7 the older MMEx,i was able to mod the coach and boats,having trouble with that with merge mod,can dirrect me to a format of related files?was unable on web and this forum to find anything

edit 3 : what is the function to advance game time?been looking at the help page for a while,cannot find it
Last edited by Nirran on Feb 18 2021, 3:14, edited 3 times in total.

tnevolin
Peasant
Peasant
Posts: 59
Joined: 19 Oct 2015

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

Postby tnevolin » Feb 26 2021, 4:20

Hello, everybody.

Trying to modify map events. Some things are a little bit unclear from the description. Anyone can clarify? Thank you.

  1. Do I need to initialize (override) map event every time map is loaded or it could be done once at game initialization?
  2. Which event should I use to initialize map event: InternalBeforeLoadMap, BeforeLoadMap, BeforeLoadMapScripts, LoadMapScripts, LoadMap, AfterLoadMap?
  3. Do I need to explicitly remove event I am planning to override? Would assigning a function to it just override what was there before?


Return to “Might and Magic”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 13 guests