Crystal Space
Welcome, Guest. Please login or register.
October 21, 2017, 11:38:46 am

Login with username, password and session length
Search:     Advanced search
9063 Posts in 2051 Topics by 77556 Members
Latest Member: Efeserena148
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  General Crystal Space Discussion
| | |-+  Source code for NPC character creation - but how to call it properly?
« previous next »
Pages: [1] Print
Author Topic: Source code for NPC character creation - but how to call it properly?  (Read 3306 times)

« 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",

   if (!NPCzombie) return 0;

   csRef<iPcMesh> zombieMesh = CEL_QUERY_PROPCLASS_ENT (NPCzombie, iPcMesh);
   if(!zombieMesh->GetMesh()) return 0;

   csRef<iPcLinearMovement> npclinmove = CEL_QUERY_PROPCLASS_ENT (NPCzombie,

   csRef<iPcTimer> zombieTimer = CEL_QUERY_PROPCLASS_ENT (NPCzombie,iPcTimer);

   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?

« Reply #1 on: March 20, 2006, 12:08:01 am »

upon closer inspection the"pile of gibberish" turned out to bea failed assertion on get_element function of the array.h in csutils ( in crystal space). No idea whythat happens though
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 3.197 seconds with 14 queries.