About Store Forum Documentation Contact



Post Reply 
[SOLVED]Door object not appearing in the scene.
Author Message
Otolone Offline
Member

Post: #1
[SOLVED]Door object not appearing in the scene.
Hi there!
I am trying to extend the door class yet it does not appear on the scene when I EE calls the draw function.
Below is my code for the door class in the door file
[]
PHP Code:
class myDoor Game.Door
{
   
   
virtual void create(Object &obj// create from object
   
{
      
super.create(obj);
   }

   

   
   
virtual Bool update() // update, return false when object wants to be deleted, and true if wants to exist
   
{
      
super.update();
     if(
Kb.bp(KB_W)) open();
      if(
Kb.bp(KB_S)) close();
      return  
true;
   }
   

   
/* io
   virtual Bool save(File &f); // save, false on fail
   virtual Bool load(File &f); // load, false on fail
   */
}
/******************************************************************************/
[/] 
The code below shows how I use the door class in main
[]
PHP Code:
/******************************************************************************/
Game.ObjMap<Game.Item  Items  // container for item   objects
Game.ObjMap<     PlayerPlayers// container for player objects
Game.ObjMap<myDoordoors;
/******************************************************************************/
void InitPre()
{
   
EE_INIT();
   
Ms.hide();
   
//Ms.clip(null, 1);
}
/******************************************************************************/
bool Init()
{
   
Physics.create(EE_PHYSX_DLL_PATH);

   
Game.World.activeRange(D.viewRange())
             .
setObjType(doorsOBJ_DOOR)
             .
setObjType(PlayersOBJ_CHR );
   
Game.World.New(UID(1483208840130010628321092012923956255267));
   if(
Game.World.settings().environment)Game.World.settings().environment->set();

   
Cam.setSpherical(Vec(16116), -PI, -0.5015).set(); // set initial camera
   
Renderer.capture(image);

   return 
true;
}
/******************************************************************************/
void Shut()
{
   
Game.World.del();
}
/******************************************************************************/
bool Update()
{
   if(
Kb.bp(KB_ESC))return false;

   
Game.World.update(Cam.at); // update world to given position
   

   
return true;
}
/******************************************************************************/
void Render()
{
   
Game.World.draw();
}
void Draw()
{
   
Renderer(Render);
                 
}
/******************************************************************************/
[/] 
Sorry for the "php code",but my door does not render.
Thanks in advance.
(This post was last modified: 04-03-2018 11:11 AM by Otolone.)
03-24-2018 07:22 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #2
RE: Door object not appearing in the scene.
have you checked to see if the create/update functions gets called at all?
you could use

Code:
D.text(0,0.1,S+doors.elms());

to see if it actually creates any doors.

if they do not, you might have forgotten to make the door object you placed have OBJ_DOOR as it's class param.

You can do this either directly on the object(under Params) that you place or you can override an object you have already placed in the map editor by selecting that object(you can also use this to double check that you've placed the correct object)
(This post was last modified: 03-24-2018 07:51 PM by Zervox.)
03-24-2018 07:44 PM
Find all posts by this user Quote this message in a reply
Otolone Offline
Member

Post: #3
RE: Door object not appearing in the scene.
The code proves that 1 door has been created,I have done all of the above yet still cannot see it.
03-24-2018 08:13 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Door object not appearing in the scene.
Perhaps you don't have a physical body set for the door object.

Game object source code available for download here:
http://www.esenthel.com/?id=store&item=1&mode=download
http://www.esenthel.com/?id=store&item=4&mode=download
https://github.com/Esenthel/EsenthelEngine/
(depending on your license type)
03-24-2018 10:07 PM
Find all posts by this user Quote this message in a reply
Otolone Offline
Member

Post: #5
RE: Door object not appearing in the scene.
Thanks, I will check that now.
03-28-2018 03:08 PM
Find all posts by this user Quote this message in a reply
Otolone Offline
Member

Post: #6
RE: Door object not appearing in the scene.
Sorry for the late reply.
When I set a physical body, for the door object, it appeared
Thanks to you all.
04-03-2018 11:10 AM
Find all posts by this user Quote this message in a reply
Post Reply