Jump to content

Settler associations with settlements and quests


somethingbrite

Recommended Posts

Hi

Just wondering if anybody can knows and can explain how settlers are associated with settlements and quests in the game engine?

I've been noticing recent issue's where Settlers at one settlement are involved in some way in the quests of another settlement. 

Kidnap reported at Greentop in fact results in rescuing a settler from Finch farm for example. or settlers at one settlement giving the "are you here to help?" or "we knew you would help us" dialogue when in fact the quest they are relating to belongs to another settlement.

 

If checked with "showvars" these settlers all indicate that they belong to the correct workshop. (workshop ID 4 = Finch) - But also in showvars they are flagged as being part of the running script (for example there will be reference to Minrecruit01 etc)

 

All of the settlers can be assigned and will perform settlement tasks. Guard, farm, scavenge etc and when kidnapped will return to the correct settlement, but their greeting dialogue belongs to a quest script attached to a different settlement. 

Normally this would be a minor issue, but I think I have experienced two instances when in fact the settler that gives the mission is the one that belongs to a different settlement and cannot be found. (whole settlement is asking for help but settlement spokesperson can not be found.)

On the whole these are settlers that have never previously been attached to the other settlement. (In case of Greentop/Finch farm. All affected settlers were once at Sunshine tidings, but none have ever been part of Greentop nursery.

 

Just wondering if anybody can explain the mechanism or point me in the right direction. Is there a way to view and/or edit which settlers belong to which workshop?

 

Link to comment
Share on other sites

  • 2 weeks later...

Are you running any workshop-related mods ? If so, please list them.

What you report sounds very much like a threading issue.

If I'm right with this assumption, checking the workshopIDs of the affected settlers (this is a property on WorkshopNPCScript that gets initialized by a function on WorkshopParentScript that registers all new actors ) won't help at all since there's very likely nothing wrong wit them.

To understand the issue, let's assume that there is a lenghty function on one of the workshop scripts [NB: there are in fact several of those] that is called other scripts every once in a while. This other script is passing an actor in (and expects said function to do something with that actror, e.g. to modify certain parameters on his workshopNPCScript). Let's further assume that the function has to run some checks on the actor's current parameters (i.e. the modifications to apply depend on the current values), so it will likely start with reading out those values and storing them in local variables for quick access. Subsequently, it runs the checks on those local variables.

If that function is running long enough, there is a good chance that it will be called again (with a different actor passed in) before it has stopped running  Now we have two threads running, one for each acvtor, but they are running on the same script and are using the same local variables. The second thread, when it starts running, writes the data of the scond actor in those variables before it proceeds, so the first thread, if it has not yet finished its job on these values, is now using the parameter set of an entirely unrelated actor without even knowing it. This is what we call a threading issue. If they affect a frequently used function, they can make an ultimate mess within a very short period of time, and there's a high risk to damage the integrity of your game's data beyond repair.

Edited by Sclerocephalus
typos
Link to comment
Share on other sites

Hi Sclerocephalus

 

Yup, I'm running quite a few workshop related mods. 

I've attached the list as .txt file and also my total load order. (just in case I missed any as I made the list.)

There are a few that have been installed almost since I started playing and I did not notice any settler issue. These include Build and Scrap beyond workshop boundaries and Scrap everything. The impacted settlements so far appear to be 

Finch Farm / Greentop nursery. settlers from one were picking up quests for the other. I've had both these settlements since quite early in game but have only started developing finch farm recently. Greentop nursery is largely undeveloped. (some workbenches, turrets and a shack) - Finch farm however has been extensively rebuilt.

 Installed settlement and Npc mods.txt

LOOT load order.txt

Link to comment
Share on other sites

A side note since I noticed that you are using the mod IncreasedSettlerPopulation: This mod does nothing, except for taking up a slot. I really wonder where it did get  the close to 10,000 endorsements from [maybe people are happy nowadays already if a mod doesn't screw anything up <sarcasm off>].

Simple proof:

Let's have a look at the vanilla workshop script: The check for the maximum allowed settler count is in line 931:

"if ... && updateData.totalPopulation < GetMaxWorkshopNPCs()"

That is, the limit is recalculated every time that function runs by calling the GetMaxWorkshopNPCs() function. Now look at that function (lines 732-736):

int function GetMaxWorkshopNPCs()
; base + player's charisma
int iMaxNPCs = iBaseMaxNPCs + (Game.GetPlayer().GetValue(WorkshopParent.Charisma)) as int)
return iMaxNPCs
endFunction

Apparently, iMaxNPCs is the sum of a variable part (the player's charisma; this will change during the game) and a constant, namely iBaseMaxNPCs.
iBaseMaxNPCs is declared in line 180:

int iBaseMaxNPCs = 10 const

The game setting this mod is modifying is nowhere actually used by any of the workshop scripts.

 

EDIT:

Re-investigation showed that it is a bit more complicated than that. While the game setting is indeed nowhere used by the workshop scripts, it is used by workshop mode to discern whether a workshop is allowed to send a settler to. Simply speaking, which settlements are grayed out in the selection menu depends on whether their population is above a limit calculated from that game setting (since workshop mode is running at engine level, it is unknown how that calculation looks like).

That mod removes the limitation for sending settlers around. Therefore, it actually makes populations above the vanilla limit still possible, but only indirectly: to realize them, you have to move the settlers manually from other workshops. The mod does not alter the settler creation procedures at individual workshops though: they will still stop recruiting if they are above the limit specified by the various condition checks on WorkshopScript. They'll never reach a higher population on their own.

Link to comment
Share on other sites

And another side note:

The 'Yennefer Dresses' and 'Friffy Piper' mods come with faulty meshes that lead to instant crashes  of the CK, as explained here:

The FO4 engine is more forgiving than the CK, but one should nonetheless expect some benefits from fixing those meshes.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...