FCP
Guest
|
 |
« on: March 19, 2006, 11:42:50 pm » |
|
The code (function):
csPtr<iCelEntity> CelTest::CreateNPCActor (const char* name,const char* /*factname*/, const csVector3& /*pos*/) { csRef<iCelEntity> NPCzombie = pl->CreateEntity("zombie",bltest,"actor", "pcmesh","pclinearmovement", "pcnpcmove","pctimer",CEL_PROPCLASS_END);
if (!NPCzombie) return 0;
csRef<iPcMesh> zombieMesh = CEL_QUERY_PROPCLASS_ENT (NPCzombie, iPcMesh); zombieMesh->SetPath("/cel/data/"); zombieMesh->SetMesh("test","cally.cal3d"); if(!zombieMesh->GetMesh()) return 0;
csRef<iPcLinearMovement> npclinmove = CEL_QUERY_PROPCLASS_ENT (NPCzombie, iPcLinearMovement);
csRef<iPcTimer> zombieTimer = CEL_QUERY_PROPCLASS_ENT (NPCzombie,iPcTimer); zombieTimer->WakeUpFrame(1);
return csPtr<iCelEntity> (NPCzombie); }
Thats what I was able to pur together from documentation.... but when I call it some VERY bad things happen (unspecified flood of gibberish in the cmd window).
call code : //entity_dummy1 = CreateActor ("NPC", "", csVector3 (0,0,10)); //if (!entity_dummy1) return false;
Any ideas why that happens?
|