MesaSolar Posted July 11, 2021 Share Posted July 11, 2021 Is anyone familiar with how the companion affinity system triggers a dialogue scene between the player and companion? I'm thinking specifically of Cait and how she "wants to talk" to the player that then triggers a dialogue scene that starts her companion quest. I know this isn't the easiest way to start a quest but it's how I'd like to structure my mod. -MesaSolar Link to comment Share on other sites More sharing options...
LarannKiar Posted July 13, 2021 Share Posted July 13, 2021 The affinity system is.. a bit complex.. See the function SetQueuedThresholdSceneToPlay() in the CompanionActorScript. If you already have the affinity dialogue scene, just attach a script to that scene: Scriptname YOURSCRIPTNAME extends Scene Const Quest Property MyQuest Atuo Const {Fill this script property with the quest you'd like to start} Event OnBegin() ;you could use Event OnEnd() too. In this case, MyQuest would start when the scene ends. MyQuest.Start() EndEvent But if you'd like to create a new affinity dialogue scene, then you have familiarize yourself with the CompanionActorScript and FollowersScript, Link to comment Share on other sites More sharing options...
MesaSolar Posted July 20, 2021 Author Share Posted July 20, 2021 So I did so more digging and found a couple conditions on the ComCait quest Conditions: Get Value: Actor Value: "CA_Wants to talk" =1Get Value: Actor Value: "CA_AffinitySceneToPlay" : Global: CA_Scene_Infatuation" How are these values related to the script you suggested? Link to comment Share on other sites More sharing options...
LarannKiar Posted July 20, 2021 Share Posted July 20, 2021 (edited) Conditions: Get Value: Actor Value: "CA_Wants to talk" =1Get Value: Actor Value: "CA_AffinitySceneToPlay" : Global: CA_Scene_Infatuation" These actor values are handled by the CompanionActorScript. This script is attached to each companion (see CompanionCait, FormID: 00079249). When your companion's affinity reaches a certain point, it sets these actor values to 1 so that the affinity scene can play. By the way, companion affinity is also defined in an actor value: CA_Affinity. How are these values related to the script you suggested? They are not related to the code I wrote. It's only useful if you already have an affinity scene which would trigger their special "affinity quest". If you'd like to create a custom companion with custom affinity and scene, then well.. it's much more complicated. Edited July 20, 2021 by LarannKiar Link to comment Share on other sites More sharing options...
MesaSolar Posted July 24, 2021 Author Share Posted July 24, 2021 I got it working. Followed this tutorial on YouTube to set up the companion and affinity system: I cloned Cait, cloned the ComCait quest, then set the conditions above on the start greeting of the scene. Then all you have to do is run a fragment at the end of the dialogue to start the quest myquest.setstage(10) and it works! I did have to have the following in my fallout4custom.ini file as well. Don't know why, but my mod doesn't work without it. Also required for CBBE to work: [Archive]bInvalidateOlderFiles=1sResourceDataDirsFinal= Link to comment Share on other sites More sharing options...
Recommended Posts