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

The role-playing games (I-X) that started it all and the various spin-offs (including Dark Messiah).

Moderator: Moderators

User avatar
J. M. Sower
Pixie
Pixie
Posts: 141
Joined: 25 Jan 2016

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

Postby J. M. Sower » Apr 2 2018, 8:48

Rodril wrote:No, limits of GlobalTxt have not been removed, why would you need it? I have not noticed any special functionality of GlobalTxt items, new lines can be stored in NPCText with same effect, or right in scripts, i think.

It will be usefull because of special polish characters. Sometimes if text isn't loaded from Str, Global.txt etc. special characters are not showed correctly.

Rodril wrote:There is outdated part of script at lines 1252 - 1257, it was supposed to shrink amount of required memory for new dolls by excluding from item-handle mechanics ones that can not use armors at all (like dragons). I have not played with new dolls a lot, can not say if excluding armorless dolls have any sense now.
To make it work: comment or remove 1252-1257 lines of code in RemoveItemsLimits.lua (or download one from mm678 files), don't forget to add extra columns to "Complex items pictures.txt" (t4, t5).

Something is wrong. In lines 1252-1257 in my "RemoveItemsLimits.lua" I have this:

Code: Select all

      local Words, CurId, Am
      local IsCloak = false
      local Counter, CloakCounter = 0, 0

      LineIt()
      LineIt()

... and in "RemoveItemsLimits.lua" from MM678 is this:

Code: Select all

         end
      end
   end

   ---- Items extra
   local ItemsExtraData = mem.StaticAlloc(Game.ItemsTxt.count*4)

If I would remove this parts game will return error at start.
Last edited by J. M. Sower on Apr 2 2018, 9:09, edited 1 time in total.

Rodril
Scout
Scout
Posts: 173
Joined: 18 Nov 2016

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

Postby Rodril » Apr 2 2018, 22:59

These lines should be commented, i've done it, redownload script, please, tell if it works.

Code: Select all

   for i = 0, Game.CharacterDollTypes.count - 1 do
      local a = Game.CharacterDollTypes[i]
      if not (a.Armor or a.Helm or a.Belt or a.Boots or a.Cloak) then
         TypesCount = TypesCount - 1
      end
   end

User avatar
J. M. Sower
Pixie
Pixie
Posts: 141
Joined: 25 Jan 2016

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

Postby J. M. Sower » Apr 3 2018, 16:13

Rodril wrote:These lines should be commented, i've done it, redownload script, please, tell if it works.

Code: Select all

   for i = 0, Game.CharacterDollTypes.count - 1 do
      local a = Game.CharacterDollTypes[i]
      if not (a.Armor or a.Helm or a.Belt or a.Boots or a.Cloak) then
         TypesCount = TypesCount - 1
      end
   end

I copied script from newest MM678 and unfortunately it still looks like that:
Image

Rodril
Scout
Scout
Posts: 173
Joined: 18 Nov 2016

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

Postby Rodril » Apr 3 2018, 21:32

Have you tried anything besides armors? Boots, helemts? Does these have problems too? Also, have you made image with "v5a" postfix? "a" used for armor variation when character does not have weapon in main hand.

User avatar
J. M. Sower
Pixie
Pixie
Posts: 141
Joined: 25 Jan 2016

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

Postby J. M. Sower » Apr 4 2018, 15:37

Rodril wrote:Have you tried anything besides armors? Boots, helemts? Does these have problems too? Also, have you made image with "v5a" postfix? "a" used for armor variation when character does not have weapon in main hand.

Finally! It works with postfix. Thanks!

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

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

Postby BTB » May 24 2018, 8:32

BTB wrote:Hey, everyone... just popping in for my annual checkup on how this utility is progressing. Last I left off, there were a couple of key features that I was interested in that had yet to see implementation:

-Ability to change effects of potions (i.e. make "Restore MP" a compound potion instead of a basic one).
-Ability to edit bonuses on artifacts/relics
-Ability to edit skill levels/schools of spells (i.e. make Charm a basic-level mind spell and make Stun a Mind spell instead of Earth)

Have either of these become possible over the last year or so?


Hmm... doesn't look like Grayface has been around lately and this got buried. Here's to hoping he sees this.
"You don't have to be a vampire to die like one... *****." -Simon Belmont

Rodril
Scout
Scout
Posts: 173
Joined: 18 Nov 2016

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

Postby Rodril » May 27 2018, 15:24

BTB wrote:-Ability to change effects of potions (i.e. make "Restore MP" a compound potion instead of a basic one).
-Ability to edit bonuses on artifacts/relics

You can achieve these with existing "RemoveItemsLimits" script ( https://www.dropbox.com/s/7vp7ouh73ugv3 ... s.lua?dl=0 ), put it into "...Scripts\Structs" folder. Here is video explanation of it's capabilities: https://youtu.be/lipriutf3SI (unfortunately i've run out of space in my dropbox).
I don't know the way to directly edit existing bonuses of artifacts, because they are not stored somewhere, it is just special behaivor in casual situations if player wears item. But it is possible to replace them, there is example in video and example of rescripting mm6/7 artifact effects here: https://www.dropbox.com/s/un2t1aw7xzrl0 ... s.lua?dl=0
BTB wrote:Ability to edit skill levels/schools of spells (i.e. make Charm a basic-level mind spell and make Stun a Mind spell instead of Earth)

I don't know how to do it at the moment.
Last edited by Rodril on Jun 1 2018, 0:34, edited 1 time in total.

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

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

Postby BTB » May 30 2018, 18:49

Ooh, this is very nice! I can see the relevant snippet in what you posted for potions, but I wouldn't know where to begin editing it. Could you show me an example edit?
"You don't have to be a vampire to die like one... *****." -Simon Belmont

Rodril
Scout
Scout
Posts: 173
Joined: 18 Nov 2016

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

Postby Rodril » Jun 1 2018, 0:32

Seems, file host has not handle the video, i've uploaded it to Youtube: https://youtu.be/lipriutf3SI .
I've forgot to mention, this script works only with MM8.
Script generates few new tables in "...Data\Tables folder", one of them is "Potion settings.txt", something can be edit there.
Also there is new array in game - evt.PotionEffects . It consist of functions, indexed according to "Pot Id" column of TXT file. How it works: when player uses potion (drink it or uses on other item), if evt.PotionEffects have function at index of this potion, function will be executed, if function returns "true" original behaivor of potion is bypassed.
Here is example, effect is senseless, just to see it in action:

Code: Select all

-- According to "Potion settings.txt", 1 is item 221 - catalyst potion
evt.PotionEffects[1] = function(IsDrunk, Target, Power)
 -- IsDrunk - true if player drinks potion, false - if potion used on item
 -- Target - Player structure if IsDrunk == true, otherwise Item structure
 -- Power - number - power of potion
   if IsDrunk then
      Target.HP = Target.HP/2
   else
      Item.Broken = true -- note, first you have to allow potion to be used on items in "Potion settings.txt"
   end
   
   return true -- don't execute usual effect
end

More detailed explanation is in video, i'm sure it is possible to watch it now.

seregavlg
Leprechaun
Leprechaun
Posts: 3
Joined: 14 Jun 2018

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

Postby seregavlg » Jun 14 2018, 7:39

Hi, how can i fix that:
Might and Magic VI\Scripts\Global\Hand2Weapon.lua:11: memory at address 412C8D of size 4 cannot be written to

stack traceback:
[C]: in function 'error'
Scripts/Core/RSMem.lua:323: in function 'write_error'
Scripts/Core/RSMem.lua:356: in function 'Protect'
Scripts/Core/RSMem.lua:479: in function '__newindex'
D:\Games\Might and Magic VI\Scripts\Global\Hand2Weapon.lua:11: in function 'SetWeaponOffsets'
D:\Games\Might and Magic VI\Scripts\Global\Hand2Weapon.lua:21: in main chunk

arguments of '__newindex':
t = (table: 0x00ace570)
a = 4271245
v = 593

upvalues of '__newindex':
assertnum = (function: 0x00f3a3c8)
Protect = (function: 0x00ad3b50)
size = 4
ffi = (table: 0x00ae8fa0)
type = "int32_t*"
Unprotect = (function: 0x00adc510)

seregavlg
Leprechaun
Leprechaun
Posts: 3
Joined: 14 Jun 2018

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

Postby seregavlg » Jun 14 2018, 7:40

and after ALT+F1:
Might and Magic VI/Scripts/Core/events.lua:50: attempt to call field 'IgnoreProtection' (a boolean value)

stack traceback:
D:\Games\Might and Magic VI/Scripts/Core/events.lua: in function <D:\Games\Might and Magic VI/Scripts/Core/events.lua:40>
D:\Games\Might and Magic VI/Scripts/Core/events.lua:60: in function 'Switch'
...es\Might and Magic VI\Scripts\Global\Editor Navigate.lua:679: in function 'v'
Scripts/Core/EventsList.lua:68: in function 'docall'
Scripts/Core/EventsList.lua:111: in function 'EditorSelectionChanged'
...es\Might and Magic VI\Scripts\Global\Editor Navigate.lua:111: in function 'SetWorkMode'
D:\Games\Might and Magic VI\Scripts\Global\Editor GUI.lua:219: in function 'Editor'
D:\Games\Might and Magic VI\Scripts\Global\Editor GUI.lua:41: in function 'v'
Scripts/Core/EventsList.lua:68: in function <Scripts/Core/EventsList.lua:63>

arguments of 'D:\Games\Might and Magic VI/Scripts/Core/events.lua':
(*temporary) = false

local variables of 'D:\Games\Might and Magic VI/Scripts/Core/events.lua':
(*temporary) = true
(*temporary) = true
(*temporary) = 1
(*temporary) = nil
(*temporary) = "attempt to call field 'IgnoreProtection' (a boolean value)"

upvalues of 'D:\Games\Might and Magic VI/Scripts/Core/events.lua':
delmem = 11142578
delhook = nil
addr = 4804386
mine = "鋶`\0"
std = "‹F\28öÄ "
size1 = 6

seregavlg
Leprechaun
Leprechaun
Posts: 3
Joined: 14 Jun 2018

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

Postby seregavlg » Jun 18 2018, 7:19

ok, done

User avatar
J. M. Sower
Pixie
Pixie
Posts: 141
Joined: 25 Jan 2016

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

Postby J. M. Sower » Jun 22 2018, 6:27

I wonder if there is a possibility to add some soundtrack to the character selection screen. What do you think?

fr3aksh0w
Leprechaun
Leprechaun
Posts: 4
Joined: 16 Oct 2018

Re: debug start failure

Postby fr3aksh0w » Oct 16 2018, 10:55

Hi,
I can't get the game to start with these tools (I want to play 678 merge). I get debug console with following information:
——————————————————————————————————————————————————————————————————————————————————
...estroyer\Scripts\Structs\After\LocalizationAndQuests.lua:564: use of unknown global variable "TakeItemFromParty" after _KNOWNGLOBALS_F declaration

stack traceback:
[C]: in function 'error'
Scripts/Core/RSNoGlobals.lua:602: in function 'dofile'
Scripts\Core\main.lua:484: in main chunk

arguments of 'dofile':
fname = "C:\\GOG Games\\Might and Magic VIII - Day of the Destroyer\\Scripts\\Structs\\After\\LocalizationAndQuests.lua"

local variables of 'dofile':
f = nil
err = "...estroyer\\Scripts\\Structs\\After\\LocalizationAndQuests.lua:564: use of unknown global variable \"TakeItemFromParty\" after _KNOWNGLOBALS_F declaration"

upvalues of 'dofile':
loadfile = (function: 0x003d56d0)
error = (function: builtin#19)
----------------------------------------------------------------------------------

I know nothing of coding but seems like a script is missing? dunno :/
any ideas?

User avatar
GrayFace
Pit Lord
Pit Lord
Posts: 1210
Joined: 29 Nov 2005

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

Postby GrayFace » Nov 12 2018, 18:57

fr3aksh0w, the merge includes everything already.
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
Pixie
Pixie
Posts: 141
Joined: 25 Jan 2016

Postby J. M. Sower » Dec 4 2018, 20:14

GrayFace, can you help me? I am wonder about LUA function in M&M that simulates pressing chosen keyboard button, but I have read that I need to write some C library and import functions from it to the LUA script... uh... from what I saw I think it is too hard task for me, but it would be very, very useful...
Last edited by J. M. Sower on Dec 4 2018, 20:17, edited 2 times in total.

User avatar
GrayFace
Pit Lord
Pit Lord
Posts: 1210
Joined: 29 Nov 2005

Re:

Postby GrayFace » Dec 5 2018, 21:42

What sort of buttons do you want to press?
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
Pixie
Pixie
Posts: 141
Joined: 25 Jan 2016

Re: Re:

Postby J. M. Sower » Dec 6 2018, 7:17

GrayFace wrote:What sort of buttons do you want to press?

Mainly exit button from spell book. I have tried some ways but I can't close this window with scripts... I'm trying to add new spells ;) But not "really" new spells, if you would look at the code. They will be good illusion, but made in completly new system.

At this time I try to make the "aiming" screen for some spells. I have made spell that changes clicked monster to another one (friendly), but I'm struggling with Game.Paused and unfortunetly Mouse.SetIcon(Icon = "MICON2") is closing my game... Maybe there is some way to run original aiming screen for own purposes, without recreating it?
Last edited by J. M. Sower on Dec 6 2018, 11:11, edited 1 time in total.

User avatar
J. M. Sower
Pixie
Pixie
Posts: 141
Joined: 25 Jan 2016

Re: Re:

Postby J. M. Sower » Dec 6 2018, 10:06

GrayFace wrote:What sort of buttons do you want to press?

Mainly exit button from spell book. I have tried some ways but I can't close this window with scripts... I'm trying to add new spells ;) But not "really" new spells, if you would look at the code. They will be good illusion, but made in completly new system.

At this time I try to make the "aiming" screen for some spells. I have made spell that changes clicked monster to another one (friendly), but I'm struggling with Game.Paused and unfortunetly Mouse.SetIcon(Icon = "MICON2") is closing my game... Maybe there is some way to run original aiming screen for own purposes, without recreating it?

Ps. Sorry for double post ;P
Last edited by J. M. Sower on Dec 6 2018, 11:12, edited 2 times in total.

Rodril
Scout
Scout
Posts: 173
Joined: 18 Nov 2016

Re: Re:

Postby Rodril » Dec 14 2018, 16:05

J. M. Sower wrote:Mainly exit button from spell book.

You can use "HardcodedTopicFunctions.lua" from mm678 files. Put it into "...Structs/After" folder. Call function "ExitCurrentScreen()", it will work in most cases, but it does not exit screen immediatley, use

Code: Select all

...
ExitCurrentScreen()
Sleep(10,10)
...

if you need to do something after exiting in same function.
Also there is function "DoGameAction(Ation, Param1, Param2, Now)", you can emulate other player's actions with it. First three params are same as in "Action" event, if "Now" is true, action will be executed immediately, but it can be glitchy. "DoGameAction(113)" in most cases will work same as "ExitCurrentScreen()".


Return to “Might and Magic”

Who is online

Users browsing this forum: Bing [Bot] and 10 guests