Leveled Lists use within the Scavenging Station

Post » Fri Mar 11, 2016 10:59 am

Questions:


How do Leveled Lists work when creating a random loot pool? How can we then use that info for calculating the odds of having a specific item be added to a Settlement by a scavenger?



Background:


I have been curious about how the Scavenging Station works, and have been looking at how the game handles this mechanic of Settlements. After digging around a bit, it looks like the stations use Leveled Lists to determine what items a settler can find each day, when they are assigned to a Scavenging Station.



It has been awhile since I worked with the GECK/CK, and I was wondering about how Leveled Lists are used to create random loot pools.




I think for the Scavenging Station the top level Leveled List(LL) is WorkshopProduceScavenge [LVLI:00026839] It has a LVLD - Chance None with a value of 25, and the list is made up of 10 other LL. 6 entries of LLI_Scavenge_Common [LVLI:0024708D] , 3 entries of LLI_Scavenge_Uncommon [LVLI:0024708E] , and 1 entry of LLI_Scavenge_Rare [LVLI:0024708F] .



If I wanted to find out the chance of a settler finding a MilitaryAmmoBag "Military Ammo Bag" [MISC:00060E77] , which happens to be a 1 of 25 items in the LLI_Scavenge_Uncommon list, could I use the following?



If LVLD - Chance None = 25, the scavenger would find something 75% of time.


based on WorkshopProduceScavenge, there is a 3 out of 10 chances of having the LLI_Scavenge_Uncommon


Then, the Military Ammo Bag is 1 out of 25 chance of being chosen.



.75 * .3 * .04 = .009



So the scavenger has a .9% chance per day of adding a Military Ammo bag to a workshops Inventory.




There is also more going on behind the scenes with the workshopscript.pex. It looks like that script runs a check, and that settlements have a max amount of components/scavenge available. If the settlement is over that amount, the settlers won't be able to scavenge.



within the workshopscript.pex

Function DailyUpdateSurplusResources(workshopdatascript#workshopratingkeyword[] ratings, workshopscript#dailyupdatedata updateData, ObjectReference containerRef)
...
Int currentStoredScavenge = containerRef.GetItemCount(WorkshopParent.WorkshopConsumeScavenge as form)
...
Bool bAllowScavengeProduction = true
If (currentStoredScavenge > maxStoredScavengeBase + maxStoredScavengePerPopulation * updateData.totalPopulation)
bAllowScavengeProduction = false
EndIf
...
Int scavengePopulation = (updateData.unassignedPopulation as Float - self.GetValue(ratings[WorkshopParent.WorkshopRatingDamagePopulation].resourceValue)) as Int
Int scavengeProductionGeneral = self.GetValue(ratings[WorkshopParent.WorkshopRatingScavengeGeneral].resourceValue) as Int
Int scavengeAmount = math.Ceiling(scavengePopulation as Float * updateData.productivity * updateData.damageMult + scavengeProductionGeneral as Float * updateData.productivity)
If (scavengeAmount > 0 && bAllowScavengeProduction)
containerRef.AddItem(WorkshopParent.WorkshopProduceScavenge as form, scavengeAmount, false)
EndIf

I used the f04Edit 3.1.3 tool to look at the leveled lists, and the PapyrusDotNet PexInspector - v0.2.1 Alpha tool to look at the scripts.



Thanks for any help with this, or any suggestions for learning more about Leveled Lists.

User avatar
Madison Poo
 
Posts: 3414
Joined: Wed Oct 24, 2007 9:09 pm

Return to Fallout 4