Component-based Entities using Properties

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Trefall
Posts: 45
Joined: Tue Dec 05, 2006 8:49 pm

Post by Trefall »

I will not argue that argument, because I do absolutely agree that your last example is more convenient. Is there a way to catch it when for example object.hp is given a new value? I need to push this into the C++ property system so that listeners can react to values changing you see.

I've fiddled with __newindex before, but that was mostly to get some OOP-like behavior, something I don't really want in the scope of my own scripting. With LuaPlus it's very simple to implement meta behavior though, so any hints to how I'd go about implementing your object.hp = 100 example is something I'd be very interested in :)
Post Reply