Jump to content

Player animations and opening player inventory


Recommended Posts

So I have a script attached to chairs in my museum library and when you use the chair it waits for you to fully sit then asks if you would like to read from the library collection. If you choose yes it will add a copy of each book from a FormList. THEN it SHOULD play the reading book animation which I can't seem to get working properly and it SHOULD open the player inventory. After reading as you wish, when you stand up the books are removed.

 

So... How can get a 3rd person camera view and the read while sitting animation going? and How can I get the inventory to open. I CAN get the inventory to open using the force argument but it opens it as a gift window with the player in both panes and requires you to hold shift and press E to read a book.

 

Here's what I have and it functions fine for the item control but the Idle Animation doesn't seem to work

Scriptname DBM_ReadingChairScript extends ObjectReference  

Message Property DBM_ReadChairMSG Auto
FormList Property BookList Auto

Auto State Waiting

Event OnActivate(ObjectReference akActionRef)
    if akActionRef == Game.GetPlayer()
        Utility.Wait(3.5)
        int BTN = DBM_ReadChairMSG.show()
        if BTN == 0 ; Yes
            Debug.SendAnimationEvent(Game.GetPlayer(), "ChairReadingStart")
            Game.GetPlayer().Additem(BookList, 1, absilent = True)
            Game.GetPlayer().OpenInventory()
            GoToState("Reading")
        Elseif BTN == 1 ; No
        Endif
    Endif
EndEvent

EndState

State Reading
 
Event OnActivate(ObjectReference akActionRef)
    if akActionRef == Game.GetPlayer()
        Game.GetPlayer().RemoveItem(BookList, 1, absilent = true)
        GoToState("Waiting")
    Endif
EndEvent

EndState

Thanks

Link to comment
Share on other sites

The Idle name for ChairReadingStart event is IdleBook_Sitting_Reading.

There is also an idle IdleBook_Sitting_TurnManyPages

 

Also maybe you can use

http://www.creationkit.com/ForceThirdPerson_-_Game

 

For opening your own inventory, maybe you could use:

 

Input.TapKey(Input.GetMappedKey("Quick Inventory"))
Edited by sLoPpYdOtBiGhOlE
Link to comment
Share on other sites

cool, the Input function did the trick for the inventory. The animation is working just fine already. Pulls out a book, reads and flips pages.

 

I tried ForceThirdPerson before and it works ok, but I am trying to figure out how to anchor the camera to a 3rd person position in FRONT on the player so you can see them sitting and reading. Using ForceThirdPerson just puts it over their shoulder and you can't see the book being read. I've never worked with cameras at all so I'm not sure how crafting stations anchor to other positions like they do for instance. I assume it's a Nif Node thing.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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