Jump to content

Possible to make plants (corn, tatos, ...) in settlement regrow much slower?


Recommended Posts

Good evening everybody!

 

Is it possible to change how much time the food producing plants in settlements take to regrow after harvesting them?

I want them to take a few in-game (or months) weeks to regrow, just to make it more realistic.

 

I already looked around in the CK and couldn't find anything ...

Link to comment
Share on other sites

I also looked into that a while back but couldn't find anything in the CK. I think it could probably be done with scripts though ... but don't know how.

 

you may want to look at this mod: https://www.nexusmods.com/fallout4/mods/14835?tab=description

 

it allows for plants to grow without a settler assigned to them and there is some sort of timer to the auto growth ... but it's probably done via scripts as well.

Link to comment
Share on other sites

Note also that the harvesting function is completely separate from the "produce for workshop" function.

Yes, the "harvest" function is when you actually activate it, so it is kind of like a normal "onActivate" script (when activated the player character says "need to assign someone to this" or "seems to be growing well" depening on if a settler is assigned or not).

The "produce for workshop" works with some sort of timer I guess that also checks if a settler is assigned to the plant.

 

I am talking about both of them, so blocking the activation to "harvest" and blocking the "adding stuff to the workshop inventory" for longer times.

Link to comment
Share on other sites

In the WorkshopObjectScript, which is attached to the flora form, you can find a local, constant, float variable:

float floraResetHarvestDays = 1.0 const ; how many game days to reset harvestable flora?

Which is used later in the following function:

; called on workshop objects during reset
function HandleWorkshopReset()
	; since workshop locations don't reset, do it manually
	float harvestTime = GetValue(WorkshopParent.WorkshopFloraHarvestTime)
	if GetBaseObject() as Flora
		;WorkshopParent.wsTrace(self + " HandleWorkshopReset: last harvest time=" + harvestTime +", IsActorAssigned=" + IsActorAssigned() + ", current time=" + utility.GetCurrentGameTime())
		if IsActorAssigned() && utility.GetCurrentGameTime() > (harvestTime + floraResetHarvestDays)
			SetHarvested(false)
		endif
	endif
endFunction

And this function is called in WorkshopParentScript by the ResetWorkshop function (clear and recalculate workshop ratings), which is triggered by OnLocationChange in the same script, which is registered for the player at the stage 10 of the WorkshopParent quest through the StageSet event in this same script.

 

TLDR: The variable that controls that parameter (floraResetHarvestDays) is local to the WorkshopObjectScript so, if you want it to be different only for certain/custom flora you would need to create a duplicate of this script, with this value modified or replaced by an accesible value, like a property or a global, and attach it to such flora (replacing the vanilla script if needed). If you want it to be changed globally you could edit the vanilla WorkshopObjectScript script instead.

Link to comment
Share on other sites

I feel stupid now for not looking at the workshop script ...

 

Thanks for pointing out that the solution was right before my eyes the whole time ;-)

 

 

EDIT:

 

So it would technically be possible by editing the script to check the current in-game month to make workshop plants produce nothing during winter ...

 

Interesting ....

Edited by YouDoNotKnowMyName
Link to comment
Share on other sites

  • Recently Browsing   0 members

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