Jump to content

New Mod Wierdness


Recommended Posts

Hey all. I have just uploaded my mod and ran into some issues. My fish hatchery works great! Unless I walk away to another cell. Once I come back, EVERYTHING is gone. Also the Mudcrabs get killed by a wolf or something and never respawn even though respawn is ticked. Here is the script for fish hatchery:

 

 

 

Scriptname BYOHHouseFishHatcheryScript extends ObjectReference
{script on the fish hatchery activator}
import debug
import utility
Actor Property FishContainer auto hidden;
float fLastSpawnTime ; this is a timestamp of the last time this spawned anything
float Property fSpawnDays = 1.0 auto ; days between spawning
int Property iSpawnCount = 0 auto
{ number of types of fish that have been spawned }
Bool AlreadyLoaded = FALSE
EVENT OnCellAttach()
FishContainer = GetLinkedRef() as Actor
SpawnFish()
endEVENT
EVENT OnActivate(ObjectReference TriggerRef)
; debug.trace(self + " OnActivate")
FishContainer = GetLinkedRef() as Actor
FishContainer.ShowGiftMenu(abGivingGift = true, apFilterList = BYOHHouseFishContainerList, abShowStolenItems = true, abUseFavorPoints = false)
endEVENT
; called onCellAttach to see if it's time to spawn new fish
function SpawnFish()
; debug.trace(self + "SpawnFish")
; see if enough time has passed since last spawn
if GameDaysPassed.GetValue() >= fLastSpawnTime + fSpawnDays
; reset spawn time stamp
fLastSpawnTime = GameDaysPassed.GetValue()
; run through the fish form list
iSpawnCount = 0
int iIndex = 0
; debug.trace(self + "SpawnFish: spawning...")
while iIndex < BYOHHouseFishContainerList.GetSize()
; if we have any of this kind of fish in the hatchery container, enable the matching ref
if FishContainer.GetItemCount(BYOHHouseFishContainerList.GetAt(iIndex)) > 0
FishReferences[iIndex].Enable()
; increment spawn count
iSpawnCount += 1
else
FishReferences[iIndex].Disable()
; decrement spawn count
iSpawnCount += -1
endif
iIndex+=1
endWhile
endif
endFunction
FormList Property BYOHHouseFishContainerList auto
ObjectReference[] Property FishReferences auto
GlobalVariable Property GameDaysPassed auto

Link to comment
Share on other sites

I think everything is gone because you have respawn clicked on your cell? You only need to click respawn on your NPCs (ie. fish in this instance) Respawn on cell will reset the entire cell.

 

If that is not it, I am not sure but I suspect it is some combination within these settings.

 

Good Luck!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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