How to handle multiple instances of same object

:wave: Hi and welcome here :slight_smile:
In the condition side of the events, add whatever criteria you want to determine which instance the actions should apply to. It can be position, collision, angle, etc.
As a last resort, you can add an identification variable to each instance and use that as a condition.

Conditions act sort of like a filter. The condition (s) pick the instances you want. And then the action only affects those instances. The picked instances remain picked through the event and it’s subevents and then all the instances are repicked again with a new event line. There are also some special actions and conditions but I don’t want to overwhelm you or write an entire novel.

Most of the time instances are picked through collisions or mouse presses. Also, when an instance is added during runtime, it becomes picked. So, you can modify any of the settings in the same event line or subevents.

There are a lot of ways to pick instances. If you haven’t already, I’d try the eaxamples and tutorials.

That would work for some uses.
But what about static objects that are randomly spawned at the start of a scene?
So what your saying is there is no way to reference the root object index, I would have to create my own object index on top of the back end that the engine should be creating by default?
If so that is not very optimized!
I want to be able to work with something like 30 instances of more then 5 different objects all in the same scene, and have code to dynamically change their attributes based on complex conditions not just point and click, or simple collision checks.

Seems to me the GUI is just getting in the way of implementing useful code.

I have searched all available info I could find.

the only work around that will let me do what I want is to create predefined objects, one for each possible instance I would want latter on while the game is running and just spawn one instance of each object…
That would get pretty messy…

Let’s focus on 1 specific situation. What do you want to do right now. The more specific the better. If you can add a pic of the events or the scene it would help.

As I said. As you spawn instances either individually or through something like a repeat event they become picked and you can change any setting or latter you can use a for each object You can use fixed values or variables, functions or other conditions and expressions.

It took me a while to fully understand instances but I got there. Not every app is for everyone but Gdevelop is my current favorite.

as it stands now I might have to just take completely different approach than my original plan.
I wanted event code that would only interact with a set object each time it ran. But I might have to just great chunky code that uses the for each function.

to start off with I wanted to be able to create random plants on my map, and randomly assign a plant type to them. setting the starting info was no issue, as you have stated. But I had wanted to have a weather simulation to change the specifics of different areas of the map at different rates. But I am already figuring out work arounds.
Like I could just set hidden objects as weather zones, and then have random weather for each zone, and then apply weather effects to an plant object in collision with that weather zone…
I am I on the right track?

IDK if I fully understand but if you create objects either at runtime or in the editor, you can set an object variable like Zone and then repick all the objects with a particular Zone value. You also use linking or like you said, check for collision or if the animation is a certain name or number. Any condition that “picks” objects.

Here’s an example of a few ways to create objects. Apologies if it’s something you already know.
(click [download Zip] under the green “<>code” button, extract and open the project file)
doug13579/create-objects-in-zones (github.com)

All the project does after creating the objects is rotate and change the hue by zones when you click the Z1 and Z2 sprites.

(unrelated) how did you make that “turn skeleton up” action?