OpenInventory() Script

Post » Tue Jun 19, 2012 10:07 am

EDIT: WHOA. Just got it working. It would seem it was a combination of the BlockActivationCommands not being needed and me not assigning the ObjectReference correctly. Thanks anyways, feel free to Lock this thread :)

I've been trying some time to make an activator (In this case, a cart) open a container. No matter what I have tried it would not work. It then struck me I may have better success scripting it to open a nearby Horse's Inventory. What should have been a simple working script is just not doing anything in game. Debug messages appear, but the Inventory screen will not open at all. What is they problem exactly? Here is my script:

Spoiler

Scriptname Driveablehorseinv extends ObjectReference

{Opens cart's inventory when activated while sneaking.}
Event OnLoad()
self.BlockActivation()
EndEvent

Event OnActivate(ObjectReference akActionRef)
self.BlockActivation()
If (DriveableHorse1.IsDead() == false) && (akActionRef == Game.GetPlayer()) && (Game.GetPlayer().IsSneaking() == 1)
Utility.Wait(0.5)
DriveableHorse1.OpenInventory(true)
Else
Utility.Wait(0.01)
self.Activate(akActionRef, true)
EndIf
EndEvent
Actor property DriveableHorse1 Auto

Thanks in advance for any assistance.
User avatar
hannaH
 
Posts: 3513
Joined: Tue Aug 15, 2006 4:50 am

Return to V - Skyrim