Welcome to the AFK Mods bug tracker. In order to report an issue, please select a project from the drop down menu below. Select “Open New Issue” and fill out the form with as many details as possible.

An account will be required to submit an issue, so if you need one and are unable to register, please contact us via the forums at https://afkmods.iguanadons.net/

Issue Data
Status: Closed
Issue Type: Bug Report
Project: Unofficial Fallout 4 Patch
Component: Fallout 4: Vanilla
Category: Actors
Assigned To: MadCat221
Platform: All
Severity: Low
Votes: 2
Watching: N/A
Opened By spacefiddle on Jan 30, 2017 6:39 pm
Last Edited By Arthmoor on May 5, 2017 10:30 pm
Closed By Arthmoor on May 5, 2017 10:30 pm
Resolution: Fixed
Comment: Fixed for UFO4P 2.0.1.

Issue #21994: Solution: Companions repeat their random dialogue non-stop once dismissed

When a companion is dismissed anywhere, they are found at that location repeating all their random voice lines non-stop. This is because an error in FollowersScript sets the values of both IdleChatterTimeMin and IdleChatterTimeMax to zero, causing constant firing. The source of the error appears to be that a variable is being used in a function that only accepts a float as a parameter, resulting in NONE.

The intent seemed to be: the companions have an interval to say their lines - when they are picked up as a companion, store those values and swap in a different pair of values - then when they are dismissed, swap back to restore original values. Except this did not work, zero is cached, None is set when the invalid parameter is passed in; and that's that, Min and Max are zero forever.

I've fixed this in a patch but since it's FollowersScript, it is incompatible with anything. This fix should be made baseline.

The relevant lines in FollowersScript are:

Around line 606 - gets the HARDCODED values from the CK, and sets up two values to "cache the current value." Actor in-game seems to get these values at this stage.

Around line 1070 - this is where the values get swapped on acquire / dismiss.
Line 1102: I believe the function
;IDLE CHATTER - set them back
CompanionActor.SetValue(IdleChatterTimeMin, CachedIdleChatterTimeMin)
CompanionActor.SetValue(IdleChatterTimeMax, CachedIdleChatterTimeMax)
does not accept variables. It seems to set companions to 0 at this stage, going by getting values from actors in-game at various points before and after dismissal. I commented out this call entirely since I can't think of any good reason to change this interval.

At line 1084 (companion acquire), instead of blindly cacheing what we assume is a valid value with no sanity checks, I just set:
CompanionActor.SetValue(IdleChatterTimeMin, 600)
CompanionActor.SetValue(IdleChatterTimeMax, 900)

and then they STAY QUIET when dismissed, for at least 10 minutes and possibly up to 15 :P

I am attaching the copy of FollowersScript that I edited and commented.

At launch, the interval values were Min 600 and Max 900: 10-15 minutes between random lines. This seems rational. It remained at these values until Nuka-World, which for some ungodly reason set Min and Max to 240 and 300 - meaning even if it worked, 4-5 minutes between the five random lines they say. If you fix this, I implore you to go with the original intended Vanilla default :).

Attached Files:




5 comment(s) [Closed]
Sclerocephalus said:
Believe it or not, but there's nothing wrong with the followers script. There's no problem in passing a variable for a float argument as long as this variable holds a float or integer value (which it does). Floats and integers can be cast into one another (and the compiler does an autocast in such cases). If there was a type mismatch issue of any kind, the script would not compile. It's that simple (honestly).

What's actually wrong here is that the actor values in question are zero by default for all follower NPCs. They have no values specified in the actors' stats tab, so the engine assigns them the default values (which are in fact zero). That is, the values do not become zero by an obscure error in the followers script (there are no errors on that script, at least not in the CompanionDataToggle function), they are zero because they always have been. You can check this by adding a timer event to either CompanionActorScript or WorkshopNPCScript (all followers are running those scripts) and let them print out the current values in regular intervals. They are zero at all times - except when an actor has joined the player. During that time, they are set at Min 240/Max 300. After dismissal, the cached values are reset (and they are zero, which is no surprise).

To fix this, you only have to make sure that the actor values get initialized with proper values when an actor joins the player for the very first time - or even better, to make sure that they get initialized at game start, because you actually don't want to 'fix' just the current follower, but all potential followers at once.

Solutions that do not require any additional operations (such as re-hiring and dismissal) to be carried out by the player are preferrable. Therefore, the followers script is actually the wrong place. A much better fix is provided by adding an OnLoad() event to CompanionActorScript to initialize the actor values. That script has all the properties you need already pre-defined, so you can check whether the actor in question is a current follower - and take care of him specifically by setting the cached properties on followers script to the new defaults (instead of setting them on the actor because they would be overwritten otherwise on dismissal).

This does the job, fixes all actors at once, does not require any additional operations by the player and is perfectly retro-active. Plus, it maintains compatibility with follower mods because it doesn't touch that script.

Comment #1 Mar 9, 2017 9:38 pm  Edited by on Mar 9, 2017 9:42 pm
spacefiddle said:
Thank you, very detailed explanation. Didn't know that about the other script, which I'm guessing isn't touched by other mods much, or at all.

So it looks like it was meant to be using the 4-5 minute intervals while active as a companion, and a 10-15 minute interval while hanging around a settlement?

Comment #2 Mar 10, 2017 5:31 am  Edited by on Mar 10, 2017 5:31 am
Sclerocephalus said:
There is no evidence whatsoever that a 10-15 minute interval was intended as default. Those values (i.e. Min 600/Max 900) don't exist anywhere in Fallout.esm nor on any script that modifies those actor values (I checked the entire script folder for FO4 and all DLCs for scripts that may modify them). Where did you get them from ?

Comment #3 Mar 10, 2017 1:07 pm  Edited by on Mar 10, 2017 1:07 pm
spacefiddle said:
Travelling, will check when I arrive... I remember seeing them specifically at 600-900 pre-NW, and 240-300 post. Not in the ESM; they aren't hardcoded Global vars? I thought I saw the script try to pull those first (and fail).

Comment #4 Mar 10, 2017 4:31 pm  Edited by on Mar 10, 2017 4:31 pm
spacefiddle said:
Sorry I haven't updated - I can no longer find the copy of the source code, I think I've overwritten it. An older copy of FollowersScript.psc had the values 600 and 900, around line 600. In the version of FollowersScript the CK had uncompressed after NW was released, they were the 240 and 300 values you see now. I can't find them anywhere else and my project folders are kind of a mess. I'm not sure if there's any way to check back to historical sources for earlier game versions, and I'm not sure why they'd have made the interval so short for Nuka-World (it's not like Gage has that many lines...).

Comment #5 May 2, 2017 3:29 pm  Edited by on May 2, 2017 3:29 pm
Showing Comments 1 - 5 of 5