Modded Books Working Around OnPCEquip Bug

Post about your mods, learn about OpenMW mod compatibility, check for problematic mods, discuss issues, and give us feedback about your experience with modded OpenMW.
Post Reply
Stuporstar
Posts: 6
Joined: 01 Jul 2017, 06:35

Modded Books Working Around OnPCEquip Bug

Post 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.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Modded Books Working Around OnPCEquip Bug

Post 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?
Stuporstar
Posts: 6
Joined: 01 Jul 2017, 06:35

Re: Modded Books Working Around OnPCEquip Bug

Post by Stuporstar »

Sure! The affected mod is Uvirith's Legacy: http://download.fliggerty.com/download-35-884

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: http://download.fliggerty.com/download-11-1198
Post Reply