Node.Emit doesn't work in fresh loaded Level.
I just ran into this problem and need help! I tried to modify the code, but with no effect. I was focusing on it over 8 hours and with still same result. On the first play, everything works fine, but after the first play it doesn't call the "OnScriptInit" function (Code below). If I restart Unreal it is the same as before. First play good and then bad. If I get a breakpoint in the function it starts working for every play, but the breakpoint must be there (I don't want that). I tried putting a delay and waiting 3 seconds for the node to initialize, but that didn't change anything.
I have a game mode in which I have this Node component:

Then in event "Component activated" I'm trying to bind events that are called in the firebase.js script.
Event graph:

Firebase.js:

Bind events func:

OnScriptInit function (this doesn't get called by the ipc.emit() in the script as mentioned above):

InitializeFirebase func:

BP_PCreatorInstance travel function that register the refresh bool (this works fine):

FIRST play after traveling to another level and refreshing:

BAD play after traveling to another level and refreshing:

At a glance, traveling could de-link your node cmd link (see: https://github.com/getnamo/nodejs-ue4/blob/master/Source/NodeJs/Public/NodeComponent.h#L178 is an owned pointer on cmd, and each component generates a new cmd https://github.com/getnamo/nodejs-ue4/blob/master/Source/NodeJs/Private/NodeComponent.cpp#L30). Likely some refactor is needed to ensure node cmd link stays valid between traveling (e.g. link re-use via tag or something like it, or use static allocation like socket.io does).
This is a rough experimental plugin and I currently don't have any spare OS time to attend its fixes apart from pointing where they could be; someone else will need to peek and contribute fixes for stability.
Hi, I had try something similar. Change level by cheat mode. Even though I load same map. NodeJs won't work!
But if I destroy NodeJs Actor and wait for 5s to chang level. It works for me successfully. I guess socket thread can't be restart by itself. My project test vedio link
- Get weather data. (OK)
- Nothing
- Get weather data. (OK)
Add destroy and wait for 5s.
- Get weather data. (OK)
- Get weather data. (OK)
- Get weather data. (OK)
Note. Delay time lower 5s may be crashed.