Give item at certain point in dialogue

Post » Tue Jun 19, 2012 11:23 am

Once again I have managed to completely confuse myself. (sigh)

I know how to make an NPC give something to the player.
If I want this to occur in the middle of a quest dialogue (ie when a certain dialog occurs), where do I put the script?

Do I complete a stage and then put a script on the NPC that looks for the stage completion?
Do I add it to the topic info?
Somewhere else?

I understand how to script, it's just that there are so many places to attach scripts and fragments that my poor old brain gets confused.

Thanks for any help and not trashing me. :)
User avatar
Baylea Isaacs
 
Posts: 3436
Joined: Mon Dec 25, 2006 11:58 am

Post » Tue Jun 19, 2012 8:53 pm

I'm not sure if this is the best method, but what I do is your 2nd option. via dialogue (inthe results fragment) I put SetStage(X), and under stage X I add a property for the item I want to give the player, and then you use the AddItem to Game.GetPlayer() and add your item_alias.
User avatar
Jesus Lopez
 
Posts: 3508
Joined: Thu Aug 16, 2007 10:16 pm

Post » Tue Jun 19, 2012 8:01 pm

I think you can do it in both places. If you so it as an extension of the dialogue, that may mean that only that one NPC can give it to the player. The benefit of doing it through a quest stage is you could change the dialogue, change the NPC, or decide to add another NPC who can give the reward as an alternative, and you only have to put the setstage script in your dialogue to get it to work. Whether you put the script in the stage script or not, you should still set a stage in the dialogue script, because then that allows you to use conditions in dialogue based on the spot the player has reached in the quest, which is handy.
User avatar
Maeva
 
Posts: 3349
Joined: Mon Mar 26, 2007 11:27 pm

Post » Tue Jun 19, 2012 12:00 pm

I think you can do it in both places. If you so it as an extension of the dialogue, that may mean that only that one NPC can give it to the player. The benefit of doing it through a quest stage is you could change the dialogue, change the NPC, or decide to add another NPC who can give the reward as an alternative, and you only have to put the setstage script in your dialogue to get it to work. Whether you put the script in the stage script or not, you should still set a stage in the dialogue script, because then that allows you to use conditions in dialogue based on the spot the player has reached in the quest, which is handy.
If you do it via the dialogue result papyrus fragment, how do you define the item to give?
User avatar
Jaki Birch
 
Posts: 3379
Joined: Fri Jan 26, 2007 3:16 am

Post » Tue Jun 19, 2012 9:59 pm

I was pondering that the "correct" method would be to set (advance) the stage in the TopicInfo and then tie the "give item" script to the quest stage. but now y'all got me wondering what my other options are?

As with all things coding, there are different ways to accomplish the same thing and I would really like to hear any other implementtions others have come up with to do things like this.

Thanks !!
Dean
User avatar
El Khatiri
 
Posts: 3568
Joined: Sat Sep 01, 2007 2:43 am


Return to V - Skyrim