So I have made progress on creating a farming system in my game similar to Harvest Moon, Stardew Valley, etc, but I am now stuck on one very simple thing. I'm probably over thinking it, but whenever I update my self variables for the death counter (essentially if the crop is not watered, the death variable is subtracted by 1), I can't make it stop. What I mean by this is I can have the plant died if water, but if I spawn new seeds/plants after one plant dies, it will spawn as a dead plant. I have figured I would need to change how the death counter is acquired, but I'm unsure if it needs to be a positive or negative integer. I'm using the Yanfly event foraging tutorial as my guide, so if you need to see the respawn day cycler event, I can share it. Though I did compress it to make all of the lines fit (I used slightly more than the 12 lines MV allows, and I used a javascript compresser someone recommended).
This is my spawn start event. I have moved it around to different event pages, but it either gets stopped by the death page, or this event page stops the death page.
This is the plant death page after it reaches < 0 in the self variable.
This is the event that would be just seeds on the dirt plot.
This is my watered seeds event page.
This would be the second growth stage/sprout stage of the plant.
And this is the second stage watered event.
I would like to add a third stage dry and watered event, but it would require to get everything else in order. I just need to know how to stop the death event page or the spawn event page from overtaking each other, and to stop the death event page from spawning when I place new seeds down to grow.
The code above is my compressed javascript where the variables are updated through a bed common event.
varId is my variable for if the plant is watered or not, var deathId/ self variable 30 is my death counter variable that is updated, and var harvestId/ self variable 31 is my "days until ready to harvest" variable that is updated. Any and all help is appreciated!! I know I'm probably overcomplicating things or making a silly mistake, but it helps to have a second opinion/a second pair of eyes for this! I will also happily put your username in my game credits for helping me since this is such a crucial aspect for my game!
This is my spawn start event. I have moved it around to different event pages, but it either gets stopped by the death page, or this event page stops the death page.
This is the plant death page after it reaches < 0 in the self variable.
This is the event that would be just seeds on the dirt plot.
This is my watered seeds event page.
This would be the second growth stage/sprout stage of the plant.
And this is the second stage watered event.
I would like to add a third stage dry and watered event, but it would require to get everything else in order. I just need to know how to stop the death event page or the spawn event page from overtaking each other, and to stop the death event page from spawning when I place new seeds down to grow.
JavaScript:
mapId=$gameVariables.value(18);var eventId=$gameVariables.value(19),varId=26,deathId=30,harvestId=31,value=this.getSelfVariableValue(mapId,eventId,varId),death=this.getSelfVariableValue(mapId,eventId,deathId),harvest=this.getSelfVariableValue(mapId,eventId,harvestId);value<=0&&(death-=1),0<value&&(harvest-=1),0<value&&--value,this.setSelfVariableValue(mapId,eventId,varId,value),this.setSelfVariableValue(mapId,eventId,deathId,death),this.setSelfVariableValue(mapId,eventId,harvestId,harvest);
The code above is my compressed javascript where the variables are updated through a bed common event.
varId is my variable for if the plant is watered or not, var deathId/ self variable 30 is my death counter variable that is updated, and var harvestId/ self variable 31 is my "days until ready to harvest" variable that is updated. Any and all help is appreciated!! I know I'm probably overcomplicating things or making a silly mistake, but it helps to have a second opinion/a second pair of eyes for this! I will also happily put your username in my game credits for helping me since this is such a crucial aspect for my game!
