non-equipable, non-consumable item that can be hotkeyed

Post » Wed Jun 20, 2012 11:51 am

I'd like to have an item that cannot be equipped, cannot be consumed, but can be hotkeyed and then a script can do something (OnActivate?). Is there any such thing in the game already? Can it be done?

I realize SKSE is working on keypress stuff, but I'd prefer not to wait.
User avatar
katie TWAVA
 
Posts: 3452
Joined: Tue Jul 04, 2006 3:32 am

Post » Wed Jun 20, 2012 1:22 pm

An ARMO/WEAP form not marked as "Playable" will not show when in your inventory, so it cannot be hotkeyed. It won't necessarily need to take up biped slot, despite the CK warnings that will ensue if none are selected. For Bag of Holding, I used an ARMO item and http://www.creationkit.com/OnEquipped_-_ObjectReference. You might want to glue it to the player so they cannot equip it multiple times from within their inventory with the abPreventRemoval parameter of http://www.creationkit.com/EquipItem_-_Actor set to True, then unglue it after a short http://www.creationkit.com/Wait_-_Utility.

Event OnEquipped(Actor akActor)	If akActor == Game.GetPlayer()		akActor.EquipItem(YourARMO, True, True)		Utility.Wait(0.1)		akActor.UnequipItem(YourARMO, False, True)		; Do stuff	EndIfEndEvent
User avatar
how solid
 
Posts: 3434
Joined: Mon Apr 23, 2007 5:27 am

Post » Wed Jun 20, 2012 1:22 pm

You can also do this in such a way:

Function doSomething(Actor akActor)	If akActor == Game.GetPlayer()	; stuff to do	EndIfEndFunctionEvent OnEquipped(Actor akActor)	doSomething(akActor)EndEventEvent OnUnequipped(Actor akActor)	doSomething(akActor)EndEvent
User avatar
Assumptah George
 
Posts: 3373
Joined: Wed Sep 13, 2006 9:43 am


Return to V - Skyrim