Jump to content

[LE] (Un)EquipItem function not executed until inventory menu is exited?


Recommended Posts

Posted

Hi Everyone,

 

i have a script that is supposed to unequip items whenever certain other items are equipped

for that i use this script delivered via an ability added to the player.

Scriptname DovahRingSlotMagicEffectScript extends activemagiceffect  

Formlist[] Property FingerListArray Auto
Form[] slotObjs
Actor ActorRef

Event OnEffectStart(Actor akTarget, Actor akCaster)
	slotObjs = new Form[9]
	ActorRef = akTarget
EndEvent

Event OnObjectEquipped (Form akBase, ObjectReference akRef)
	float startTime = Utility.GetCurrentRealTime()
	int i = 9
	while i
		i -= 1
		if FingerListArray[i].HasForm(akBase)
			if slotObjs[i]
				ActorRef.UnEquipItem(slotObjs[i])
			endif
			slotObjs[i] = akBase
			i = 0
		endif
	endwhile
	float endtime = Utility.GetCurrentRealTime()
	
	Debug.MessageBox((endtime-startTime)as string)
	
EndEvent

The whole thing works but with one major drawback: the old items do not get unequipped until i exit the inventory.

Does somebody know a way to force the menu to update while still in inventory?

 

 

Posted

You need to make a change to the items in inventory to force an update.

 

One quick and easy way is to first give the player a gold coin then take it away. Just make sure you use the silent option so there's no notification.

ActorRef.AddItem(Gold001, 1, true)
ActorRef.RemoveItem(Gold001, 1, true)
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...