Truelegend
Member
|
Tutorial has stopped - error.
I have this error and why?
Code:
/******************************************************************************/
#include "stdafx.h" // include precompiled header
#include <EsenthelEngine/Enum/_enums.h>
/******************************************************************************/
Game::ObjMemx<Game::Item > Items ;
Game::ObjMemx<Game::Static > Statics ;
Game::ObjMemx<Game::Chr > Chrs ;
/******************************************************************************/
void InitPre()
{
App.name("Start");
App.flag=EE::APP_MS_EXCLUSIVE|EE::APP_FULL_TOGGLE;
DataPath("../data");
Paks.add("../data/engine.pak");
D.sync(true);
}
/******************************************************************************/
Bool Init()
{
Game::World.init()
.setObjType(Items , OBJ_ITEM)
.setObjType(Statics , OBJ_STATIC)
.setObjType(Chrs , OBJ_CHR)
.load("world/sample.world");
return true;
}
/******************************************************************************/
void Shut()
{
}
/******************************************************************************/
Bool Update()
{
if(Kb.bp(KB_ESC))return false;
{
Cam.yaw -=Ms.d().x;
Cam.pitch+=Ms.d().y;
Cam.dist=2.4f;
Cam.setSpherical(Items[0].pos(), Cam.yaw, Cam.pitch, 0, Cam.dist);
}
return true;
}
/******************************************************************************/
void Render()
{
Game::World.draw();
}
/******************************************************************************/
void Draw()
{
Renderer(Render);
}
/******************************************************************************/
Everything seems to be good. what is wrong?
|
|
04-17-2011 11:24 AM |
|
Esenthel
Administrator
|
RE: Tutorial has stopped - error.
what error?
post screen/error/call stack
|
|
04-17-2011 11:27 AM |
|
Esenthel
Administrator
|
RE: Tutorial has stopped - error.
|
|
04-17-2011 11:32 AM |
|
Truelegend
Member
|
RE: Tutorial has stopped - error.
But when i changed Bool update() function to
Code:
Bool Update()
{
if(Kb.bp(KB_ESC))return false;
CamHandle(0, 10, EE::CAMH_ROT|EE::CAMH_MOVE);
return true;
}
i dont have this error
|
|
04-17-2011 11:34 AM |
|
Esenthel
Administrator
|
RE: Tutorial has stopped - error.
Items[0].
you're code is wrong.. the 0 element doesnt exist
|
|
04-17-2011 11:36 AM |
|
Truelegend
Member
|
RE: Tutorial has stopped - error.
It does exist. okey so i tried Chrs[0] i have Character 0 and is still the same :(
|
|
04-17-2011 11:39 AM |
|
Seba
Member
|
RE: Tutorial has stopped - error.
But you don't know if they exist when update run so you need add if.
Quote:if(Chrs.elms())
if(Items.elms())
Look to tutorials.
|
|
04-17-2011 11:50 AM |
|
Truelegend
Member
|
RE: Tutorial has stopped - error.
I done this and they doesnt exist but why? when i go to world editor i have 1 character object . so why is not in engine?
Okey is working now i changed my old code and it it working. But code is the same. i dont know. anyway thanks
(This post was last modified: 04-17-2011 11:59 AM by Truelegend.)
|
|
04-17-2011 11:53 AM |
|