Jump to content

Scripting to spawn an object in an NPC's hand?


eriberri

Recommended Posts

Posted

Hi, I'm asking this on behalf of Kain82 who has a question relating to a mod he's scripting.

As part of a bigger project we've been working on (see my sig), an animator needed a test cell made so he could test the animations he's making for us. Kain made the cell. Inside this cell, a male and female NPC are scripted to play the animations through a dialogue choice. The choice that is picked ends the conversation and triggers the animation. This is usually all good.

My question relates to two animations the animator just made.

The animations are of a person standing and reading, and a person sitting and reading.

For the standing reading animation, the animator would like the open book to spawn in the NPC's hand (after making the dialog choice), and then the reading animation to play directly after.

For the sitting reading animation, the animator would like a chair to spawn, the NPC to sit in it, an open book to spawn in the NPC's hands, and then the reading animation to play.

My question is this: How do we script it to spawn the open book in the characters hand, and then play the animation? And how do we spawn a chair for the NPC to sit in for the seated animation?

 

Thanks! :)

Posted

You mean like in the vanilla game ? Shouldn't be a problem imho as everything you described already exists, but I'm not a modder so I will let the others give you a better answer.

 

Btw, keep up the good work !

Posted

You can do playidle through a script and have it do the reading a book, you may have to add a book to their inventory for it to show up. As for the chair that depends somewhat. Does this happen in a set location or can it happen anywhere? If it is a set location you can add it to the world and just enable it when you need it, if it is random I am not entirely sure on that.

Posted
My question is this: How do we script it to spawn the open book in the characters hand, and then play the animation? And how do we spawn a chair for the NPC to sit in for the seated animation?

 

You don't need to and actually you can't do it the way you want. There already exists an animation of reading and browsing a book while standing. Look at the archmage in the college of winterhold. He stays there and reads a book while talking to you. I'm pretty sure there is also a reading animation while sitting. To spawn a chair you could use a quest alias with the condition "Create object at"... with initially disabled flag and when you need the chair you enable the reference and it should be visible. Or you already place it in the cell and disable it while not needed and enable it per script command.

 

If you have already new animations for reading, you need to tie the book/chair within the animation itself.

Posted

Hi, I was able to make the npc sit in a chair and added a book their inventory.  But all they do is just sit there, they won't read the book.  I used an edited version of "WhiterunSaffirHomeReadPackage1"  package.  All I changed was the location. 

 

I'd appreciate it if someone can tell me what I did wrong?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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