Trying to get a reference to persion via dialogue... help pl

Post » Mon Nov 19, 2012 10:11 pm

This has been racking my brain for a good part of a day and I can't figure this out.

I have it where no matter who you walk up to, I want to ask them to "Be my friend".
At which point they say, "Sure." and exit the dialogue screen.

Behind the scenes, I wrote the dialogue, that works fine. But in the End Papyrus result script section
I can't figure out how to say:
You that just left.SetFactionRank(MyFriendFaction, 1)You that just left.Additem(MyFriendAmulet, 1)GetOwningQuest().SetObjectiveDisplayed(10)		;This line worksGetOwningQuest().SetStage(5)					 ;This line works


I could set an alias or so up as blank filler, but how would say assign the person I just spoke with to that temp alias ?
Something like this:
TempAlias = "You that just left"TempAlias.SetFactionRank(MyFriendFaction, 1)TempAlias.Additem(MyFriendAmulet, 1)GetOwningQuest().SetObjectiveDisplayed(10)		;This line worksGetOwningQuest().SetStage(5)					 ;This line works

My problem is it's not a specific person. It could be any NPC that I talk with. Any help would be most appreciative please. Thanks

I could set an alias or so up as blank filler, but how would say assign the person I just spoke with to that temp alias ?

-Mush-

Edit: I just noticed the topic. "Person" is spelled wrong. (facepalm)
User avatar
Katie Pollard
 
Posts: 3460
Joined: Thu Nov 09, 2006 11:23 pm

Post » Mon Nov 19, 2012 10:56 pm

In Dialogue Info Fragments you can use a couple of special variables to get the speaker: http://www.creationkit.com/Topic_Info_Fragments

:)
User avatar
Jah Allen
 
Posts: 3444
Joined: Wed Jan 24, 2007 2:09 am

Post » Mon Nov 19, 2012 3:04 pm

Do you already have the dialogue created? Just inject your script into the script handler of the dialgoue and pass it the akSpeakerRef as a parameter.

For an example, see:

Character -> Quest -> DialogueFavorGeneric -> Dialogue Views -> DialogueFavorTopicsView -> "Follow Me, I need your help" -> "Okay"

Notice the script End Papyrus Fragment. See how they call a function on a different quest script and pass in the akSpeakerRef?

Furthermore, the DialogueFollower Quest has a script on it that does exactly what you are trying to do (assign a quest alias based on the conversation)
User avatar
KU Fint
 
Posts: 3402
Joined: Mon Dec 04, 2006 4:00 pm

Post » Mon Nov 19, 2012 11:44 pm

Thank you both. :) It's exactly what I needed to progress my mod.
User avatar
Abi Emily
 
Posts: 3435
Joined: Wed Aug 09, 2006 7:59 am

Post » Mon Nov 19, 2012 3:33 pm

I'm actually having trouble with this, maybe I'm trying to do something that can't be done who knows.

Here is my code:

Hunter.ForceRefTo(akSpeaker.GetDialogueTarget())

That is in a dialgoue fragment. After the NPC says his line, it runs that code, and also sets the stage in the quest. I want that NPC to become the quest Alias, but the quest marker doesn't point to him lol. The objective in the stage the script sets is set to have him as the target, and the next objective also has him as the target. Neither show him as such :shrug:
User avatar
Joe Alvarado
 
Posts: 3467
Joined: Sat Nov 24, 2007 11:13 pm

Post » Tue Nov 20, 2012 12:13 am

akSpeaker.GetDialogueTarget()

Won't that just return the player?

Would this work:
Hunter.ForceRefTo(akSpeaker.GetActorReference())

- Hypno
User avatar
Fluffer
 
Posts: 3489
Joined: Thu Jul 05, 2007 6:29 am

Post » Mon Nov 19, 2012 4:10 pm

akSpeaker.GetDialogueTarget()

Won't that just return the player?

Would this work:
Hunter.ForceRefTo(akSpeaker.GetActorReference())

- Hypno

No man it's telling me that's not a function :(

EDIT:

This seemed to work :)

Hunter.ForceRefTo(akSpeaker as Actor)
User avatar
C.L.U.T.C.H
 
Posts: 3385
Joined: Tue Aug 14, 2007 6:23 pm

Post » Mon Nov 19, 2012 6:08 pm

Fair do's mate. The "as Actor" was going to be my next suggestion but you already replied before I could edit the post lol

That function is part of the ObjectReference script. Seems akSpeaker must be an alias or something :shrug:

- Hypno
User avatar
Laura Cartwright
 
Posts: 3483
Joined: Mon Sep 25, 2006 6:12 pm

Post » Mon Nov 19, 2012 12:57 pm

Fair do's mate. The "as Actor" was going to be my next suggestion but you already replied before I could edit the post lol

That function is part of the ObjectReference script. Seems akSpeaker must be an alias or something :shrug:

- Hypno

If its an Obj ref then I think it needs to be akspeakerref instead of akspeaker.

Well now we know :)
User avatar
stacy hamilton
 
Posts: 3354
Joined: Fri Aug 25, 2006 10:03 am

Post » Mon Nov 19, 2012 8:35 pm

Does this mean they have fixed the dialogs??? :biggrin:
User avatar
Frank Firefly
 
Posts: 3429
Joined: Sun Aug 19, 2007 9:34 am

Post » Mon Nov 19, 2012 10:34 am

Nope...just means that they are using the workarounds mentioned on the dialogue bug thread

- Hypno
User avatar
Alexandra Ryan
 
Posts: 3438
Joined: Mon Jul 31, 2006 9:01 am

Post » Mon Nov 19, 2012 6:14 pm

Yep that's a negative. The dialogue only works with a "triggered" quest, or a SGE quest after a save/reload. Still.
User avatar
Chavala
 
Posts: 3355
Joined: Sun Jun 25, 2006 5:28 am

Post » Tue Nov 20, 2012 12:36 am

I can't say from memory and I'm not at my computer but I used how the follower dialogue quest did it. By studying that quest I was able to do exactly that. Assign a quest alias as the speaker.

And no, the dialogue bug is still there. I too have to save the game, then load it back to get the quest to start.
User avatar
RObert loVes MOmmy
 
Posts: 3432
Joined: Fri Dec 08, 2006 10:12 am

Post » Mon Nov 19, 2012 10:52 am

I'm actually having trouble with this, maybe I'm trying to do something that can't be done who knows.

Here is my code:

Hunter.ForceRefTo(akSpeaker.GetDialogueTarget())

That is in a dialgoue fragment. After the NPC says his line, it runs that code, and also sets the stage in the quest. I want that NPC to become the quest Alias, but the quest marker doesn't point to him lol. The objective in the stage the script sets is set to have him as the target, and the next objective also has him as the target. Neither show him as such :shrug:
MyAlias.ForceRefTo(akSpeaker) always works for me in dialogue fragments, simply akspeaker, nothing else, never had any problems :wink:
User avatar
Travis
 
Posts: 3456
Joined: Wed Oct 24, 2007 1:57 am


Return to V - Skyrim