Custom Objects communicating with scene objects

Hello

I think that Events should be able to be inside Objects, not all on the Event tab, here’s how and why

HOW SHOULD THIS WORK

This should work as another event sheet, but that instead of adding it to a scene, you add it to an object, so now every instance of that object being placed, that event will occur despite it not being present on the scene events

WHY THIS SHOULD WORK

Because like if you are trying to get a bunch of states or complex movesets or like complex plataforms and such, its hard to just every scene have to copy the code, it would be way easier to just have thay code built-in the object

Thank you for your time, i hope that this is added

Sounds like a custom (prefab) object or maybe a behavior.

https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/

https://wiki.gdevelop.io/gdevelop5/tutorials/how-to-make-behavior/

1 Like

Agreed with Keith. You’re describing a behavior extension.

That lets you make as many event sheets as you want that applies to whatever object you add the behavior to.

1 Like

And i agree with both.

but …It means that object must have access to all scene variables…(or that you need to create properties/something as bridge),… cos you gonna end to need to know what’s happening outside of it…

Rite now you can separate the object and code its own behaviour…If that is enough to you…your request is already satisfied

IK those exist, but they are still limited
Like they cant even access the objects in your project

That’s incorrect, unless I’m not understanding what you mean.

Any behavior event you set up can have an object as a parameter, and you can pass any object in the current scene into that event. And it will be taken into account for the behavior object’s events. The same is true for custom object events.

Have you tried Finite State Machines? At least that’s what I’m doing for player movements and other things.

Yes, definitely. A behavior or function based extension is the better way to do a FSM, especially as they can have events that fire before the entire event sheet.

If you look at my not-a-vania example in the main example list, everything in the FSM external event sheets can be turned into a behavior-based extension. The most you might need to do is have a single action in your event sheet that declares a global object as the “monsters” (or damaging objects).

I would say something too…

since this is a feature i really wish to have in my game…

My whole project is made on isolated events,…

why i’m not calling em FSM?..

bcs even FSM needs a trigger…be a keypress, a var or something like that, that “could” happen externally…

ofc…the more you’re skilled the less of these situations you gonna need…but u gonna meet a situation like this soon or later…no matter how easy or difficult would be

… it’s a matter of .“simplifications”

…exactly…it may be as simple like that,…but not all the times…as experienced you’re, you surely know.

supposing i’m not skilled… (…and i guess the majority of users here dunno how to create a behaviour nor a c.object,looking at threads…) ,

why i’ve to spend my time thinking as a professional, which i’m not,on how to use something i already have on my scene?

I dunno if bcs performances issue behind, (…that i already have in event sheet…rite now…from 5.3) ,

but it’s a user problems to solve bugs, lags,redundances,cloned vars, bad named var ecc…

imo Users should have the whole control on everything they do with their projects…(be they bad or good things)

And honestly i don’t care if the majority of ppls posts the same issues everytime or can’t understand things…

if you can’t debug your game it’s not my problem…(if i can help i’ll be glad to help), but…

Put limits just bcs this… is bad…and punish others for nothing…and i’d say it is unique to GD…(as you know i said the same on the declaring vars matter…and i would say it again and again…i miss the old method)

(dunno how manies are familiar with Unity…if u declare wrong a variable there …you’re alone.but even so…still good games comes out).

In GD looks like i’m driving “my” 20 years old car with a driving instructor next to me.

i’m not blaming devs or anyone, but the “avoidables complexities” i’ve in my game in general…which are preventing me to have a clearer,more readable event sheet and probably a better develop experience in general.