Jump to content

Papyrus: How to get dialog target reference?


nick10840

Recommended Posts

I'm kind of new to this... So I'm sorry if this is obvious or a well known thing but all my googling efforts have not yielded anything usable. I'm trying to write a papyrus fragment for a topic info in a quest that I am working on. The dialog is pretty open ended in terms of which NPC I can be talking to and it could theoretically be any friendly NPC in the game. I am trying to get a reference to the Actor object of the NPC that I am speaking to.

 

I tried using... Game.GetPlayer().GetDialogueTarget() but it always returns NONE when I use it in the begin or end script fragment of the topic info.

 

I also tried using the OnStoryDialogue event for a quest script that I attached to the quest in Creation Kit but it doesn't seem to be triggering in game. I put a debug notification in the event and I do not see it when I enter the quest dialog with an NPC. Maybe I'm not linking them up right...

 

Any ideas?

Link to comment
Share on other sites

When using script fragments on a dialogue topic you can use "akSpeaker" (without quotes) to reference the actor that the player is talking to. You use it just like any other actor reference so for example akSpeaker.IsEssential() . GetDialogueTarget() does not work on the player only for NPCs. If you do akSpeaker.GetDialogueTarget() it will return the player however, you just can't use the function on the player to get who the player is talking to.

Link to comment
Share on other sites

  On 2/26/2014 at 9:48 AM, djjohnjarvis said:

When using script fragments on a dialogue topic you can use "akSpeaker" (without quotes) to reference the actor that the player is talking to. You use it just like any other actor reference so for example akSpeaker.IsEssential() . GetDialogueTarget() does not work on the player only for NPCs. If you do akSpeaker.GetDialogueTarget() it will return the player however, you just can't use the function on the player to get who the player is talking to.

 

Awesome. Thanks so much!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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