Difference between revisions of "Talk:GetDialogueTarget - Actor"
Jump to navigation
Jump to search
Talk:GetDialogueTarget - Actor (edit)
Revision as of 21:10, 9 February 2013
, 21:10, 9 February 2013→Examples
imported>Zartar |
imported>Zartar |
||
Line 30: | Line 30: | ||
== Examples == | == Examples == | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
;This is a custom function so you have to include it in your script. | |||
Actor Function GetPlayerDialogueTarget() | |||
Actor kPlayerDialogueTarget | |||
Actor kPlayerRef = Game.GetPlayer() | |||
Int iLoopCount = 10 | |||
While iLoopCount > 0 | |||
iLoopCount -= 1 | |||
kPlayerDialogueTarget = Game.FindRandomActorFromRef(kPlayerRef , 200.0) | |||
If kPlayerDialogueTarget != kPlayerRef && kPlayerDialogueTarget.IsInDialogueWithPlayer() | |||
Return kPlayerDialogueTarget | |||
EndIf | |||
EndWhile | |||
Return None | |||
EndFunction | |||
; Print a message if the player is in dialogue with Bob. | ; Print a message if the player is in dialogue with Bob. | ||
if (GetPlayerDialogueTarget() == Bob) | if (GetPlayerDialogueTarget() == Bob) |