Thanks for your reply Greg, I looked at your changes to Kinematic..
going from
mesh =obj.mesh ();
to
base =obj.firstStored();
in Kinematic::create seems to break the way I create the derived objects.
Code:
Game::ObjParamsPtr obj4=Game::Objs.ptrRequire(UID(82207790, 1135183605, 463827857, 3114706381));
Game.ObjParams obj5= *obj4;
__super::create(obj5); //Kinematic::create
if(obj5.firstStored() == null)Exit("no first stored");
always exits "no first stored", I guess my object isn't in the cache, how do I force it into the cache?
If I manually set the base object like so, everything seems to be fine:
Code:
Game::ObjParamsPtr obj4=Game::Objs.ptrRequire(UID(82207790, 1135183605, 463827857, 3114706381));
Game.ObjParams obj5= *obj4;
obj5.base(obj4); //manually set the base object rather than rely on firstStored().
__super::create(obj5); //Kinematic::create
if(obj5.firstStored() == null)Exit("no first stored");
Which I'm all about quick and dirty code so this works for me, thanks for your help.
I should also remark that I also tried it on the "Basic App" tutorial with the Objects\Warrior that comes with the tutorial and this code works fine:
Code:
class Warrior : Game.Kinematic
{
void create()
{
Game::ObjParamsPtr obj4=Game::Objs.ptrRequire(UID(2919624831, 1261075521, 753053852, 3651670215));
Game.ObjParams obj5= *obj4;
__super::create(obj5);
if(obj5.firstStored() == null)Exit("no first stored");
}
}
Warrior warrior;
/******************************************************************************/
void InitPre() // init before engine inits
{
EE_INIT(); // call auto-generated function that will setup application name, load engine and project data
}
/******************************************************************************/
bool Init() // initialize after engine is ready
{
// here when engine will be ready you can load your game data
// return false when error occured
warrior.create();
return true;
}
/******************************************************************************/
void Shut() // shut down at exit
{
// this is called when the engine is about to exit
}
/******************************************************************************/
bool Update() // main updating
{
// here you have to process each frame update
if(Kb.bp(KB_ESC))return false; // exit if escape on the keyboard pressed
return true; // continue
}
/******************************************************************************/
void Draw() // main drawing
{
// here you have to tell engine what to draw on the screen
D.clear(TURQ); // clear screen to turquoise color
D.text (0, 0, "Hello to Esenthel Engine !"); // display text at (0, 0) screen coordinates
}
/******************************************************************************/
The "no first stored" exit never happens. But if I copy my model from my project to the tutorial project and try to make my "wings" model run with the same code I get "no first stored" exit unless I manually set the base object. So I guess it is something with my model (it is from a converted EE 1.0 project, might be the root cause of these problems).
Also I sent you a PM with a link to a EsenthelProject that contains the wings model, your warrior model and the modded basic app. I know your busy, and this only seems to be affecting me, and I think I have a work around, so don't worry about it unless you are curious.