This is what it looks like so far. The biggest issue is that…none of these objects will exist. In extensions i cannot create objects from scenes. But if you imported this extension into a different project the objects wouldnt be there in the first place.
So i thought that i would create custom objects within the extension that it would then create itself, but it cant even create objects that come from the extension. it can only create objects that are passed to it via a parameter.
Which means you still have to create the objects yourself with all of the right names and parameters, and then pass them as parameters to the extension, which saves you about…like, -4 minutes, when you could just create a text object and use that in a similar way in like less than a minute.
What are you trying to do? Not your entire project but just step one. What’s your first goal.
Extensions and behaviors don’t have objects but you can create and manipulate the children objects of custom (prefab) objects.
It’s difficult to have scene objects interact with the custom object’s children without passing the scene object to the extension. Custom object children can easily interact with each other.
The scene can easily interact with the custom object as a whole but it’s more difficult to interact with the children.
Well, I have an idea for how I want it to work, and I don’t think I’ll exactly have a goal until I do some things first. But I can explain how it should work simply and what the bare minimum to see those results.
Imagine two actions, Begin panel with name “Window”, and End panel
Like this:
Begin panel with name “window”
Create button with label “Test button”
End panel
Now it understands the scope and to only add that ui element into that panel, And everything that comes after into another.
Now the first step is just that, being able to create buttons that also lay themselves out inside a panel
If the panel is a custom object then if it contains a button object then it can add a button to the custom object. Custom (prefab) objects are like a scene inside a scene or a scene inside an object. However, you wish to imagine it.
That could work i guess… I wanted to use the same text object for everything but ig that’s out the window. Does this mean the user only needs to add one object ?
Depending on what you do. You could put everything inside the custom control. Sliders, buttons and resource bars are simple versions of custom controls. They do everything internally just by adding the control.
Possible and practical aren’t the same thing. Just because it can be done, doesn’t mean you should. There could be drawbacks like efficiency and such.
I’m not saying it can’t or shouldn’t. I’m just saying to research it first before you get too evolved. I personally don’t see any issues as long as it doesn’t get too bloated.
Adding a large control is going to eat into the remaining resources. If most of the action takes place inside the control then it’s probably not an issue. Just as long as they don’t compete.
okay, its going…somewhere. The new issue is that how am i supposed to create 2 labels and give them both different contents while still in code? there annoyingly isnt an action in gdevelop to pick the newest instance of an object.
Since you can’t change the name. I guess you could link it to another object or use an object variable to name it.
When you don’t know which instance, you can pick an instance based on other characteristics like position or relative position to something else. Or through collision with another object.
If the labels are specific one-time objects, you could have multiple objects for specific things. Otherwise, you need a way to link or remember their purpose either through an ID or it’s position within the custom object or a cross-reference in a structure. It all depends on the need.
Initially, when an object is created, it’s selected. At that point you can change values and variables. If you need to update it later than you need to remember it.
is this for the debug tools from Dear ImGui? ive heard people talking about it for debugging. I may be super wrong.
I have no idea how you are planning to pass information of the objects to your Dear ImGui module through the use of custom objects. Aren’t custom objects like… custom? how can a random person making a random game expect to stumble upon your extension and be able to use your module that needs their objects to be associated with custom objects. I still know few about custom objects but still…
I think there is a very easy way for someone to pass their objects to your module. You see, we can put object groups inside parameters. Most people already use groups because they are awesome. You can easily imagine a game having most of their important objects inside huge groups. example:
structure group
enemy group
player group
UI group
these are only 4 groups, maybe a 5th for the markers and invisibles objects but i can’t even imagine more large groups than 5. whats more… someone may only need to debug part of their code, meaning that they may only need to plot a single group.
You could have a module only for the input, that the programmer can insert one group at a time. Then have your other module managing the actual debugging.
can’t you make an index system that the programmer would be able to put in their game to index all object? I wanted to make something like that myself. though for your extension… it may seem like too many dependencies (but like… inside of itself. as if it would be too “split into many modules”. you know waht i mean?)
it would probably be actually decently simple to implement regular Dear ImGui, its just that i dont know how, and i asked people to do it who did know and nobody did. And so im creating Dear ImGdev which is just like ImGui but made fully within gdevelop.
You can make private CustomObjects, and have a main “ImGui” custom object that contains all the sub objects, like Window, Button, Slider, Checkbox, Label, whatever.. and create them from Actions on the “ImGui” object.
Then the end user only needs to add the extension, create 1 CustomObject, add it to the Scene and then use it similarly to how you would Dear ImGui. It certainly would be nice if Extensions could somehow define global objects they can spawn into the scene or something though, but that’s not possible right now. You can get pretty close though without doing that
Yeah I got that, the issue I’m facing now is instancing, and when to actually create the objects. I was thinking of using a structure to define the layout, and render it on panel end action but it just didn’t do anything. Should I just render it right when each element is created?