![]()
|
|
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.
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.
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?
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?
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 ?
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).
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...).
Showing Comments 1 - 5 of 5