Mods to DLC's

Post » Fri May 09, 2014 4:10 am

I have a problem with creating a mod that has both Skyrim and a DLC as masters. It appears that script functions will crash the game if the operands are things defined in the DLC.

Example: Game.GetPlayer().GetItemCount(xxx)

If xxx is an item defined in my mod, it works. If xxx is an item defined in Skyrim.esm, it works. But if xxx is defined in a DLC which is a master to the mod, then the game crashes. It appears that the Papyrus engine is treating any non-zero top byte in a formid as "current mod". (Zero is left alone, as that's vanilla Skyrim.)

The xxx above can be a property that's auto-filled, or a local variable that's set to the item, and the same results are seen. Debug.trace(xxx) will show the correct value of the formid, with the DLC's LO byte as the top one when it crashes.

Can anyone else confirm this theory, or better, suggest a work-around?
User avatar
Blaine
 
Posts: 3456
Joined: Wed May 16, 2007 4:24 pm

Post » Fri May 09, 2014 9:45 am

Are you including the offset for the DLC item? Offset being the load order for the DLC.

User avatar
Hayley Bristow
 
Posts: 3467
Joined: Tue Oct 31, 2006 12:24 am

Post » Fri May 09, 2014 9:14 am

Yes, as I stated, I've checked that the top byte of the formid is correct when the function is called.

However, if you're suggesting that I need to replace it with the relative value used in the CK in order to get it correctly adjusted, I'd like to know how. E.g. the mod has masters 00 - Skyrim, and 01 - Dawnguard, while its own items are 02 when seen in the CK. In-game these might be 00,04,52 respectively, as other mods and patches come in between. Do I need to pass 04 or 01 for Dawguard content? 04 fails, and I haven't found a way to change it to 01, so the engine can change it back to 04. I suspect it would still fail, with the run-time changing it to 52 when it's not 00.

It doesn't seem to matter if the value is compiled in, or retrieved at run-time using GetFormFromFile. Debug.trace shows the same formid before the call. I can't trace into the call in any way I know.
User avatar
Assumptah George
 
Posts: 3373
Joined: Wed Sep 13, 2006 9:43 am


Return to V - Skyrim

cron