Jump to content

How to get plants to respawn/regrow


gunslinger6792

Recommended Posts

I'm making another house mod and I've added a small garden. I can pick the vegetables but after waiting more than 72 hours it hasn't regrown. How do i get the vegetables to regrow is this going to require me to write a script?

Link to comment
Share on other sites

Well I just figured out that I don't know how to add a new script to the game or override an exsisting one. For some reason can't save a new script. It will ask me if I want to save but after clicking yes it won't close the script window :(

Link to comment
Share on other sites

It means there are errors in the script. Please post it here so we can help you find out what's wrong.

Allright thanks, as soon as I'm out of my lectures for the day I'll post some of the scripts.

Link to comment
Share on other sites

heres one of the scripts I've tried putting in. gribbleshnibit8 wrote for his mod so I'm assuming it works

 

scn MaizeScript

int State
int daysPassed

begin onActivate
if State == 0 && GetActionRef == player
player.additem NVFreshMaize 2
set State to 1
set daysPassed to GameDaysPassed
playGroup Backward 1
setdestroyed 1
endif
end

begin onLoad
if State == 0
playGroup Forward 1
elseif State == 0 && daysPassed == 0
playGroup Forward 1
set State to 0
setdestroyed 0
elseif State == 1
if ((GameDaysPassed - daysPassed) > PlantRespawnRate)
playgroup Forward 1
set State to 0
setdestroyed 0
else
playGroup Backward 1
endif
endif
end

begin onReset
if State == 1
playgroup Forward 1
set State to 0
setdestroyed 0
endif
end

Link to comment
Share on other sites

The problem is probably with PlantRespawnRate. I assume it's a global variable Gribb used to set how many days should pass before plants regrow. The script doesn't save because this variable does not exist in your mod.

 

You can simply replace it with a number. For instance, suppose you want plants to regrow every 3 days:

if (GameDaysPassed - daysPassed) > 3
Edited by jazzisparis
Link to comment
Share on other sites

  • Recently Browsing   0 members

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