Are scrolls different from spells in terms of UnequipSpell?

Post » Fri Aug 15, 2014 7:34 am

Hi,

I wrote a mod that allows me to unequip any spell the player may have in his left hand by pressing a configurable key.

I assumed the mod would work for unequipping scrolls too but it seems that isn't the case.

This is the fragment of code in charge of identifying spells equipped in the player's left hand and then unequipping them:

if(PlayerRef.GetEquippedItemType(0) != 9)	returnelse	Spell ELHS = PlayerRef.GetEquippedSpell(0) As Spell	PlayerRef.UnequipSpell(ELHS, 0)endif

The GetEquippedItemType function doesn't have a category for scrolls. Also, I didn't see anything in the GetEquippedSpell or UnequipSpell that suggested those functions wouldn't work for scrolls. So I'm a bit puzzled as to why my script won't work for scrolls. Any ideas what should I change/consider in order to make it work for scrolls?

Thanks in advance!

EDIT: ok, I'm stupid. Unlike spells, favorited scrolls that are currently equiped can be unequipped just by pressing the hotkey attached to them. Since vanilla hotkeys already do for scrolls what my custom hotkey does for spells, there is no need to extend my script to include scrolls.

User avatar
IsAiah AkA figgy
 
Posts: 3398
Joined: Tue Oct 09, 2007 7:43 am

Post » Thu Aug 14, 2014 6:09 pm

Once the spell is 'in hand' then it's not a scroll any more. The scroll's just a way to make it equippable in the first place. But the game has to have a few extra checks in the engine for the single-use situation. I haven't used scrolls enough to notice if you can cancel and retain the scroll, or if it disappears when you "load up'.

How does your script fail? Does the scroll spell remain equipped, or does it unequip incorrectly?
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am


Return to V - Skyrim