After use in Unstable (nightly) this code: Code: world.logInfo("%s", console.sourceEntity()) world.callScriptedEntity(console.sourceEntity(), "MyFunc", params) game make error like this: Code: 10 (StarException) Entity 10 does not exist or is not a local master scripted entity Why? P.S.: In Unstable (not nightly) and Stable version all working.
For unstable/nightly, you need to use this instead now: In your console script - Code: world.sendEntityMessage(console.sourceEntity(), "Myfunc", params) In the objects script, within its init - Code: message.setHandler("MyFunc", function(_, _, params) MyFunc(params) end) - which will then call the defined function elsewhere in your objects script. Note that world.callScriptedEntity will still function between objects.
Thanks this saved me too! I had a function with no params. Here is how I did it, in case anyone else has that. In your console script - Code: world.sendEntityMessage(console.sourceEntity(), "Myfunc") In the objects script, within its init - Code: message.setHandler("MyFunc", function(_, _) MyFunc() end)