’ve started learning Scene Graph, and I’m wondering if it’s possible to use regular Verse files with the creative_device class inside a Scene Graph component.
For example, I’m working on a hunger system in a creative_device that contains functions like IncreaseHunger(), GetHunger(), and DecreaseHunger(). I’d like to call these functions from a Scene Graph interactable component when a player interacts with a custom object.
Should I write this logic directly inside the Scene Graph file, or is there a way to reference my existing hunger system?
Currently, when I reference the hunger_system as editable inside the Scene Graph interactable component and try to build, I get the error:
“Referencing devices is not supported within this context.”
From one of our engineers:
You can reference the Verse device in the usual way, for example: @editable MyDevice : trigger_device = trigger_device{}
When compiling and adding the component to the entity, you can reference the device from the level.
Hello Flak, I can confirm that this works with Fortnite’s native Creative devices (e.g., trigger device, item granter, etc.). However, it does not work with other Verse files of type creative_device.
In my case, I created a hunger system using a regular Verse file (not Scene Graph). All the settings and functions, including the UI, are contained in this file. I also made an interactable object using Scene Graph, and I want to call the hunger system functions when interacting with that object.
When I add the hunger system as @editable inside the Scene Graph component file, it compiles successfully, but in the editor it shows that this is not supported within this context.
I could move the logic into the interactable component and call it directly from there, but I don’t think that’s a good idea. I prefer to keep the system split into reusable, easy-to-customize files that I can copy over when needed. On top of that, certain functions such as GetPlayspace()cannot be used inside a Scene Graph component, since it expects a creative_object_interface.
What would be the best way to make this work? I believe Scene Graph has a lot of potential, and I’d like to use it in my projects as much as possible.
I’m having the same problem as you. It’s frustrating — from what I’ve seen here, the Epic representative didn’t understand your question. We know that it is possible to expose native Fortnite creative devices as editable fields inside classes that inherit from component. The issue is that we can’t use our custom creative devices the same way, and it seems like this point was either ignored or misunderstood.
Very few developers are experimenting with this new feature, so we don’t have many answers. If Epic doesn’t address it directly, it becomes really difficult.
From my experience, I had to reverse the logic and reference the component inside the creative device. Doing it the other way around — referencing a custom device as an editable field inside the component — I tried in every possible way and failed miserably.
Scene Graph and Creative Devices are different systems.
Scene Graph is ready and runs way before Creative Devices are ready and running. So referencing a creative_device through a scene graph component is you trying to access something that was not initialized yet…
By the original idea, I would assume is better to just move all the logic to components for a better workflow. In the future creative devices is supposed to become deprecated.
But, if really wanted, you can query them at runtime with tags, such as “FindXXXX” methods and so on…
Or, the alternative would be connecting the entity to the verse device instead (Verse devices can access scene graph entities since they are initialized later, not having the error of “trying to acccess something that is not initialized yet”)