The strange setup used in the program prevents me from doing something as simple as:
function Soldier:Setup()
self:PersonSetup() -- where all of the things would be set
end
Instead, I have to make a Person first in C++ and then cast it to a Soldier later with Lua like:
//c++
void Person::Setup()
{
// set all Person things (there are a lot)
//call Lua to make a new Soldier (__init)
//try to fill that blank soldier with the values from this person but retain Soldier's Lua functions --this is the part I can't figure out
}
In C++, it'd just be a simple downcast like:
Soldier s = (Soldier)thisPerson
but I can't do that with a pure Lua class like Soldier because there is no C++ Soldier class, only a Lua one. I'm wondering how to get the data from the Person base class into the newly created blank Lua Soldier class.
I hope they're the details you're looking for. I could really use any help anyone can offer on this.