pxd2050 Posted August 6, 2020 Share Posted August 6, 2020 (edited) I want "State Inventory" only do work when "akSpeaker.OpenInventory", how to do? .....................................................Scriptname outfit__020012C9 Extends TopicInfo Hidden akSpeaker.OpenInventory(true)...................................... .................................Scriptname outfit__script extends ReferenceAlias State InventoryEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if (akBaseItem as Armor) AddToArmorSlot(akBaseItem) self.GetActorRef().EquipItem(akBaseItem) elseif (akBaseItem as Weapon) AddToWeaponSlot(akBaseItem) self.GetActorRef().EquipItem(akBaseItem) endifendEvent Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference) if (akBaseObject as Armor) RemoveFromArmorSlot(akBaseObject) elseif (akBaseObject as Weapon) RemoveFromWeaponSlot(akBaseObject) endifendEventendState Edited August 6, 2020 by pxd2050 Link to comment Share on other sites More sharing options...
pxd2050 Posted August 6, 2020 Author Share Posted August 6, 2020 (edited) When OnCellLoad(),Event OnItemAdded and Event OnObjectUnequipped is called,but I want this two Event only be called when akSpeaker.OpenInventory(true).Can you help me? my poor English. Edited August 6, 2020 by pxd2050 Link to comment Share on other sites More sharing options...
Evangela Posted August 6, 2020 Share Posted August 6, 2020 (edited) Try this, but use OnCellAttach because it's more reliable than OnCellLoad AUTO STATE CellLoading Event OnCellAttach() GoToState("ExampleState") AddInventoryEventFilter(...) akSpeaker.OpenInventory(true) EndEvent ENDSTATE STATE ExampleState Event OnItemAdded(..params..) ....whatever you want to put here... EndEvent Event OnObjectUnequipped(...params..) ....whatever you want to put here... EndEvent ENDSTATE I was being lazy not adding the parameters for the events lol. This is a 1 shot script, meaning the cell check will only happen once, unless you want the state to keep reverting back to auto. Edited August 6, 2020 by Rasikko Link to comment Share on other sites More sharing options...
Recommended Posts