Zorkaz Posted April 14, 2020 Share Posted April 14, 2020 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 Link to comment Share on other sites More sharing options...
SKKmods Posted April 14, 2020 Share Posted April 14, 2020 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 ;********************************************************************************************** Link to comment Share on other sites More sharing options...
Zorkaz Posted April 14, 2020 Author Share Posted April 14, 2020 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 Link to comment Share on other sites More sharing options...
SKKmods Posted April 14, 2020 Share Posted April 14, 2020 MW = Mobile Workshop to enable plantable wild flora. Mobile workshop also has optional no reset no respawn EZ files. Link to comment Share on other sites More sharing options...
DiodeLadder Posted April 14, 2020 Share Posted April 14, 2020 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: Link to comment Share on other sites More sharing options...
SKKmods Posted April 14, 2020 Share Posted April 14, 2020 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. Link to comment Share on other sites More sharing options...
Zorkaz Posted April 16, 2020 Author Share Posted April 16, 2020 Is it just me (And some typos) or does IsHarvested() not work? Edit: Nope doesn't work even with the example script Link to comment Share on other sites More sharing options...
Recommended Posts