Norbyte / bg3se

Baldur's Gate 3 Script Extender
Other
1.02k stars 63 forks source link

`ModId` values reported for stats entries are inconsistent based on load order #396

Closed AtilioA closed 3 weeks ago

AtilioA commented 1 month ago

I have attempted solutions to common problems

Yes

I have checked that my game version is supported

Yes

OS

Windows 11

Platform

Steam

Description

There is some unexpected behavior involving the ModId value when parsing stats within Script Extender. Specifically, ModId for items is definitely being reported incorrectly.

Indications

The issue appears to be with Script Extender as incorrect ModId values are returned from SE functions, which affects the identification of which mod is adding which stat entry. This has been confirmed by testing various load orders (by me and Aahz) and observing the incorrect ModId values, i.e. stats belonging to mods other than the returned ModId.

More context: https://discord.com/channels/1211056047784198186/1241144473115824128/1241212533512212490 https://discord.com/channels/1211056047784198186/1241144473115824128/1241231284781711421 https://discord.com/channels/1211056047784198186/1211069350157488209/1241234974980702329

Diagnostic Files

Truncated cause it doesn't match the messages anyways BG3 Diagnostic Data.txt

Steps to Reproduce

Expected Behavior

Ext.Stats.Get(<MOD_STAT>).ModId should return the mod UUID for the mod that added the stat entry.

Actual Behavior

.ModId returns unexpected UUIDs from other mods in the load order. This issue seems to worsen with mods loaded later in the order.

Norbyte commented 1 month ago

I can happily report that this is getting fixed in v17. https://github.com/Norbyte/bg3se/commit/4380031bc16a4f886ec9440e08f182b628921fbb