I wanted to comunicate between Script and use data from one script to other. I found that a possible way is to add as @editable the class of the device that you want to use in other script.
But sometimes this doesn’t work. I think I found a way to reproduce the error. I have this 2 scripts
if I use “Push Changes” it works fine, if I leave the game and go to the code, without changing nothing relevant just add a space, save and then push only “Push verse code” then it doesn’t work.
The 1st one is working fine, but on the 2nd is incorrect is showing me the initial values instead of the changed values. I have no idea why launching the game without using “push changes” generate this error, “push changes” should be used only when something is change on the editor and not only in verse.
Is there some other way to used variables that are in other script or have like a global context ?
I’ve found this too, and it’s really annoying. It works the first time you Push all changes, but if you only build Verse and push that, then yeah - what you saw happens. The editable properties on the referenced device become unassigned, and will only re-assign if you do a Full Sync every time.
I have not found an elegant solution to this, except to avoid it completely and “fire my own events”. By “own events”, I mean simply reversing the responsibility: I have the referenced device (secondary script) call the first script in OnBegin, “registering” itself. In other words, I make the child call the parent rather than having the parent directly access the child.
This is naturally painful and ugly, especially when you have a lot of “children” devices… and also not great on memory, obviously, because everything that needs to be passed over is stored twice. But oh well.
But yeah, it’s gotta be a bug. The fact that it works fine on a fresh sync, but then breaks on a Verse push with literally no change (e.g. add an empty line), then works again on a fresh sync (again with no change), is clearly not right. I initially thought I got myself stuck in a race condition or an async visibility issue, but after extensive debugging (like what you’ve done, except even more haha) it seems to be a case of UEFN not fully propagating the assigned editables when a Verse Push is made.
This might still be a known issue they’re actively trying to fix. They said it was fixed in an upcoming build, but it still seems to have some bugs.
The current work around is to use an array rather than a single property reference to your custom device. Or use tags as a way to get references to your other custom devices. Then direct public method calls between them should work while maintaining instance property values.
Ideally I would like to see them add Verse support for public event listenables, then we wouldn’t need to make direct calls between custom devices.
Hey guys, this method works fine for sharing data in one way a->b , a->c , a->b->c… but is there a way to make this work in two ways so that I can share from a->b and b->a ?
When I try that, I am getting some error. “…Linker task graph contains a cycle…”