Along with the newer version v4.7, scripts can be objects now, which improves compartmentization of code functionalities. This actualization makes me wonder how could it be used to improve modularity and scalability of the code.
So far, I used separate .lua files for recurrent code that I would use in multiple Coppelia Scenes. I accessed them with the command require in the appropriate child script. However, this method had its limitations since scripts were very static and i had to make sure the scene's object names and hierarchies matched as stated in the scripts.
With the addition of script objects, it is possible to copy/paste code objects from one scene to another, and to customize the script object of each scene.
- However, I wonder what is the best way to hadle this code. Is there a way to save the script objects and load them in a similar way to .ttm models?
- Should I keep using the same old method of script calling via the require command?
- Is there a better way to handle this?