Page 1 of 1

Modded Books Working Around OnPCEquip Bug

Posted: 18 Jul 2017, 19:03
by Stuporstar
Hi there, I just got a bug report regarding one of my mods that will probably affect way more than just my mod:

> What appears to be the problem is this part of the script:
> ; PCSkipEquip is set to 1 every time the book is equipped from your inventory.
> If ( PCSkipEquip == 1 )
> Set PCSkipEquip To 0
> If ( GetPCCell "Master Llapp's Training Room" == 1 )
> If ( State == 0 )
> Set ActionFlag To 1
> Endif
> Endif
> EndIf
> There is a nice comment there, but at least for OpenMW, this is not true. You need to check OnPCEquip instead, which you do declare, but never actually use.

For books, using OnPCSkipEquip instead of OnPCEquip is what's recommended in Morrowind Scripting for Dummies to work around a bug in MW's engine. This means probably every mod with a scripted book (save Book Rotate, which doesn't do anything on equip) will likely be using this workaround, meaning a whole lot of mods with broken book scripts in OpenMW.

I can add an OnPCEquip check to my own books of course, if the OnPCSkipEquip doesn't break it. If it does, then these scripts may need separate patches for OpenMW, which is a cumbersome solution I hope to avoid.

I thought the OpenMW team was going to try to accommodate some of MW's engine quirks if a lot of mods relied on them. I'd like to know if the scripted book equip bug is potentially one of them before I implement a fix in all my mods.

Re: Modded Books Working Around OnPCEquip Bug

Posted: 18 Jul 2017, 23:11
by Chris
If it works in vanilla, it should probably work here, too. Can you provide a link to an affected mod for someone to take a look at?

Re: Modded Books Working Around OnPCEquip Bug

Posted: 19 Jul 2017, 07:11
by Stuporstar
Sure! The affected mod is Uvirith's Legacy:

But a better test case might be my grimoires mod (the non-MGE version), as it uses the same OnPCSkipEquip workaround and most of the books are readily available from the start of the game in the Balmora bookshop: