Jump to content

Recommended Posts

Posted

When playing with no-respawn flora also won't respawn.

Has anyone scripted respawning flora?

 

Does self.reset() work?

 

 

Btw. I could obviously test this out but only in one or two days, so that's why I'm asking beforehand

 

 

 

Posted

Sure thing:

Scriptname SKK_MWFloraScript extends ObjectReference Const

ActorValue 	Property pSKK_MWTimeStamp 		Auto Const Mandatory 
GlobalVariable 	Property pSKK_MWFloraRegrowthGameHours 	Auto Const Mandatory ;GameDaysPassed Hours: (1/24) = .04167

;Default regrowth is 24 game hours from harvest.
;The plant does not update unless the player leaves and returns so it can unload/load to refresh
;avoiding a s#*! load of timers ticking. There are solutions that tick a timer for each plant FFS. 

;**********************************************************************************************
Event OnInit()
	Self.SetHarvested(TRUE)
	Self.SetValue(pSKK_MWTimeStamp, Utility.GetCurrentGameTime())
EndEvent
;**********************************************************************************************
Event OnLoad()
    If (GameHoursToGo() <= 0)
        Self.SetHarvested(FALSE)
    EndIf
EndEvent
;**********************************************************************************************
Event OnActivate(ObjectReference akActionObject)
	Self.SetHarvested(TRUE)
	Self.SetValue(pSKK_MWTimeStamp, Utility.GetCurrentGameTime())
EndEvent
;**********************************************************************************************
Float Function GameHoursToGo() 
	Float fReturnValue = (((Self.GetValue(pSKK_MWTimeStamp) + (pSKK_MWFloraRegrowthGameHours.GetValue() * 0.04167)) - Utility.GetCurrentGameTime()) / 0.04167)
	Return fReturnValue
EndFunction
;**********************************************************************************************
Posted

Ah thanks. Out of curiosity in which mod did you release this?

As somebody who playes with no-respawn this is the only thing that was bad about it

Posted

MW = Mobile Workshop to enable plantable wild flora. Mobile workshop also has optional no reset no respawn EZ files.

Posted

Thank you so much for sharing your script, SKK!

 

I've looked this up before, but came across the one made for Skyrim, thinking "all those timers ticking constantly on each plants can't be a good thing??" I decided to give up on it at the time. Your method looks like a much better solution! :thumbsup:

Posted

Forgot to mention that script starts the plant as empty or harvested OnInit() as its workshop plantable from a food item and planting with produce would be a duplication glitch. If your hand placing or spawning in the wild you will not want to do that, just wait for OnActivate harvest.

  • Recently Browsing   0 members

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