About Store Forum Documentation Contact



Post Reply 
Game.Objects not rendering
Author Message
baccenfutter Offline
Member

Post: #1
Game.Objects not rendering
Hi,

I started a new project so I can dive into EE completely from scratch with tutorial material laying around. I then began to copy+paste selected portions over from the tutorial piece by piece so I would learn and understand how everything is put together.

So far I have a very simple world with a nude warrior in the center that I can move around with keyboard and mouse. I copied over the warrior model with all its animations and object classes. I started to feel very confident about understanding the framework. But now I imported some objects rather than copying them over from the tutorial. Things like an Ogre and a club (not the club from the tutorials). I created object classes just like they look in the tutorials - they are OBJ_ITEM and OBJ_NPC. But when I set my Ogre and my club to be of their according object class, they are not rendered when pressing F5. They are only rendered when I set them to object class Terrain.

I use the Item() class from the tutorials and have created an empty place-holder NPC() class. They are all mapped as follows:

Code:
Game.ObjMap <Item>   Items;
Game.ObjMap <NPC>    NPCs;
Game.ObjMap <Player> Players;

I then initialize my world as follows:

Code:
Game.World.activeRange(D.viewRange())
          .setObjType(Items, OBJ_ITEM)
          .setObjType(NPCs, OBJ_NPC)
          .setObjType (Players, OBJ_CHR)
          .New        (UID(60278047, 1483316353, 2578725225, 3383535860));

I've been digging through the tutorials for quite a while now and don't get what I am missing. I see nothing in any update or draw method I would have to implement in order for the objects to render if I placed them into the world using WorldEditor. It has to be something very simple and obvious, so before smashing my head against it any longer I thought I might just ask if it is something easily guessable.

What could cause an object to be rendered if of object type Terrain, while not being rendered if of object type OBJ_ITEM or OBJ_NPC?
(This post was last modified: 08-02-2015 01:51 PM by baccenfutter.)
08-02-2015 01:48 PM
Find all posts by this user Quote this message in a reply
Pherael Offline
Member

Post: #2
RE: Game.Objects not rendering
I'll take a wild guess but maybe you need to set physics (in editor) for items and skeleton for NPC?
(This post was last modified: 08-02-2015 04:04 PM by Pherael.)
08-02-2015 03:58 PM
Find all posts by this user Quote this message in a reply
baccenfutter Offline
Member

Post: #3
RE: Game.Objects not rendering
(08-02-2015 03:58 PM)Pherael Wrote:  It's a wild guess but maybe you need to set physics (in editor) for items and skeleton for NPC?

HA! Thanks mate. Good guess indeed. lol

This was completely not obvious to me. Thinking about it now it totally makes sense, because the item has to have at least gravity apply to it. I still think it would be worth mentioning it more explicitly somewhere either in the tutorials or in the documentation.
08-02-2015 04:06 PM
Find all posts by this user Quote this message in a reply
Pherael Offline
Member

Post: #4
RE: Game.Objects not rendering
I believe you can download source code of Item, Chr, Static classes and few more from Esenthel Store (for free). It's good way to get familiar with Esenthel Engine by study them.
08-02-2015 04:27 PM
Find all posts by this user Quote this message in a reply
Post Reply