How to call AngelScript functions from other modules?

  angelscript, c++

I’m working on a little game engine project, with scripting using AngelScript. I have a very basic AngelScript compiler where each entity gets its own module, I’ve bound ECS functions to AngelScript already. What I want to do now is create a system where I can call functions from other entities in any of the scripts. For instance I want to be able to do the following from AngleScript:

// Where someFunction is defined in the AngelScript attached to ExampleEntity
FindEntityByName("ExampleEntity").GetScriptComponent().someFunction();

Is this possible, or at least something similar to it? If so, how would it be done?

Source: Windows Questions C++

LEAVE A COMMENT