It might have been better to provide this picture from the start.
From your description it was not possible for me to glean that you're trying to create a graphical level editor.
On your button, you could add a field for the ID of the target entity and a field for the function name. When the button is pressed, you can look up the target entity via the ID as suggested by pgimeno. And then you can simply call the function via entity[functionname](). Not elegant imo because there's no typo protection and such but should work and looks like the lowest effort solution if you don't want to build more UI for your level editor.
Linking Entities
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Linking Entities
Ah appologies, I didn't realise I didn't mention that.Endaris wrote: ↑Tue Sep 26, 2023 3:26 pm It might have been better to provide this picture from the start.
From your description it was not possible for me to glean that you're trying to create a graphical level editor.
On your button, you could add a field for the ID of the target entity and a field for the function name. When the button is pressed, you can look up the target entity via the ID as suggested by pgimeno. And then you can simply call the function via entity[functionname](). Not elegant imo because there's no typo protection and such but should work and looks like the lowest effort solution if you don't want to build more UI for your level editor.
I have managed to get it working, using a slightly modified version of what's been suggested - I've given all the entities a name attribute, which when changed automatically updated on an index table, so the table only contains objects which are named. Names were already a part of specific types of entities which had unique behaviours, so it made sense to reuse them. The system I've currently got also allows for entities to have the same name, so that you can do an action on all entities with the same name.
Dragon
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests