Jump to content

Has Anyone Figured Out Quest Affinity?


Recommended Posts

I've edited CompanionAffinityEventQuestScript and added all the properties and functions for my companion, but it doesn't work in-game. I've seen a few topics like this floating around the internet but none with an answer. Is there anyone out there who has managed to get quest affinity working for a custom companion?

 

If it matters, I only added Companion_Likes() to a few quests in the script because that thing is massive and I wasn't going to waste hours adding affinity bumps to all of them only to discover it doesn't work.

Link to comment
Share on other sites

This is how I did it. It works 100% and does not alter ANYTHING in the base game files, so it does not conflict with anything. Works 100% with Unlimited companion framework etc. Ok, here goes. Let's assume my companions name is Noob.

 

1. Make a new quest. Name is: COMNoobAffinityQuest. Priority 1. NOT start game enabled. NO aliases.

 

2. Go to Scripts and put DLC04:DLCUpdateFollowersDataScript in your quest. Fill it with your companion properties. This is how Gage and Longfellow are put to companion affinity system.

 

3. Find These 3 scripts: DLC04:DLC04_BaseGameAffinityEventsScript, DLC04:DLC04_NewAffinityEventsScript, DLC04:DLC04_PreviousDLCAffinityEventsScript. Make a new script for each one of them. Simply Ctrl+A + Ctrl + C their stuff to new scripts. So then you have 3 scripts named : NoobDLC04:DLC04_BaseGameAffinityEventsScript, NoobDLC04:DLC04_NewAffinityEventsScript, NoobDLC04:DLC04_PreviousDLCAffinityEventsScript.

 

4. Now, open the scripts in notepad++, replace word Gage, with Noob(your companion name), and do what you want with the dislikes, likes etc.

 

5. Fill the properties in your new script. Auto fill will fill most of the stuff, but anything that is Gage -> Noob(your companion).

 

6. Once you have the scripts ready, make sure you start your quest WHEN(or whatever you do, don't put it start game enabled) you first time recruit your companion or put it on holotape. For some reason it sometimes fails to work if it's start game enabled and you start new game, most likely because the DLC04:DLCUpdateFollowersDataScript conflicts with Gage and Longfellow at the same time. Just make sure you start your quest a bit later and everything will work. I simply start my quest when I pickup my companion the first time in the pickup quest fragment.

 

7. You are done, now your Affinity works like a charm. No conflicts with other mods. It just works and it works good.

 

TLDR:

 

Easiest way is to Check how DLC04_CompanionAffinity quest works. That is Gage from Nuka World, now just do own version to your companion.

 

Edit: Also this way you don't have to touch Followers quest or FollowersScript at all. Your follower is still fully functional but also works with other mods that touch followers quest.

Edited by vkz89q
Link to comment
Share on other sites

Thank you so much to vkz89q for figuring this out!! I've been trying to do this for ages and just couldn't seem to get it.

 

I do have what might be a dumb question, though. I finally found the dlc04 scripts and copied them all over to my data/scripts folder. I can add the scripts into my quest in the CK but I can't right click and edit them; the option is greyed out! Does anyone know why that might happen? I can right click on any other scripts and edit them, like from the base game--just not from that DLC. Is there another file location I'm supposed to put the scripts? Thank you so much again for the help!!

Link to comment
Share on other sites

What I mean is: Go to DLC04_CompanionAffinity quest script section. Open one of the scripts with "Edit source" button. Copy everything. Make a new text file, notepad++ is good.

 

Now, paste and save that file, it can be mytempscript1.txt or whatever. Now edit, the file how you want the dislikes to be. Do not put this script to ck just yet. Let it be just a text file until you have gone trough all events.

 

For example first affinity event in Gage script is:

			; INFO/STAGE 000F7404  on BoS100
			; DESCRIPTION: Player met and helped out the Brotherhood. Here, he agrees to continue to help without knowing what he's getting into.

			;DLC04 COMPANIONS: 
			Gage_Dislikes()

You want your companion to like that, you simply change that to Gage_Likes(). But, you want to use notepad++ "search and replace" or similiar to replace word "Gage" with your companion name.

 

I hope you get what I mean.

 

So in the end your text file is something like this:

; INFO/STAGE 000F7404  on BoS100
			; DESCRIPTION: Player met and helped out the Brotherhood. Here, he agrees to continue to help without knowing what he's getting into.

			;DLC04 COMPANIONS: 
			MyCompanionName_Loves()

Once you are done with your text file(it's still just a text file). You go to YOUR affinity quest(or make one), go to scripts, press a new script, give it some ok name, and simply copy paste your text file you did earlier to the script window and save it. Make sure you name everything right. Everything renames pretty nicely if you just replace the word. Then when you have the script saved and compiled, simple go to it's properties and press auto fill all, and it will fill most of the stuff.

 

Some are missing, and now just look how Gage's original script is set, and instead of Gage in properties, put your companion.

 

You can't use the vanilla scripts DLC04:DLC04_BaseGameAffinityEventsScript, DLC04:DLC04_NewAffinityEventsScript, DLC04:DLC04_PreviousDLCAffinityEventsScript, because if you change them, you will also change what Gage dislikes/likes etc. So you make new script in CK and use those as bases(copy paste what they have and modify your new scripts). Or actually, you make 3 new scripts and there is one script that is short and you can use, it's the DLC04:DLCUpdateFollowersDataScript.

 

Hope this helps. I'm kinda bad explaining stuff, lol. In the end your quest has 1 vanilla script and 3 custom scripts that are modified from vanilla scripts.

 

Those scripts are well commented, so it's easy to modify what you want your companion to like/dislike.

 

 

Just open the vanilla scripts first and look at them, you will propably figure pretty fast how they work. Ask if something is unclear.

Edited by vkz89q
Link to comment
Share on other sites

If you can't open the vanille scripts in ck, you have to extract the dlc script rars/zips in data folder.

 

This is where my dlc scripts seem to be

C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\Scripts\Source\Base\DLC04

Edit: Sorry for the big wall of text. I missread your post first. Well, I hope that wall helps too :tongue:

 

Edit2: Also don't paste the first lines from vanilla scipts like:

Scriptname DLC04:DLC04_NewAffinityEventsScript extends Quest

When you make new script, it makes it automatically to your namespace and script name but you propably knew that already.

Edited by vkz89q
Link to comment
Share on other sites

  • 4 months later...

Ok I'm in the middle of editing the files. In the files it calls for the Affinity array created in the CK for the NPC,

 

 

Group DLCCompanionAffinityKeywords
keyword Property CA_CustomEvent_GageLoves auto const mandatory
keyword Property CA_CustomEvent_GageLikes auto const mandatory
keyword Property CA_CustomEvent_GageDislikes auto const mandatory
keyword Property CA_CustomEvent_GageHates auto const mandatory
keyword Property CA_CustomEvent_Gage__UNSET auto const mandatory

 

My characters name is SallyFields and I've been using that as the NPC identity in the likes and dislikes part of the script files. In the CK I had already created the Keywords Property's before I started this process using just Sally in other words.

 

keyword Property CA_CustomEvent_SallyLoves auto const mandatory

 

Will this have an affect on the script or as long as the array and NPC name matches what has been created in the CK things should be OK? Hope someone sees this as I'm in the middle of working on this.

 

Thanks

Edited by RadoGamer
Link to comment
Share on other sites

  • 4 months later...
Just wanted to pipe in that this worked like a charm! I did notice that even with my handler quest set up as not start enabled and with no alias refs, it was still initializing on first load. But it didnât fail to load affinity scripting, so Iâll count it as a win. I even used it to create a new custom affinity event.
Link to comment
Share on other sites

  • 2 weeks later...

Just wanted to pipe in that this worked like a charm! I did notice that even with my handler quest set up as not start enabled and with no alias refs, it was still initializing on first load. But it didnât fail to load affinity scripting, so Iâll count it as a win. I even used it to create a new custom affinity event.

 

I did all of the steps required and quest affinity is still not working for me. Maybe there was something I overlooked during the settings?

Link to comment
Share on other sites

You made sure that the affinity events were also set up in your companionâs actorscript? The one attached to the NPC.

 

My companion affinity handler is set as was laid out and works like a charm. Just be sure to do a search and replace to change Gage to whatever you call your NPC. One thing I did that deviated from the instructions was to remove all of the vanilla companions from the Nuka World affinity script (thereâs no reason to call these a second time since Gage does that). So all it does is add my NPC to Nuka World quest affinity.

 

But in short, my only guess as to why it isnât working if you followed the steps is that a keyword link isnât set up correctly somewhere.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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