Answer the question
In order to leave comments, you need to log in
What are the ways to implement a system of external scripts?
What are the main approaches to create a system of scripts for game engines? One way is to compile user scripts into .dlls and then load classes from them. What other approaches are there to get the code of external scripts in an already compiled program and execute functions from them, except for .dll or static libraries?
Answer the question
In order to leave comments, you need to log in
There are a lot
of tools for solving this issue .
The solution method is always the same: you need to select and integrate a script engine into your project.
The question of choosing a scripting engine is very complex and depends on many non-obvious criteria. The answer to this question can only be given by an experienced engineer who has repeatedly dealt with different scripting engines. Because even between Lua, LuaJIT and Terra, the difference in functionality and integration features is very significant.
However, I will leave this question open. In extreme cases, you can always take a simple and easy Lua, if your eyes run wide, but there is no solution.
How integration is done. For example - so , so , so, so , so or so .
After integrating the script engine into your project, the functionality of your project can be transferred to the script side using the script engine API directly.
One of the criteria for choosing a scripting engine is its performance. In order not to occupy specialists with such a routine, once upon a time measurements of versions of various scripting engines were already carried out. The measurement results are available to everyone.
However, it is worth recalling that not always the fastest solution is the most optimal.
Execution of actual scripts. Those. an interpreter is sewn in, and external scripts are written in a scripting language.
Once upon a time, Lua was popular for such a scheme.
You can write scripts in Lua and load them using the appropriate libraries
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question