llde / xOBSE

Oblivion Script extender source
247 stars 35 forks source link

SetCurrentSoulLevel not working on inventory references #179

Closed OctaviusMods closed 1 year ago

OctaviusMods commented 1 year ago

I'm trying to set the soul level of Azura's Star (as inventory reference) through script. It works with SetSoulLevel, but then the Star will never empty (I can re-use the same soul endlessly). I think the correct approach would be to use SetCurrentSoulLevel, but it simply has no effect. Some code (assumes you have Azura's Star in player inventory):

ref azura

let azura := (Player.GetInvRefsForItem AzurasStar)[0]
azura.SetCurrentSoulLevel 2 ; This doesn't work
SetSoulLevel 2 azura ; This works, but is permanent

I'm using the latest xOBSE 22.7.

llde commented 1 year ago

thanks I will test

llde commented 1 year ago

Seeing the code, is quite clear why this is happening, If an item doesn't have an ExtraData defined then adding extra datas to it won't be integrated in the inventory from the IR