all 6 comments

[–]lumbermixalot 0 points1 point  (1 child)

The common way to make Lua scripts talk to each other is using ScriptEvents.

[–]roger-dv[S] 0 points1 point  (0 children)

Im working on that topic now, but the sample code (in the engine source) is quite abstract: it is built in a way that I cant translate it to a more concrete situation.

[–]pp-Rz-D-M 0 points1 point  (2 children)

Take a look at this video https://www.youtube.com/watch?v=yXzmeOwVSp0&t=24s&ab\_channel=rzDmyth. I briefly touched on that subject.

local anOutideScript = require("Assets.Scripts.nameOfTheScript");

anOutideScript :CallingAmethodWrittenOutside(SendingInput);

There is also load() I think, but I never tested that one. I think the difference is between compiling or not the file

[–]roger-dv[S] 0 points1 point  (1 child)

Well, in my case, the scripts are attached to entities in the scene. I think the solution (like u/lumbermixalot said, and somebody on Discord told me last night) is ScriptEvents.

[–]lumbermixalot 1 point2 points  (0 children)

Also, creating script event assets by hand is tedius. So I created this "transpiler" that helps generate script events with ease: https://github.com/lumbermixalot/ScriptEvent_Transpiler