MMExtension v2.2 + MMEditor v2.1 Level Editor [June 4, 2019]
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
Script must be named like map with party? eg. out01.lua? Script dont tell where I'm only where to go?
Thanks. I suggest remove this post to new theme. Building new maps is completly breakthrough in MM world.
Thanks. I suggest remove this post to new theme. Building new maps is completly breakthrough in MM world.
- J. M. Sower
- Scout
- Posts: 188
- Joined: 25 Jan 2016
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
I tested it and to work it must look like below example. When you save it in out01.lua you can travel by north border of out01 to the south area of out02 in 5 days.
I remember that something was wrong with the entries of directions ( eg . "down" ) and except for travel by north there must by twice entered "down", so try this if something doesn't work:
Or maybe:
Sorry but now I don't have access to my computer and I don't remember too well.
Code: Select all
function events.WalkToMap(t)
if t.LeaveSide == "down" then
t.EnterMap = "out02.odm"
t.EnterSide = "up"
t.Time = 5 -- days
end
end
Code: Select all
function events.WalkToMap(t)
if t.LeaveSide == "down" then
t.EnterMap = "out02.odm"
t.EnterSide = "down"
t.Time = 5 -- days
end
end
Code: Select all
function events.WalkToMap(t)
if t.LeaveSide == "up" then
t.EnterMap = "out02.odm"
t.EnterSide = "up"
t.Time = 5 -- days
end
end
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
Ok, i figured out the problem #3. It looks like the mapstats.txt can read fixed amount of elements. It loads 76 lines, no more and no less (including empty strings). Adding new lines is not a solution, instead you need to rewrite existing strings. Perhaps, hex editor could help that but i'm not strong at it. I've managed to change starting map only via hex editor. Would be great if someone can get size address.
About new lods, with grayface patch you have "00 patch.bitmaps.lod"/games/events etc. It's easier to use these archives rather than original as they are small.
Adding new monsters requires editing Data/Tables/MonList.txt and that's all. If you want custom monsters you need to include monster sprite into sprites.lod and probably include frames into Data/Tables/Sft.txt. Oh, and monster sprites require palette file as well, otherwise they won't load into lod. Here's an live example, i've added wolves from MM8 into MM7.
Anyway, thanks for mentioning this. This explains some things in core lua scripts.
There is good "dump" function (Core/dump.lua). You can trace some functions and tables via debug window (ctrl+f1).
-------------
I got new questions. You can create new map via New button and it will be outdoor map. How do create new indoor map? It's a bit inconvenient but alternative solution is to load internal dungeon map and resave it under your name.
2) Portal problem. It seems i can't connect portals with other rooms. This way player can't see other room (but able to pass trough it). It's alright with internal maps. I've tried editing them and importing as a room and they work fine. But not custom made levels. Can't be sure but i think problem is in PortalList variable that *.blv file(indoor level) possess. In internal maps, two and more rooms with portals have same facet value in PortalList and this is probably why we can see through it. How do you change that? In mm7 editor you can't select portals and edit them.
In game:
In 3d editor:
3) When you edit chests, it says
Ok, adding numbers is fine. But How do correctly set properties and bits for the item?
4) And finally, still having water, setsprite radius and other points mentioned in previous post.
About new lods, with grayface patch you have "00 patch.bitmaps.lod"/games/events etc. It's easier to use these archives rather than original as they are small.
Thanks . I'm not sure about water yet but it shouldn't depend on ground level.Baronus wrote:Stables, shops, taverns, trainings etc. are in exe file codded. To add it you must rewrite it.
Yes I agree. Alternatives files system sprites.mod.lod icons.mod.lod are needed.
To add monsters you must write ddl odl etc. And link it to mapstats...
Water bug I think you must do the same ground level?
Good work. I wish you map will be begin new game based on MMVI-VIII!
This editor is a wonderful thing.
Adding new monsters requires editing Data/Tables/MonList.txt and that's all. If you want custom monsters you need to include monster sprite into sprites.lod and probably include frames into Data/Tables/Sft.txt. Oh, and monster sprites require palette file as well, otherwise they won't load into lod. Here's an live example, i've added wolves from MM8 into MM7.
Damn, there is no reference to WalkToMap event in grayfaces site and only one line in Core/events.lua.J. M. Sower wrote: Ps. I asked the GrayFace about the script that allows you to change the walk destination by the border of the map.)Code: Select all
function events.WalkToMap(t) if t.LeaveSide == "down" then t.EnterMap = "YourMapHere.odm" t.EnterSide = "up" t.Time = 5 -- days end end
Anyway, thanks for mentioning this. This explains some things in core lua scripts.
There is good "dump" function (Core/dump.lua). You can trace some functions and tables via debug window (ctrl+f1).
-------------
I got new questions. You can create new map via New button and it will be outdoor map. How do create new indoor map? It's a bit inconvenient but alternative solution is to load internal dungeon map and resave it under your name.
2) Portal problem. It seems i can't connect portals with other rooms. This way player can't see other room (but able to pass trough it). It's alright with internal maps. I've tried editing them and importing as a room and they work fine. But not custom made levels. Can't be sure but i think problem is in PortalList variable that *.blv file(indoor level) possess. In internal maps, two and more rooms with portals have same facet value in PortalList and this is probably why we can see through it. How do you change that? In mm7 editor you can't select portals and edit them.
In game:
In 3d editor:
3) When you edit chests, it says
Code: Select all
-- "{Number = -1}" or short form "-1" means level 1 item. Level 7 is artifact.
-- Properties: Number, Bonus, BonusStrength, Bonus2, Charges, MaxCharges
-- Bits: Identified, Broken, Hardened, Stolen
4) And finally, still having water, setsprite radius and other points mentioned in previous post.
- J. M. Sower
- Scout
- Posts: 188
- Joined: 25 Jan 2016
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
Unfortunately, I have not worked with portals in dungeons yet.
Map soundtrack id is entered in column named "red book"(or something like that) in MapStats.txt. You must put the music file with the name such as that id number (eg. 12.mp3) in "Music" folder.
I also tried with the addition of new maps and other things but I found it was impossible.
You can change the datas saved in MapStats.txt by scripts like this:
See the "structs.MonstersTxtItem" fields at GrayFace site.
https://sites.google.com/site/sergroj/m ... ersTxtItem
Map soundtrack id is entered in column named "red book"(or something like that) in MapStats.txt. You must put the music file with the name such as that id number (eg. 12.mp3) in "Music" folder.
I also tried with the addition of new maps and other things but I found it was impossible.
You can change the datas saved in MapStats.txt by scripts like this:
Code: Select all
Game.MonstersTxt[1].Name = "Wolf"
https://sites.google.com/site/sergroj/m ... ersTxtItem
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
Yes, documentation is very needed, but it's not my thing, I don't have motivation to do it. There is one important bit missing in the Editor, I overlooked NPC ID variable of monsters, so special monsters would lose their NPC IDs after a map is edited with the editor. Last MMExt version has a huge bug (spells don't do any damage in MM7&8) witch I've fixed, but haven't uploaded the fixed version yet.neutonm wrote:Editor and modding capabilities looks complete, however, the only flaw is documentation. Programmers tend to know every line in their code as well as whole architecture of the product, but not the users . At least it takes some time to dig trough it. So far, i managed to "get it".
Send me the map to test. Must be me setting something wrong.neutonm wrote:1) Water Bug? If i load test.odm map via "Open" button or via internal the water looks like it should. But if i start game and move into test map, the water looks "icy". Is it bug or there are some thing that need to be tweaked? The edges of the lake are animated, the rest are not
Interesting, I'll look into it.neutonm wrote:2) evt.SetSprite radius bug? Again, not sure if this is bug or my flaw. Once the command is executed, sprite is changed but the radius is extended. Trying to implement apple tree (one tree has id #52). Due to extended radius it's hard to drop apple without turning at least 90 degrees away. Before you click on apple tree - the radius thing works fine.
There's 76 maps limit in mapstats.txt, so you'll have to replace one of unused maps for now.neutonm wrote:3) Spawn monsters don't work on new map. I've added new line in MAPSTATS.TXT via "TxtEdit.exe" and placed m1 spawn entity and see no monsters (reuploaded into events.lod)
I think {gold_number, Bonus2 = 500} should do it, although I don't quite remember my format.neutonm wrote:4) Is there a way to put fixed amount of gold into chests besides default item numbers(-1, etc)?
Map.Monsters[ID], Map.Sprites[ID], Map.Objects[ID]. You can tryneutonm wrote: 5) How about decal/monster/whatever getter function in lua? Like local m = GetMonster(ID). So you can edit it with m.Name = "Derp" etc. That apple sprite could be changed this way.
Map.Sprites[52].DecName = "tree37"
That's exactly how it is since patch v2.0. You can see editor.icons.lod and other such lods already. All such lods override original lods and are loaded in order of their names.neutonm wrote: 6) New maps, sprites and thing might mess original lod files. IS there way to load alternatives? like "Mymod.Events.lod" - this way it would be easier to distribute mod rather than merge resources with original archives.
In Mapstats.txt there is a column for that. I'm not sure you can add new music right now.neutonm wrote:8) I couldn't find a music command. New map won't play music from mp3 folder. Where should i specify it?
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
In Maps. Are you sure it has no effect? Did you modify it to make it different than the original script from game?theorclair wrote:What folder would the nwc script go in? I got an error message when I put it in global, and in maps it doesn't have an effect.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
Hex editor won't help. Try this for starting map (haven't tested):neutonm wrote:Perhaps, hex editor could help that but i'm not strong at it. I've managed to change starting map only via hex editor. Would be great if someone can get size address.
Code: Select all
function events.NewGameMap()
Map.Name = "out05.odm"
XYZ(Party, 0, 0, 0)
Party.Angle = 0
Party.LookAngle = 0
end
Code: Select all
Game.NewGameMap = "out05.odm"
I made a program to add new monsters into sft.txt and monlist.txt back in the day for vladimir-maestro. Also don't forget about monsters.txtneutonm wrote: Adding new monsters requires editing Data/Tables/MonList.txt and that's all. If you want custom monsters you need to include monster sprite into sprites.lod and probably include frames into Data/Tables/Sft.txt. Oh, and monster sprites require palette file as well, otherwise they won't load into lod.
Press "New" while you're in an indoor map.neutonm wrote: I got new questions. You can create new map via New button and it will be outdoor map. How do create new indoor map? It's a bit inconvenient but alternative solution is to load internal dungeon map and resave it under your name.
Did you find that PortalList thing in mm8leveleditor?neutonm wrote:2) Portal problem. It seems i can't connect portals with other rooms. This way player can't see other room (but able to pass trough it). It's alright with internal maps. I've tried editing them and importing as a room and they work fine. But not custom made levels. Can't be sure but i think problem is in PortalList variable that *.blv file(indoor level) possess. In internal maps, two and more rooms with portals have same facet value in PortalList and this is probably why we can see through it. How do you change that? In mm7 editor you can't select portals and edit them.
Make sure the vertices have exactly the same coordinates for both rooms and the portal and make sure the portal belongs to one of the rooms. The best way normally is not creating a portal at all, unless the map is based on internal one and thus has such portals. The editor can create portals for you, but having the same vertices in both rooms is essential.
Last edited by Anonymous on 07 Mar 2016, 17:02, 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.
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
Yes, on the map special enter sprites are placed, 'Party Start', Party East, Party West etc.Baronus wrote:Script must be named like map with party? eg. out01.lua? Script dont tell where I'm only where to go?
Maybe, but so far MMEditor and MMExt questions are tied together.Baronus wrote:I suggest remove this post to new theme. Building new maps is completly breakthrough in MM world.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
That's just one of the places. Here's how you'd convert a hex edit change into an MMExt script to be placed in Scripts/General:J. M. Sower wrote:To find the right sequence you should use the trial and error method. I managed to determine where the date is written in MM8. It is in line 00092340 and in positions B and C.
Code: Select all
mem.IgnoreProtection(true) -- at the start of the script, only needed if you change constant data
mem.i2[0x492340] = 1034 -- 'i2' means 'signed 2-byte integer'
mem.IgnoreProtection(false) -- at script's end, only needed if you change constant data
I'll add the ability to change starting year.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
J. M. Sower wrote:How to change the home position after the death of the team on current map?
Code: Select all
function events.DeathMap(t)
t.Name = "out05.odm"
XYZ(Party, 0, 0, 0)
Party.Angle = 0
Party.LookAngle = 0
end
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
BTW, note that I can render outdoor maps like these in Blender and raster editor:
These aren't final quality though. I'll share the process when it's needed. For now it involves Corel Photo-Paint, but I want to make it require just GIMP instead.
These aren't final quality though. I'll share the process when it's needed. For now it involves Corel Photo-Paint, but I want to make it require just GIMP instead.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
There is no easy way ad new monster see:
https://www.celestialheavens.com/forum/10/15964
Other important question...
How to synchronize added in new map buildings with 3Devents table?
How to add shops stables and other special buildings?
You can add shop animation but no buy only sell.
How to programmed special building functions?
If we will know it we can build new game!
Ok we can write in this topic but if it will be 50 pages it will be hard find something.
Better thing is topic ,,Mapmaking". In this MMExt questions.
https://www.celestialheavens.com/forum/10/15964
Other important question...
How to synchronize added in new map buildings with 3Devents table?
How to add shops stables and other special buildings?
You can add shop animation but no buy only sell.
How to programmed special building functions?
If we will know it we can build new game!
Ok we can write in this topic but if it will be 50 pages it will be hard find something.
Better thing is topic ,,Mapmaking". In this MMExt questions.
- theorclair
- Peasant
- Posts: 66
- Joined: 18 Jun 2013
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
I get an error message:GrayFace wrote:In Maps. Are you sure it has no effect? Did you modify it to make it different than the original script from game?theorclair wrote:What folder would the nwc script go in? I got an error message when I put it in global, and in maps it doesn't have an effect.
..gram Files\Might and Magic VI\Scripts\Global\nwc.lua:22: attempt to index field 'map' (a nil value)
stack traceback:
(tail call): ?
...gram Files\Might and Magic VI\Scripts\Global\nwc.lua:22: in main chunk
local variables:
(*temporary) = nil
(*temporary) = (function: 0155E900)
(*temporary) = "attempt to index field 'map' (a nil value)"
I changed some of the item numbers to different ones. However, when I changed them back I still get this.
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
No you don't. In Maps.theorclair wrote:I get an error message:
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.
- theorclair
- Peasant
- Posts: 66
- Joined: 18 Jun 2013
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
I've done that, and there's no more error message, but when I try to change the items there's no effect.
- J. M. Sower
- Scout
- Posts: 188
- Joined: 25 Jan 2016
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
Script for respawn should look like this example (Party.Direction instead Party.Angle):
Otherwise I checked and it is working correctly script for travel to south area of out02 (by the northern border of current map):
I typed it in the Scripts/General/moded.lua and the game crashes when I click on a new game.
I did the minimap in Photoshop using renders from Blender and I achieved such an effect:
Code: Select all
function events.DeathMap(t)
t.Name = "out01.odm"
XYZ(Party, 3850, 5620, 704)
Party.Direction = 516
Party.LookAngle = 0
end
Code: Select all
function events.WalkToMap(t)
if t.LeaveSide == "down" then
t.EnterMap = "out02.odm"
t.EnterSide = "down"
t.Time = 5 -- days
end
end
Code: Select all
mem.IgnoreProtection(true)
mem.i2[0x492340] = 1158
mem.IgnoreProtection(false)
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
Good work! I see all new map! I wish you make new M&M game :-)
I think that it should be:
function events.WalkToMap(t)
if t.LeaveSide == "down" then
t.EnterMap = "out01.odm"
t.EnterSide = "up"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "down" then
t.EnterMap = "out02.odm"
t.EnterSide = "up"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "left" then
t.EnterMap = "out03.odm"
t.EnterSide = "right"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "right" then
t.EnterMap = "out04.odm"
t.EnterSide = "left"
t.Time = 5 -- days
end
end
For 4 sides of world.
If you go down from map you go UP to new map! And reverse. If left you enter right side new map.
I think that it should be:
function events.WalkToMap(t)
if t.LeaveSide == "down" then
t.EnterMap = "out01.odm"
t.EnterSide = "up"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "down" then
t.EnterMap = "out02.odm"
t.EnterSide = "up"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "left" then
t.EnterMap = "out03.odm"
t.EnterSide = "right"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "right" then
t.EnterMap = "out04.odm"
t.EnterSide = "left"
t.Time = 5 -- days
end
end
For 4 sides of world.
If you go down from map you go UP to new map! And reverse. If left you enter right side new map.
- J. M. Sower
- Scout
- Posts: 188
- Joined: 25 Jan 2016
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
But it works well when you write like me. I do not know why, but you must enter twice "down" to travel by north border to south area, and adequately to this you must write twice "up" to travel by south border to north area e.t.c. I tested it and it worked properly only then.Baronus wrote: For 4 sides of world.
If you go down from map you go UP to new map! And reverse. If left you enter right side new map.
Ps. You can see more of my work on this Polish forum:
http://www.forum.acidcave.net/topic.php?TID=2969&page=1
Last edited by Anonymous on 25 Mar 2016, 11:02, edited 1 time in total.
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
function events.WalkToMap(t)
if t.LeaveSide == "up" then
t.EnterMap = "out01.odm"
t.EnterSide = "up"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "down" then
t.EnterMap = "out02.odm"
t.EnterSide = "down"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "right" then
t.EnterMap = "out03.odm"
t.EnterSide = "right"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "left" then
t.EnterMap = "out04.odm"
t.EnterSide = "left"
t.Time = 5 -- days
end
end
Edited.
In your buildings you have shops stables and people?
if t.LeaveSide == "up" then
t.EnterMap = "out01.odm"
t.EnterSide = "up"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "down" then
t.EnterMap = "out02.odm"
t.EnterSide = "down"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "right" then
t.EnterMap = "out03.odm"
t.EnterSide = "right"
t.Time = 5 -- days
end
function events.WalkToMap(t)
if t.LeaveSide == "left" then
t.EnterMap = "out04.odm"
t.EnterSide = "left"
t.Time = 5 -- days
end
end
Edited.
In your buildings you have shops stables and people?
- J. M. Sower
- Scout
- Posts: 188
- Joined: 25 Jan 2016
Re: MMExtension v2.0 + MMEditor v2.0 Level Editor [Sep 21, 2015]
Yes, but I just replace the original map out 01 so I only use the buildings from the original map. Download the decompiled scripts from this page and open out01.txt. There is full list of events are responsible for visiting the buildings, or just showing their names (when you move the cursor on it). In MMEditor you must select some facets of building model (eg. the facets with textures of doors), click "Edit" button (or "E" key), change "Event" value from "0" to chosen, and click Ctrl+Enter to approve. Also, if you want the door to be fully functional you must change "TriggerByClick" equal to "true". Normal walls of buildings leave with "TriggerByClick = false". Just add them right event.
So it is not necessary, but you may add completly new events for buildings.
Also you can use that:
From what I determined, it is not possible to add completly new stores/stables/taverns and other special buildings.
Ps. This is script to move NPC to chosen house
So it is not necessary, but you may add completly new events for buildings.
Code: Select all
evt.hint[250] = "Ewan's house" -- event 250 for walls of Ewan's house - only show text when cursor on it
evt.house[251] = 500 -- assigning event 251 to idhouse 500
Game.Houses[500].Name = "Ewan's house entrance" -- assigning text showed when cursor on doors
Code: Select all
evt.str[120] = "Ewan's house"
evt.hint[250] = evt.str[120] -- event 250 show text from str120 when cursor on it
Ps. This is script to move NPC to chosen house
Code: Select all
evt.MoveNPC(43, 107)
Last edited by Anonymous on 07 Mar 2016, 21:10, edited 1 time in total.
Who is online
Users browsing this forum: Bing [Bot] and 35 guests