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).
Rodril
Swordsman
Swordsman
Posts: 556
Joined: 18 Nov 2016

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

Unread postby Rodril » 03 Apr 2019, 17:30

BTB wrote:Am I able to add strings to this as necessary, or am I limited to only the blank spots that I have?
In mm7 you are limited, i don't rememeber if you can use blank spots, probably yes. In mm8 (in merge mod) this limit is removed.
BTB wrote:It's also making me want to go back and look a the RemoveItemsLimits.lua script again and see if I can learn anything from it... except it no longer seems to be available on Dropbox (very likely because you've since put up a new version). Any chance you can re-post it?
Yes, but barely it will be helpfull, mostly it consist of asm injections: https://www.dropbox.com/s/cot9oz2zhjqy1 ... s.lua?dl=0
BTB wrote:(Another question... Grayface had also mentioned that it should be easy to get white barrels to randomly show up alongside the others, but he never mentioned how. Is this something you know how to implement? Similarly, for the various contests I want to *remove* the random factor and simply have each one be set so that you're guaranteed to run across one of each. Is THAT doable?)
Should be. There's few examples how to modify sprite's events on GrayFace's site: https://grayface.github.io/mm/ext/ref/# ... k-up-(MM8)

User avatar
BTB
Peasant
Peasant
Posts: 93
Joined: 21 Aug 2011
Location: Houston, TX
Contact:

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

Unread postby BTB » 03 Apr 2019, 17:56

Thank you! For right now, I'm really just wanting to look at it and see if I can figure out what it's doing since I'm still learning .lua.

(I'm ALSO holding out the hope that the potion structure is similar enough in MM7/MM8 that editing potion effects in MM7 should be a simple matter of isolating the relevant code in this script and then finding the correct offsets in MM7.exe. Feel free to tell me I'm diseased in the head if that's not the case >.>)

Looking at the examples on GitHub now... looks like the relevant (helpful) code is:

Code: Select all

local function InitBarrel(i, a)
	mapvars.Barrels = mapvars.Barrels or {}
	mapvars.Barrels[i] = mapvars.Barrels[i] or math.random(1, 7)
	
	a.Event = SpriteEvents + i
	evt.map[SpriteEvents + i] = Barrel
	evt.hint[SpriteEvents + i] = Game.NPCTopic[TopicBase + Reorder[mapvars.Barrels[i]]]
end
So... I GUESS what's happening here is that this is the global barrel initialization code. But this is a bit more advanced and I'm not sure exactly what's happening here outside of the fact that (1, 7) tells me that it is including white barrels (presumably this is 1, 6 by default?).
"You don't have to be a vampire to die like one... bitch." -Simon Belmont

User avatar
BTB
Peasant
Peasant
Posts: 93
Joined: 21 Aug 2011
Location: Houston, TX
Contact:

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

Unread postby BTB » 05 Apr 2019, 18:21

Also curious... what are the odds that +Stat bonuses could be flagged by the system as unstackable like +Skill bonuses are? Would let me balance around higher (i.e. much more useful) boosts earlier on without things going completely off the rails later on.

I suppose the alternative would be to have a global script capping the stat bonus from equipment... except I don't know if the script can tell the difference between stat boosts from equipment and from other sources?
Last edited by BTB on 05 Apr 2019, 18:26, edited 1 time in total.
"You don't have to be a vampire to die like one... bitch." -Simon Belmont

Rodril
Swordsman
Swordsman
Posts: 556
Joined: 18 Nov 2016

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

Unread postby Rodril » 07 Apr 2019, 08:27

BTB wrote:So... I GUESS what's happening here is that this is the global barrel initialization code. But this is a bit more advanced and I'm not sure exactly what's happening here outside of the fact that (1, 7) tells me that it is including white barrels (presumably this is 1, 6 by default?).
You'll need to inspect whole code example, it converts trees into barrels. System which spread randomly barrel events is hardcoded, i don't know way to change it in MM7 engine, i have not looked.
BTB wrote:I suppose the alternative would be to have a global script capping the stat bonus from equipment... except I don't know if the script can tell the difference between stat boosts from equipment and from other sources?
You can use this event for that task: https://grayface.github.io/mm/ext/ref/# ... nusByItems
It gets table as parameter, you can analyze "Result" filed and cap it.

User avatar
BTB
Peasant
Peasant
Posts: 93
Joined: 21 Aug 2011
Location: Houston, TX
Contact:

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

Unread postby BTB » 08 Apr 2019, 19:27

Rodril wrote:You can use this event for that task: https://grayface.github.io/mm/ext/ref/# ... nusByItems
It gets table as parameter, you can analyze "Result" filed and cap it.
I see the pieces... sort of. But I don't see how they fit together. My best guess is:

Code: Select all

evt.CalcStatBonusByItems (Result)
But I don't think that's right.
"You don't have to be a vampire to die like one... bitch." -Simon Belmont

Rodril
Swordsman
Swordsman
Posts: 556
Joined: 18 Nov 2016

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

Unread postby Rodril » 09 Apr 2019, 05:44

BTB wrote:I see the pieces... sort of. But I don't see how they fit together. My best guess is:
Here are examples how to use events in MMExt (third one is what you need): https://grayface.github.io/mm/ext/ref/#Artifact-Bonuses
You have to check if t.Stat is equal to stat, cap of which you want to alter, and if it is equal - change t.Result.

User avatar
BTB
Peasant
Peasant
Posts: 93
Joined: 21 Aug 2011
Location: Houston, TX
Contact:

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

Unread postby BTB » 09 Apr 2019, 23:54

Code: Select all

function events.CalcStatBonusByItems(t)
	if t.Stat > 50 then
		for it in t.Player:EnumActiveItems() do
			t.Result = 50
		end
	end
end
Is this what I'm after, then?
"You don't have to be a vampire to die like one... bitch." -Simon Belmont

Rodril
Swordsman
Swordsman
Posts: 556
Joined: 18 Nov 2016

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

Unread postby Rodril » 10 Apr 2019, 05:23

BTB wrote:Is this what I'm after, then?
No, t.Stat is numerical code of Stat, 0 is Might, 1 is Intellect, etc: https://grayface.github.io/mm/ext/ref/#const.Stats
And if you want to cap all stats, there's no need to traverse through items, this should work:

Code: Select all

function events.CalcStatBonusByItems(t)
	if t.Result > 50 then
		t.Result = 50
	end
end

User avatar
BTB
Peasant
Peasant
Posts: 93
Joined: 21 Aug 2011
Location: Houston, TX
Contact:

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

Unread postby BTB » 10 Apr 2019, 21:56

Well, damn, that makes life a lot easier.

On a similar note... how much of the contents of 2dEvents.txt controls the wares (types and treasure levels) of a shop and how much of that is hard-coded? It's one of the few text files I can't really make much sense of.
"You don't have to be a vampire to die like one... bitch." -Simon Belmont

Rodril
Swordsman
Swordsman
Posts: 556
Joined: 18 Nov 2016

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

Unread postby Rodril » 13 Apr 2019, 06:24

BTB wrote:On a similar note... how much of the contents of 2dEvents.txt controls the wares (types and treasure levels) of a shop and how much of that is hard-coded? It's one of the few text files I can't really make much sense of.
2DEvents.txt does not allow this. You'll need MM7 version of "RemoveHouseRulesLimits.lua" script, it will generate "House rules.txt" in "Data\Tables" folder, where you can change quality and type of items for each shop. Problem is version for MM7 is not debugged at all. Put it into "Scripts\Structs" folder. Links:
Simple version (does not remove limits): https://www.dropbox.com/s/tmp4gja52kgvt ... s.lua?dl=0
Full version: https://www.dropbox.com/s/a9ox5a86v6xws ... s.lua?dl=0
Structure map for console: https://www.dropbox.com/s/guwqn8vtn21o6 ... p.txt?dl=0

User avatar
BTB
Peasant
Peasant
Posts: 93
Joined: 21 Aug 2011
Location: Houston, TX
Contact:

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

Unread postby BTB » 13 Apr 2019, 08:03

Thanks! I'm not entire sure about the "limits" verbiage... what exactly do you mean by removing them?
Last edited by BTB on 13 Apr 2019, 10:14, edited 2 times in total.
"You don't have to be a vampire to die like one... bitch." -Simon Belmont

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 » 13 Apr 2019, 10:35

BTB wrote:Thanks! I'm not entire sure about the "limits" verbiage... what exactly do you mean by removing them?
Means you'll be able to edit existing houses, but not add new ones or only add a few.
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: 556
Joined: 18 Nov 2016

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

Unread postby Rodril » 14 Apr 2019, 10:54

I have question regarding portals in dungeons.
Whenever i'm trying to "Import rooms" from custom .obj file I'm getting this error:

Code: Select all

——————————————————————————————————————————————————————————————————————————————————
...II - Day of the Destroyer\Scripts\Global\Editor Base.lua:437: attempt to index local 'p' (a nil value)

stack traceback:
	...II - Day of the Destroyer\Scripts\Global\Editor Base.lua:437: in function 'MatchesOrientation'
	...III - Day of the Destroyer\Scripts\Global\Editor BSP.lua:372: in function 'UpdatePortalRooms'
	... - Day of the Destroyer\Scripts\Global\Editor Import.lua:602: in function 'LoadObj'
	...III - Day of the Destroyer\Scripts\Global\Editor GUI.lua:273: in function 'Import'
	...III - Day of the Destroyer\Scripts\Global\Editor GUI.lua:287: in function <...III - Day of the Destroyer\Scripts\Global\Editor GUI.lua:286>
	[C]: in function 'pcall'
	Scripts/Core/Common.lua:102: in function 'pcall2'
	...III - Day of the Destroyer\Scripts\Global\Editor GUI.lua:114: in function 'GUICommand'
	...III - Day of the Destroyer\Scripts\Global\Editor GUI.lua:99: in function <...III - Day of the Destroyer\Scripts\Global\Editor GUI.lua:98>
	[C]: in function 'pcall'
	Scripts/Core/Common.lua:102: in function 'pcall2'
	Scripts/Core/RSMem.lua:1653: in function <Scripts/Core/RSMem.lua:1650>

arguments of 'MatchesOrientation':
	p = nil
	rfacets = (table: 0x224df6f0)

local variables of 'MatchesOrientation':
	(*temporary) = (function: 0x224e7080)
	(*temporary) = 3
	(*temporary) = nil
	(*temporary) = nil
	(*temporary) = 3
	(*temporary) = (function: builtin#4)
	(*temporary) = (table: 0x2b3e7e90)
	(*temporary) = nan
	(*temporary) = (table: 0x21cfc220)
	(*temporary) = (table: 0x21cfc220)
	(*temporary) = true
	(*temporary) = (table: 0x21cfc220)
	(*temporary) = 102
	(*temporary) = 2
	(*temporary) = 4
	(*temporary) = (table: 0x2b1d3a90)
	(*temporary) = "102 80 89 101"
	(*temporary) = nil
	(*temporary) = (table: 0x21cfc220)
	(*temporary) = "attempt to index local 'p' (a nil value)"
----------------------------------------------------------------------------------
File i'm trying to import: https://www.dropbox.com/s/fkfc6wxgrkqwx ... s.obj?dl=0 .
Have not found solution yet, maybe someone met this issue before?

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 » 15 Apr 2019, 03:37

Rodril wrote:Whenever i'm trying to "Import rooms" from custom .obj file I'm getting this error
Must be a bug of old MMEditor version. Use this one:
https://www.dropbox.com/s/l1ch92ulz24bj ... l.rar?dl=1
https://www.dropbox.com/s/qu6v9q2nhvwb2 ... g.rar?dl=1
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

User avatar
BTB
Peasant
Peasant
Posts: 93
Joined: 21 Aug 2011
Location: Houston, TX
Contact:

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

Unread postby BTB » 15 Apr 2019, 07:40

GrayFace wrote:
BTB wrote:Thanks! I'm not entire sure about the "limits" verbiage... what exactly do you mean by removing them?
Means you'll be able to edit existing houses, but not add new ones or only add a few.
Gotcha.

I've been coming around and actually managing to figure out how to use use MME lately (would have stonewalled almost immediately without Rodril's help), and things are looking really positive for me being able to do most of what I'm after. I had a slightly larger list the last time I asked you specifically about it, but honestly it's down to just three things that I don't believe MME currently has hooks for: potion effects, weapon/armor skill level bonuses, and changing spell effects.

Changing potion effects is technically already DONE... at least, for MM8. Was hoping that applying what's been done there is as simple as finding the correct offsets in MM7.

Weapon and armor skill level perks is something I recall you mentioning in the past as something you intended to add hooks for later on... was that ever done or is that still TBD?

Changing spell schools/effects is probably the hardest one, though I don't intend to use any effects/animations that aren't currently existing... just move some stuff around and tweak a few effect durations here and there.
"You don't have to be a vampire to die like one... bitch." -Simon Belmont

User avatar
DaveHer
Threeheaded Knight
Threeheaded Knight
Posts: 512
Joined: 13 Mar 2019

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

Unread postby DaveHer » 15 Apr 2019, 11:22

I came to the form to reply. Thanks for the link.
Yes. Thanks for your reply and also decompiling Evt files with the script you have at that site seems to work only for MM8. I get an error messages when I try it with the others, MM6 & MM7. I will get the image for that console error as soon as possible. I use two types of formats for the quests, the lua (which is your example) and the EVT format (the one that go into the goble.evt). The lua is the one that cause the problem. How do I attack the image to the reply? I don't see a button to attach an image. Thanks. I did not know you had a forum for MMExtension. I used EVT format because I could not remove items from inventories. These 010Editor templates are at the MMExtion forum? If I leave the "KeepQuestItem = true, I don't get an error message and the quest is finished. Yes it is more convenient to use the lua format except for that error. You don't have to edit 5 files to make a quest.
David

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 » 15 Apr 2019, 13:30

DaveHer wrote:I did not know you had a forum for MMExtension.
Just place the cursor above the bottom line of the console, press Ctrl+A and Copy-Paste everything.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

User avatar
DaveHer
Threeheaded Knight
Threeheaded Knight
Posts: 512
Joined: 13 Mar 2019

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

Unread postby DaveHer » 15 Apr 2019, 15:09

——————————————————————————————————————————————————————————————————————————————————
Scripts/Core/EventsList.lua:68: ...O\Might and Magic VI\Scripts\Structs\After\Functions.lua:147: attempt to call field 'Sub' (a nil value)

stack traceback:
...O\Might and Magic VI\Scripts\Structs\After\Functions.lua: in function 'TakeItemFromParty'
...Magic VI\Scripts\Structs\After\LocalizationAndQuests.lua:564: in function <...Magic VI\Scripts\Structs\After\LocalizationAndQuests.lua:543>

arguments of 'TakeItemFromParty':
(*temporary) = 96
(*temporary) = nil

local variables of 'TakeItemFromParty':
(*temporary) = 0
(*temporary) = 3
(*temporary) = 1
(*temporary) = 0
(*temporary) = nil
(*temporary) = "Inventory"
(*temporary) = 96
(*temporary) = 5.7318419952496e-313
(*temporary) = "attempt to call field 'Sub' (a nil value)"

stack traceback:
[builtin#19]: at 0x02ac5960
...Magic VI\Scripts\Structs\After\LocalizationAndQuests.lua:319: in function 'v'
Scripts/Core/EventsList.lua:68: in function <Scripts/Core/EventsList.lua:63>

arguments of 'v':
evtId = 500
seq = 0

local variables of 'v':
t = (table: 0x02ebdf70)

upvalues of 'v':
CurrentNPC = 11
CurrentQuests = (table: 0x0cb97198)
UpdateCurrentQuests = (function: 0x0c1a5710)
----------------------------------------------------------------------------------
>Here it is. What a dummy I am.
Last edited by DaveHer on 15 Apr 2019, 15:10, 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 » 15 Apr 2019, 15:43

I decided to fix it right in v2.2 without any version change: https://www.dropbox.com/s/qohxt8ijjh74m ... p.rar?dl=1
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

User avatar
DaveHer
Threeheaded Knight
Threeheaded Knight
Posts: 512
Joined: 13 Mar 2019

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

Unread postby DaveHer » 15 Apr 2019, 17:02

GrayFace wrote:I decided to fix it right in v2.2 without any version change: https://www.dropbox.com/s/qohxt8ijjh74m ... p.rar?dl=1
Thanks. I will try it right away. :applause:
It Works! :tsup:
Last edited by DaveHer on 15 Apr 2019, 17:06, edited 1 time in total.


Return to “Might and Magic”

Who is online

Users browsing this forum: tolich and 45 guests