Call Events Extension

im down with every part of it. it is a fundamental of programming gdevelop lacks

Thanks for the explanation. It’s probably not the best use-case though because behaviors would work very well for this.

You can pass any object from the scene through function parameters whereas your extension can only pass values, right? so I’m not sure what you meant.

Wait whaaaaaaaaatttt never knew you could do that

because traditional functions arent supposed to be reusable, while extensions are.

imagine you create an object, a variable the object x position is set to, etc etc etc…you have to pass all of that. that quickly becomes genuinely slower than just copy pasting the code, and way less clean.

Typically, when you start organizing a project into extensions, you rely on behavior properties for your object state instead of object variables.

You would create a dedicated behavior for each object where you handle the object state and the related logic. This way, you only have to pass 2 parameters: an object and its behavior.

For instance this template is organized into extensions and the main events are only about interactions between the objects:

If you want to continue the discussion about GDevelop extension system or give some use-cases where variables are important but hard to use, please answer in the following topic:

i see…i guess i apologize

…wait, i change my mind, what if its not an object?

If you mean scene variables, please continue in the following topic to make it easier to follow:

what do you mean by that

I was responding to DesmonDev to say that extensions are not only meant to be reused across projects. Extension that are clearly dedicated to 1 project is also a way to organize events.

I’m just… gonna end this post by myself.