Sorry for the long time since the last post! I’ve been really busy!
A quick update: I’ve just finished a dynamic property system for the editor, which allows you to expose properties from your Lua objects that can be changed in the editor.
Previously I had a separate property form for each object and tool, but creating the forms at runtime is much cleaner and makes it easier to add new objects. It is also a big step towards implementing the custom UI that I am working on.
On a related subject I have done the a similar thing with the serialization of objects. By exposing the important properties of Lua objects though a simple function, they can be saved along with the rest of the level.
--
-- Returns a table contining the properties that should
-- be serialized
--
function Light:Serialize()
local t = {}
t.ConnectedObject = self.ConnectedObject
t.Scale = self.Scale
t.Color = self.Color
return t
end
Above is an example from a light object which is created in Lua. When the level is saved, the “Light:Serialize” function is called, and the table which is returned is saved along with the other objects.