Trying to script a change on a NPC relationship

Post » Sun Jun 08, 2014 1:34 pm

So I started going back to one of my other quests on updating/fixing its dialogues and came across the Faction list of things, along with Relationships. I edit everything to basic to where when the Player meets this NPC that she's nothing but a stranger to him rather than being a friend right off the bat. In this quest after the player engages with her, I want her relationship with that player to change soon as the player accepts to help her. I also want to figure a script based on having the NPC following the player throughout this quest.

Then at the end of the quest after saving her sister, I want to change the relationshiprank again on her and her sister, so that the Player is closer with the two of them. So from the beginning another words when the Player first meets this NPC in order to start the quest, the relationship rank would change to "Friend" and after the quest to "Ally". If this makes sense.

I'm still limited on papyrus, so all of this is still new to me. Help would be great. If this helps, I've already setup the potential stages in the Factions (PotentialFollower and PotentialMarriage) Along with CurrentFollower, -1. Just the matter of understanding how to change relationships throughout the quest.

Thanks in advancement!

User avatar
Luis Longoria
 
Posts: 3323
Joined: Fri Sep 07, 2007 1:21 am

Post » Sun Jun 08, 2014 10:03 am

Edit: I tried doing some work in the process and this is my outcome.

GetOwningQuest().SetObjectiveDisplayed(10)
GetOwningQuest().SetStage(10)
Natashka.SetRelationshipRank(Game.GetPlayer(), 1)
(DialogueFollower as DialogueFollowerScript).SetFollower(akspeaker)
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname TIF__020012D4 Extends TopicInfo Hidden
;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
GetOwningQuest().SetObjectiveDisplayed(10)
GetOwningQuest().SetStage(10)
Natashka.SetRelationshipRank(Game.GetPlayer(), 1)
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
Function SetRelationshipRank(Actor Natashka, int aiRank) native
Debug.MessageBox("Relationship level :"+akSpeaker.GetRelationshipRank(Game.GetPlayer()))
Debug.MessageBox("Is the player a teammate :"+akSpeaker.IsPlayerTeammate())
akSpeaker.SetAV("WaitingForPlayer", 0.0);used to control wait/follow - see if they follow now?

Starting 1 compile threads for 1 files...
Compiling "TIF__020012D4"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__020012D4.psc(21,6): no viable alternative at input '.'
No output generated for TIF__020012D4, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__020012D4
User avatar
Ross Thomas
 
Posts: 3371
Joined: Sat Jul 21, 2007 12:06 am

Post » Sun Jun 08, 2014 8:13 pm

Edit: This is old DO NOT READ OR RESPOND TO THIS POST!!!! Edited the one above this one as my updated post.

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname TIF__020012D4 Extends TopicInfo Hidden
;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
GetOwningQuest().SetObjectiveDisplayed(10)
GetOwningQuest().SetStage(10)
Natashka.SetRelationshipRank(Game.GetPlayer(), 1)
;END CODE
EndFunction
;END FRAGMENT
;END FRAGMENT CODE - Do not edit anything between this and the begin comment
Faction Property NatashkaFaction Auto
User avatar
Matt Bee
 
Posts: 3441
Joined: Tue Jul 10, 2007 5:32 am

Post » Sun Jun 08, 2014 10:23 pm

I think what you need is to define the property of the actor 'Natashka.'

Actor Property Natashka  Auto

If you want to change the player's rank in a custom faction, that's something else entirely different.

But...can I ask why you are bothering with relationship ranks if these are custom NPCs? If you need to condition dialogue and dialogue responses, you can just easily use the quest stages.

User avatar
Nikki Lawrence
 
Posts: 3317
Joined: Sat Jul 01, 2006 2:27 am

Post » Sun Jun 08, 2014 5:19 pm

Because I want to turn them into followers (Apologize, I should've been a bit clearer.)

Well here's the problem. You stated properties, which is true; however, my response when trying to put her as Actor in properties is this still:

Starting 1 compile threads for 1 files...
Compiling "TIF__020012D4"...
C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\TIF__020012D4.psc(20,6): no viable alternative at input '.'
No output generated for TIF__020012D4, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__020012D4
And her Actor on properties doesn't show. I may have to reload it and see if that will fix it. Right?
User avatar
Sian Ennis
 
Posts: 3362
Joined: Wed Nov 08, 2006 11:46 am

Post » Sun Jun 08, 2014 1:16 pm

Also, apologies for being so quick, but that quote is old. I edited my previous issue on the 2nd post. All I have a problem with is the code I just pasted

Edit: Huh. Don't even need to use properties to define Actor. Just type it in under the Script Editor. Well that worked. I also tried deleting that chunk of debug data underneath the Relationshiprank, and I had no errors, but I fear the script won't work. Because wouldn't you need to define the relationshiprank or does it already do that under the OwningQuest?

User avatar
Vickey Martinez
 
Posts: 3455
Joined: Thu Apr 19, 2007 5:58 am


Return to V - Skyrim