Jump to content

Some help with scripts needed <3


Somaru

Recommended Posts

Hey, guys! I'm having a bit of an issue getting Fallout 4 to actually use my compiled scripts. I'm 90% sure that the script syntax is fine as it was only some edits to the raiding intervals for settlements.

 

IE: The check that determines if it's been a minimum of 7 in game days before being potentially raided again

IE: The maximum amount of settlers allowed in any given settlement

 

The issue in particular is that the game doesn't seem to be using my script and is still using the default settings. I recall reading that sometimes the game may take a few in game days to start using the new script, but after waiting weeks in game and nothing, I'm starting to wonder.

 

 

Thanks in advance!

Link to comment
Share on other sites

Can you post the script?

 

And you can check how many days have passed via GameDay.GetValue()(make property first), and use a bit of comparing and math between days, if the day has changed. That is a valid method as long as it's in the same month.

;******************

; moved from workshopparent

; productivity formula stuff

float minProductivity = 0.25 const

float productivityHappinessMult = 0.75 const

 

; happiness formula stuff

float maxHappinessNoFood = 30.0 const

float maxHappinessNoWater = 30.0 const

float maxHappinessNoShelter = 60.0 const

 

float happinessBonusFood = 20.0 const

float happinessBonusWater = 20.0 const

float happinessBonusBed = 10.0 const

float happinessBonusShelter = 10.0 const

float happinessBonusSafety = 20.0 const

 

int minHappinessChangePerUpdate = 1 const ; what's the min happiness can change in one update?

float happinessChangeMult = 0.20 const ; multiplier on happiness delta

 

int minHappinessThreshold = 10 Const ; if happiness drops <= to this value, player ownership is cleared

int minHappinessWarningThreshold = 15 const ; if happiness drops <= to this value, give happiness warning

int minHappinessClearWarningThreshold = 20 const ; if happiness >= this value, clear happiness warning

 

int happinessBonusChangePerUpdate = 2 const ; happiness bonus trends back to 0 (from positive or negative)

 

; production

int maxStoredFoodBase = 1000 const ; stop producing when we reach this amount stored

int maxStoredFoodPerPopulation = 1 const ; increase max for each population

 

int maxStoredWaterBase = 1000 const ; stop producing when we reach this amount stored

float maxStoredWaterPerPopulation = 0.25 const ; increase max for each population

 

int maxStoredScavengeBase = 1000 const ; stop producing when we reach this amount stored

int maxStoredScavengePerPopulation = 5 const ; increase max for each population

 

float brahminProductionBoost = 0.5 ; what percent increase per brahmin

int maxProductionPerBrahmin = 10 ; each brahmin can only boost this much food (so max 10 * 0.5 = 5)

int maxBrahminFertilizerProduction = 3 ; max fertilizer production per settlement per day

int maxStoredFertilizerBase = 10 ; stop producing when we reach this amount stored

 

; vendor income

int minVendorIncomePopulation = 5 ; need at least this population to get any vendor income

float maxVendorIncome = 50.0 ; max daily vendor income from any settlement

float vendorIncomePopulationMult = 0.03 ; multiplier on population, added to vendor income

float vendorIncomeBaseMult = 2.0 ; multiplier on base vendor income

 

; radio/attracting NPC stuff

int iMaxSurplusNPCs = 50 const ; for now, max number of unassigned NPCs - if you have this many or more, no new NPCs will arrive.

float attractNPCDailyChance = 1 const ; for now, roll <= to this to attract an NPC each day, modified by happiness

int iMaxBonusAttractChancePopulation = 5 const ; for now, there's a bonus attract chance until the total population reaches this value

int iBaseMaxNPCs = 50 const ; base total NPCs that can be at a player's town - this is used in GetMaxWorkshopNPCs formula

float attractNPCHappinessMult = 0.5 const ; multiplier on happiness to attraction chance

 

; attack chance formula

float attackChanceBase = 1 const

float attackChanceResourceMult = 0.001 const

float attackChanceSafetyMult = 0.01 const

float attackChancePopulationMult = 0.005 const

float minDaysSinceLastAttack = 0.0 const ; minimum days before another attack can be rolled for

 

; damage

float damageDailyRepairBase = 25.0 const ; amount of damage repaired per day (overall)

float damageDailyPopulationMult = 0.25 const ; multiplier on population for repair: repair = population * damageDailyPopulationMult * damageDailyRepairBase

 

; timer IDs

int buildWorkObjectTimerID = 0 const

int dailyUpdateTimerID = 1 const

 

; randomized wait for next try at DailyUpdate if system is busy

float maxDailyUpdateWaitHours = 1.0

float minDailyUpdateWaitHours = 0.2

 

 

 

 

 

This is the modified bit from Workshopscript, a base game script that I edited in order to make raids far more frequent (Or that was the plan...)

Link to comment
Share on other sites

This script does nothing as you have only defined variables. There is no logic which tells the game what to do.

As stated, this is the modified portion of the WorkshopScript. Nothing else in the script was modified. It's exactly the same as Vanilla except for this segment. The entire script is waaay long and would be horrible to paste.

Link to comment
Share on other sites

Changing existing scripts can be a pain, a lot of the data and functions end up stored in your save file (prevents your save from being corrupted and probably aids in optimization), which is why you sometimes have to wait a few in game days for the scripts to update.

 

I'd first try editing a value you can test easily, for example, the vendor max income and multiplier. To test it, find one of your settlements that is creating the max caps before your change, save, exit, then change the script and sleep 24 hours so your workshop updates again and check if they created more caps this time or the same amount (you may have to find something to do after sleeping/waiting 24 hours as the workshop daily update may not complete immediately).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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