Timers on instances

Hello! I’m here with another sort of working system but with a big problem and I’m hoping someone may be able to tell me what I’m doing wrong :slight_smile:

I have created a “farm” where there are two farm plots which are both instances of the same object. When they have something planted in them or grown in them, their animation is changed to the appropriate number to display it. My plan is to have many instances in my game of things that grow after a certain amount of time, so I don’t want each thing to be it’s own object because I feel like that’d be a massive event sheet

Currently, upon clicking one of the two plots, a seed shows up on that plot and a bar shows up over the plot, which decreases in size as time goes by. after a few seconds, a flower “grows”. I can do that as many times as I want with both plots and everything happens separately, but what I can’t do is use them both at the same time, which is major problem. Any help would be really appreciated!

Edit: I have no idea why I made almost everything repeat through FarmPlot instances, I have since switched it so the plant and grow parts aren’t repeating anymore and it operates exactly the same.

So, if you try to use both plots at the same time, they conflict with each other, is that it? Can you explain the conflict? What happens and shouldn’t, or what should happen and doesn’t?
Also, can you make an updated screenshot if you changed your events?

Here’s what I changed :slight_smile:

What happens when I press the second one when the first one is already “growing” is the second one goes as far as updating it’s animation to seed(#1), but doesn’t go any further or do anything else. The first one continues correctly and reaches the end of the countdown, changes to a flower animation(#2 or #3), and then can be clicked on again to turn it into a seed and at that point both farmplots are broken and dont do anything else. Thank you!

I was going to suggest putting a “repeat for each instance”, but I see that you already tried that.

I notice in your “growth” events, where you set the conditions and actions that will lead to the changing animations when things ‘grow’, that there is no condition to identify which FarmPlot is being tested, which is possibly making GDevelop get confused when both FarmPlots have “Growth”==“Yes”…

When you just do 1 farmplot at a time does everything work as intended? Can you go back and forth between farmplots if only 1 is growing at a time?

If the answer to that is yes, then could try adding a condition to test the ID of the FarmPlot into the “growth” events.

If the answer is no, I don’t know what to suggest…

Do the

This tells me you have a Trigger once that never gets reset, most likely the one linked to the “Five” variable condition. When the growth cycle is finished, you may want to change that “Five” to something else.

And you should clean up your events to make things clearer and avoid confusion (both for you and for GDevelop).
For instance, your second block doesn’t need to be separate from the first. Move its actions to the first block and delete that second block.
Your third block could be a sub-event of the first one. Remove the FarmPlot condition and make the block a child of the first block. Etc.

Good luck!

1 Like