How do Special items work?

The role-playing games (I-X) that started it all and the various spin-offs (including Dark Messiah).
cthscr
Golem
Golem
Posts: 618
Joined: 12 Jan 2020

How do Special items work?

Unread postby cthscr » 04 Sep 2020, 18:45

In MM7 and MM8 we have items of Special material. Several of them have VarA set (which should be something like Bonus2 aka Special Bonus). Game.ItemsTxt contains no such bonus set, item itself has no such bonus set. Does it ever work?
I have tested MM7 Grognard's Cutlass (Elf Slaying) with CalcMeleeDamage against Monsters 50 and 59 and see no difference. I've put Bonus2=63 on regular item and difference was seen.
MM8 Mace of the Sun (Elemental Slaying) works (well, not works) the same way.
Have I missed something?

User avatar
Roxterat
Peasant
Peasant
Posts: 66
Joined: 28 Jun 2020

Re: How do Special items work?

Unread postby Roxterat » 06 Sep 2020, 17:15

The unexplored depth, wish I knew.. :/
Last edited by Roxterat on 06 Sep 2020, 17:16, edited 1 time in total.

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

Re: How do Special items work?

Unread postby GrayFace » 08 Sep 2020, 00:17

cthscr wrote:In MM7 and MM8 we have items of Special material. Several of them have VarA set (which should be something like Bonus2 aka Special Bonus). Game.ItemsTxt contains no such bonus set, item itself has no such bonus set. Does it ever work?
Yes it does, but varA values must exactly match the "of ..." name from spcitems.txt or stditems.txt (or it can match the default English name of that since patch v2.1). Some localizations get this wrong and thus break special items.

Here's how it works:
When an item is generated in a chest (or if you just put an item generated differently into a chest and save-load) its Bonus, Bonus2 and BonusStrength fields are copied from Game.ItemsTxt to the item. Then it shows and activates the bonus exactly like a regular item. So, you should see it both in Game.ItemsTxt and in-game description.
This code should print out some numbers both in MM7 and MM8 if special items are read correctly:

Code: Select all

for _, a in Game.ItemsTxt do
	if a.Bonus2 ~= 0 then
		print(a.Bonus2)
	end
end
Last edited by GrayFace on 08 Sep 2020, 00:18, 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.

cthscr
Golem
Golem
Posts: 618
Joined: 12 Jan 2020

Re: How do Special items work?

Unread postby cthscr » 08 Sep 2020, 11:49

Well, you can check MM8 yourself (I can expect my installation to be faulty or something...)
Game.ItemsTxt contains no such bonus set

Code: Select all

> for k, v in Game.ItemsTxt do
  if v.Bonus2 > 0 then
    print(k, v.Bonus2)
  end
 end
> 
GOG MM8 (english), MM8Patch 2.4.1, MMExtension 2.2

(Merge has the same of course.)

cthscr
Golem
Golem
Posts: 618
Joined: 12 Jan 2020

Re: How do Special items work?

Unread postby cthscr » 08 Sep 2020, 19:50

Have tried chest trick in MM7 with item 538 (Lieutenant's Cutlass). It worked once out of more than ten tries. And I was too slow to check Game.ItemsTxt that time.

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

Re: How do Special items work?

Unread postby GrayFace » 12 Sep 2020, 02:29

cthscr wrote:Well, you can check MM8 yourself
I already did.
Last edited by GrayFace on 12 Sep 2020, 02:29, 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.

cthscr
Golem
Golem
Posts: 618
Joined: 12 Jan 2020

Re: How do Special items work?

Unread postby cthscr » 19 Sep 2020, 18:08

GrayFace wrote:
cthscr wrote:Well, you can check MM8 yourself
I already did.
And so did I. There was no item in Game.ItemsTxt with Bonus2 ~= 0. Never in countless tries (including ones before this thread creation - but let's not forget about one in MM7 I have missed to check). Neither in MM7 nor in MM8. Not depended on whether I was in loaded game or in start screen.
Not that I doubt you, but I just have this observation.
My thoughts were that either there should be some other place to store bonuses of Specials or MMExtension (rel. 2.2) shows something wrong regarding Game.ItemsTxt somehow (have no other ideas atm except multiple faulty installations). That was basically the reason of this thread creation. I'm not ready yet to dive into that part of mm8.exe but probably will do a bit later.

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

Re: How do Special items work?

Unread postby GrayFace » 08 Oct 2020, 16:11

cthscr wrote:And so did I.
Like I said there must be an issue with items.txt. You can send it to me to check alongside other *items.txt files.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.

cthscr
Golem
Golem
Posts: 618
Joined: 12 Jan 2020

Re: How do Special items work?

Unread postby cthscr » 29 Oct 2020, 07:45

GrayFace wrote:
cthscr wrote:And so did I.
Like I said there must be an issue with items.txt. You can send it to me to check alongside other *items.txt files.
They are default ones (default GOG version with your patch applied). I've even put them into DataFiles to be sure game uses them rather than something else.
MM7: https://drive.google.com/file/d/16Dsk7B ... sp=sharing
MM8: https://drive.google.com/file/d/1Y6OSit ... sp=sharing

I haven't tried your current master though, only released MMExtension v2.2

cthscr
Golem
Golem
Posts: 618
Joined: 12 Jan 2020

Re: How do Special items work?

Unread postby cthscr » 29 Oct 2020, 08:03

Finally tried with current master.

Code: Select all

> for k, v in Game.ItemsTxt do
  if v.Bonus2 ~= 0 then
    print(k)
  end
 end
---- Log File Output: --------------
538
539
540
541
542
> 
When is new MMExtension release expected? You have fixed a ton of bugs since last version.

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

Re: How do Special items work?

Unread postby GrayFace » 11 Nov 2020, 08:36

cthscr wrote:When is new MMExtension release expected? You have fixed a ton of bugs since last version.
As with everything else - not even a slightest idea.
My patches: MM6 MM7 MM8. MMExtension. Tools. Also, I love Knytt Stories and Knytt Underground. I'm also known as sergroj.


Return to “Might and Magic”

Who is online

Users browsing this forum: No registered users and 3 guests