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 » Sep 1 2016, 18:48

J. M. Sower wrote:Apart from that I was trying to write a script that changes reputation after killing the monster of the chosen group. Unfortunately, I was able to only partially achieved. This script works well :D , but also works when a monster is killed by another monster, and I want it to work only when a player kills him. :wall: GrayFace, can you help?

Never mind, I was able to do it using a change of player experience after killing monster. I do not believe that I came to this. xD

Below is a complete script for those who are interested. :D

Code: Select all

local function getexp()
   RemoveTimer(getexp)
   vars.ParExp = 0 -- Does the team has gained experience; 0 - no, 1 - yes
      
      if Party.Count == 1 then
         if Party[0].Experience > vars.ParExp0 then
            vars.ParExp = 1
         end
      vars.ParExp0 = Party[0].Experience
      end

      if Party.Count == 2 then
         if (Party[0].Experience > vars.ParExp0 or Party[1].Experience > vars.ParExp1) then
            vars.ParExp = 1
         end
      vars.ParExp0 = Party[0].Experience
      vars.ParExp1 = Party[1].Experience
      end

      if Party.Count == 3 then
         if (Party[0].Experience > vars.ParExp0 or Party[1].Experience > vars.ParExp1 or Party[2].Experience > vars.ParExp2) then
            vars.ParExp = 1
         end
      vars.ParExp0 = Party[0].Experience
      vars.ParExp1 = Party[1].Experience
      vars.ParExp2 = Party[2].Experience
      end

      if Party.Count == 4 then
         if (Party[0].Experience > vars.ParExp0 or Party[1].Experience > vars.ParExp1 or Party[2].Experience > vars.ParExp2 or Party[3].Experience > vars.ParExp3) then
            vars.ParExp = 1
         end
      vars.ParExp0 = Party[0].Experience
      vars.ParExp1 = Party[1].Experience
      vars.ParExp2 = Party[2].Experience
      vars.ParExp3 = Party[3].Experience
      end

      if Party.Count == 5 then
         if (Party[0].Experience > vars.ParExp0 or Party[1].Experience > vars.ParExp1 or Party[2].Experience > vars.ParExp2 or Party[3].Experience > vars.ParExp3 or Party[4].Experience > vars.ParExp4) then
            vars.ParExp = 1
         end
      vars.ParExp0 = Party[0].Experience
      vars.ParExp1 = Party[1].Experience
      vars.ParExp2 = Party[2].Experience
      vars.ParExp3 = Party[3].Experience
      vars.ParExp4 = Party[4].Experience
      end



      if vars.ParExp == 1 then

         if vars.gr == 38 then -- if killed monster was in 38 group
            -- change of reputations:
            vars.repa = vars.repa - 1 -- Sun
            vars.repb = vars.repb + 2 -- Moon
            vars.repc = vars.repc - 1 -- Karigor
            vars.repd = vars.repd  - 0.2 -- Dwarfs
            vars.repe = vars.repe + 2 -- Necro
            vars.repg = vars.repg + 1 -- Pirates
            vars.reph = vars.reph  - 0.2 -- Vori
         end

      vars.ParExp = 0
      end
end



function events.MonsterKilled(index, callDef)
   if Party.Count == 1 then
   vars.ParExp0 = Party[0].Experience
   end

   if Party.Count == 2 then
   vars.ParExp0 = Party[0].Experience
   vars.ParExp1 = Party[1].Experience
   end

   if Party.Count == 3 then
   vars.ParExp0 = Party[0].Experience
   vars.ParExp1 = Party[1].Experience
   vars.ParExp2 = Party[2].Experience
   end

   if Party.Count == 4 then
   vars.ParExp0 = Party[0].Experience
   vars.ParExp1 = Party[1].Experience
   vars.ParExp2 = Party[2].Experience
   vars.ParExp3 = Party[3].Experience
   end

   if Party.Count == 5 then
   vars.ParExp0 = Party[0].Experience
   vars.ParExp1 = Party[1].Experience
   vars.ParExp2 = Party[2].Experience
   vars.ParExp3 = Party[3].Experience
   vars.ParExp4 = Party[4].Experience
   end

   if index.Group == 0 then  -- if killed monster was in 0 group
      vars.gr = 0
      --SimpleMessage("" .. index.Group .. "") -- shows the group number
   end

   if index.Group == 38 then  -- if killed monster was in 38 group
      vars.gr = 38
      Timer(getexp, 1, true)
   end
end





function events.ExitNPC(i) -- When you done talking with NPC in House - this is because quests also add experience
   if Party.Count == 1 then
   vars.ParExp0 = Party[0].Experience
   end

   if Party.Count == 2 then
   vars.ParExp0 = Party[0].Experience
   vars.ParExp1 = Party[1].Experience
   end

   if Party.Count == 3 then
   vars.ParExp0 = Party[0].Experience
   vars.ParExp1 = Party[1].Experience
   vars.ParExp2 = Party[2].Experience
   end

   if Party.Count == 4 then
   vars.ParExp0 = Party[0].Experience
   vars.ParExp1 = Party[1].Experience
   vars.ParExp2 = Party[2].Experience
   vars.ParExp3 = Party[3].Experience
   end

   if Party.Count == 5 then
   vars.ParExp0 = Party[0].Experience
   vars.ParExp1 = Party[1].Experience
   vars.ParExp2 = Party[2].Experience
   vars.ParExp3 = Party[3].Experience
   vars.ParExp4 = Party[4].Experience
   end
end
Last edited by Anonymous on Sep 19 2016, 12:23, edited 1 time in total.

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 » Sep 5 2016, 7:19

Dialogs are a bit of an uncharted territory for now. I did create buttons in new game dialog, but haven't tried doing so for main screen and haven't done any general support for scripting that. Standard dialogs aren't well-organized.
Last edited by Anonymous on Sep 5 2016, 7:33, 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
Pixie
Pixie
Posts: 141
Joined: 25 Jan 2016

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

Postby J. M. Sower » Sep 18 2016, 13:36

GrayFace wrote:Dialogs are a bit of an uncharted territory for now. I did create buttons in new game dialog, but haven't tried doing so for main screen and haven't done any general support for scripting that. Standard dialogs aren't well-organized.

It's sad. :(


Anyway, I wrote the script that saves in variable the amount of the current item in player inventory. :D

Code: Select all

for item30=0, 100 do -- It checks up to 100, but you can increase this number
   vars.item30 = item30 - 1 -- saving count of item 30 in vars.item30
   if not evt.CheckItemsCount{MinItemIndex = 30, MaxItemIndex = 30, Count = item30} then
      break
   end
end
Last edited by Anonymous on Sep 18 2016, 13:40, edited 4 times in total.

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 » Sep 21 2016, 21:32

The loop can start at 1. I made a function for this, but still haven't released new MMExt version.
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: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Postby J. M. Sower » Sep 22 2016, 15:39

GrayFace wrote:The loop can start at 1. I made a function for this, but still haven't released new MMExt version.

This my script works absolutely fine. ;) Even when there is 0 items.

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 » Sep 24 2016, 7:11

J. M. Sower wrote:This my script works absolutely fine. ;) Even when there is 0 items.

Yes, and like I said, it would be better if it starts with 1.
Last edited by GrayFace on Sep 24 2016, 7:14, 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.

adrian5683
Leprechaun
Leprechaun
Posts: 2
Joined: 27 Sep 2016

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

Postby adrian5683 » Sep 27 2016, 1:29

Hey GrayFace, is it possible to edit the preset skills of any class? For example, the Knight class starts off with Sword and Leather presets and I'd like to mod it so that it starts with Sword and Arms Master... Is that possible?

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 » Sep 27 2016, 3:54

Yes, by editing Data\Tables\Class Starting Skills.txt with TxtEdit
Last edited by GrayFace on Sep 27 2016, 3:54, 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.

adrian5683
Leprechaun
Leprechaun
Posts: 2
Joined: 27 Sep 2016

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

Postby adrian5683 » Sep 27 2016, 12:47

Thank you but I can't seem to fine the Class Starting Skills txt file... I downloaded the most recent MMExtension, am I looking in Scripts? Total noob here, sorry...

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 » Oct 1 2016, 12:37

Just run the game once.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

neutonm
Leprechaun
Leprechaun
Posts: 12
Joined: 02 Mar 2016

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

Postby neutonm » Oct 9 2016, 22:06

Hey grayface,

If there's a new version coming I could really use a fix for facet limitation in MM7.
Such low limit really limits design capabilities. Hard to make some bigger dungeons and place more customized buildings on map.

I also get error message on attempt to compile dungeon: "BSP compilation failed due to doors.". Ok, doors are the problem but what exactly is wrong with them?

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 » Oct 11 2016, 13:27

neutonm wrote:If there's a new version coming I could really use a fix for facet limitation in MM7.
Such low limit really limits design capabilities. Hard to make some bigger dungeons and place more customized buildings on map.

Yes, that one is a big problem. It's done it for MM8. Maybe I'll do a dirty version for MM7 just to work in D3D so you can design such maps in MM7.

neutonm wrote:I also get error message on attempt to compile dungeon: "BSP compilation failed due to doors.". Ok, doors are the problem but what exactly is wrong with them?

It happens when doors overlap. Usually it can be solved by removing unused facets from the door. What map is that happening in? I'm looking to improve BSP algorithm's handling of doors in future, so it might go away.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

neutonm
Leprechaun
Leprechaun
Posts: 12
Joined: 02 Mar 2016

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

Postby neutonm » Oct 20 2016, 14:01

GrayFace wrote:It happens when doors overlap. Usually it can be solved by removing unused facets from the door. What map is that happening in? I'm looking to improve BSP algorithm's handling of doors in future, so it might go away.


It's not internal map. I'll send you the map tho.

mg979
Leprechaun
Leprechaun
Posts: 14
Joined: 05 Nov 2016

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

Postby mg979 » Nov 5 2016, 11:57

Hello, can somebody tell me pls if it's possible in some way to edit classes in MM6? I mean skills/item restrictions. Thanks

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 17 2016, 12:43

mg979 wrote:Hello, can somebody tell me pls if it's possible in some way to edit classes in MM6? I mean skills/item restrictions. Thanks

Yes, data\Tables\Class Starting Skills.txt is the one to edit. Make sure to rune the game once with MMExt first. What do you mean by item restrictions?
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: MMExtension v2.1 + MMEditor v2.1 Level Editor [Apr 22, 2016]

Postby J. M. Sower » Nov 17 2016, 17:13

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:

mg979
Leprechaun
Leprechaun
Posts: 14
Joined: 05 Nov 2016

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

Postby mg979 » Nov 20 2016, 5:16

GrayFace wrote:
mg979 wrote:Hello, can somebody tell me pls if it's possible in some way to edit classes in MM6? I mean skills/item restrictions. Thanks

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

Code: Select all

00 patch.games.lod
00 patch.icons.lod
BITMAPS.LOD
Games.lod
icons.lod
MouseLookCursor.bmp
new.lod
SPRITES.LOD


I have the GOG version.

GrayFace wrote:What do you mean by item restrictions?


I wanted to restrict clerics from using bows in a mod I made.

Edit:sorry I understand now I had to install the extension but I get a virus report for FASM.dll (Comodo AV), I added it to the exclusions though
Last edited by mg979 on Nov 20 2016, 14:35, edited 3 times in total.

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 » Nov 20 2016, 13:58

Me 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:

...continuing, I gave to the Treants in MM7 all the statistics from Swordsmens (also "MoveType") and in the same way in MonList.txt I pasted for them settings from Swordsmens. The strange thing is that the creature further stood stationary. Does this mean that the motionless of Treants is inscribed somewhere inside the EXE file?
Last edited by J. M. Sower on Nov 21 2016, 9:29, edited 5 times in total.

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 » Nov 21 2016, 16:56

Small discovery that may be useful for someone, when wrote current dialogues without using Quest function (in the old way).

Instead of this (You must have typed text for "Str" in NPCText.txt):

Code: Select all

evt.SetMessage  {Str = 772}


You can write SimpleMessage(), and then you can inscribe some variables into the text (which of course you can also done in Quest function ;) ) and you don't need to use NPCText.txt. Example:

Code: Select all

SimpleMessage("X: " .. Party.X .. "\nY: " .. Party.Y .. "\nZ: " .. Party.Z .. "\nDirection: " .. Party.Direction)

mg979
Leprechaun
Leprechaun
Posts: 14
Joined: 05 Nov 2016

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

Postby mg979 » Nov 21 2016, 22:12

I'm having this kind of error with MMExtension

Image

What could be? It's happening often in the abandoned temple, but it seems random (sometime I get it, sometimes I don't)
Last edited by mg979 on Nov 21 2016, 22:14, edited 2 times in total.


Return to “Might and Magic”

Who is online

Users browsing this forum: No registered users and 17 guests