Jump to content

Companion affinity script help


McFearo

Recommended Posts

I'm trying to set up a basic script where a companion will add points to a variable called Affinity -- similar to Boone's Openness -- as the player performs certain actions in the game that he favors or chooses certain dialogues that are kind to him. Currently, the GECK is accepting the scripts I've written, but they're not actually doing anything as far as I can tell.

 

I added the following to his quest script:

short bAffinity

Then in the result script end box for a dialogue, I added the following:

set DixieFollowerQuest.bAffinity to DixieFollowerQuest.bAffinity +2;

With the intention that by activating that dialogue, the player would add 2 points to bAffinity.

 

Then I created another dialogue with the condition "GetQuestVariable DixieFollowerQuest,bAffinity >=1" with the intention that this dialogue would only show at the top level if the Affinity level is at least 1 point. This was just a basic "Test" dialogue to test the affinity system.

 

But currently it's not showing even after selecting the dialogue that should have given 2 affinity up front.

 

Someone's gonna tell me I'm nuts for this but I also inserted scripting into Vulpes' script to the effect of "OnDeath, if Dixie is hired, set bAffinity to +1" -- again, much like how Boon gains a point of Openness when Vulpes dies while he's in the party. This also doesn't seem to be causing the dialogue with the affinity condition to trigger.

 

Here's the actual script for that if you're wondering:

BEGIN OnDeath

if (DixieFollowerQuest.bDixieHired == 1)
   set DixieFollowerQuest.bAffinity to DixieFollowerQuest.bAffinity +1;
endif

I guess... help?

 

In case you can't tell I'm brand spankin' new to scripting and this is my first time trying to piece together my own script copying one from the game so I've probably missed something big. This might be too ambitious a script for a newbie but weeeeeh I really want to make it work.

 

TL;DR I want my companion to gain Affinity as the player is kind to him and when certain decisions are made throughout the game, like Boone, but my script for this isn't working.

Edited by McFearo
Link to comment
Share on other sites

Update:

 

After more testing, the scripts to add affinity through dialogue do seem to be working, the new conversation options just won't show up in the same conversation in which the affinity was gained; you have to exit out and speak to him again.

 

He still does not seem to be gaining affinity from killing Vulpes though.

Link to comment
Share on other sites

Nevermind I figured it out.

 

The Vulpes script was set to check if bDixieHired == 1 before it will give the affinity bonus for killing Vulpes. The problem was that I had already hired Dixie and saved my game before I set up bDixieHired as a variable that sets to 1 when you hire him, so it never got set to 1 even though he was hired. The fix was just to fire him and re-hire him, and now he seems to be gaining Affinity from killing Vulpes and unlocking new dialogue just fine.

 

Ta da! I'm a dumbass.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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