Lua Scripting API Documentation - Wantcha/Chimera GitHub Wiki

Lua Scripting API

If you're here, then it means something probably doesn't work as it should in Chimera. That's what you get for using an engine made by a first-year uni student trying to become a technical artist. Take a look around and see if you can find what's wrong.

! IMPORTANT !

It is a bad idea to store references to components! This may be fixed in the future, but right now the way the component system works is that it is moving the pools of components in memory every time a new component is added or removed, nullifying any existing component reference. If you want to store a component in a variable, that can be fine, as long as you use it right away and don't try to access it later on as there is the risk of that reference being invalidated and, worst-case scenario, crashing the program. This is not my intentional design decision, it is how the library EnTT is built to function. I have talked to its developer and this system is subject to change in the near future which may fix this issue. Storing Entities is perfectly fine and should cause no issues, but storing components is very dangerous and should be avoided (unless you know exactly what you're doing, which I doubt, because I have no idea what I'm doing with this API).

Here is the current documentation: