Event Receiver Problems

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
jam
Posts: 409
Joined: Fri Nov 04, 2005 3:52 am

Post by jam »

monkeycracks wrote:I don't get any errors or warnings when compiling with it.
Thats not my problem

My problem is the event receiver doesn't work.

And I use 1.0 because IamarCam doesn't work with 1.1
Alright recompiled the program with Irrlicht 1.0, I replaced

Code: Select all

//IamarCamera* Icamera;
//Icamera = new IamarCamera((ISceneNode*)playermesh, smgr, -1); 
//smgr->setActiveCamera(Icamera);
with

Code: Select all

smgr->addCameraSceneNodeFPS();
ran the program, hit escape and it exits just like it should. I can't seem to reproduce your problem.
system-independent, adj.:
Works equally poorly on all systems.
-- unknown
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

I FINALLY got it working, sorry for the hastle.
Last edited by monkeycracks on Sun Aug 27, 2006 10:02 am, edited 1 time in total.
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

However, I did run into another problem with it.

static bool isWalking = false; //at the top of the header

Code: Select all

	bool OnEvent(SEvent event)
	{
	if (event.EventType == EET_KEY_INPUT_EVENT &&
		event.KeyInput.Key == KEY_ESCAPE)
	{
			device->closeDevice();
			return true;
	
	}
	else
	if (event.EventType == EET_KEY_INPUT_EVENT &&
        event.KeyInput.Key == KEY_KEY_E)
        {
         isWalking == true;
         return true;
         }
	return false;
}
Theres the event receiver

Code: Select all

  playermesh = smgr->getMesh("media/rahhmd2.md2");
  playermeshn = smgr->addAnimatedMeshSceneNode(playermesh);
  playermeshn->setMaterialTexture(0, driver->getTexture("media/evil.pcx"));
  playermeshn->setPosition(vector3df(0,45,0));
  playermeshn->setScale(vector3df(2.0f,2.0f,2.0f));
  if(!isWalking){playermeshn->setMD2Animation(EMAT_STAND);}
  if(isWalking){playermeshn->setMD2Animation(EMAT_RUN);}
  playermeshn->addShadowVolumeSceneNode();
  
  evil1wep2 = smgr->getMesh("media/weapon.md2");
  evil1wepn2 = smgr->addAnimatedMeshSceneNode(evil1wep2, playermeshn, 1, vector3df(0,0,0));
  evil1wepn2->setMaterialTexture(0, driver->getTexture("media/weapon.pcx"));
  if(!isWalking){evil1wepn2->setMD2Animation(EMAT_STAND);}
  evil1wepn2->addShadowVolumeSceneNode();
Theres where I load up a mesh.
For some reason when the E key is pressed, nothing happens.
It should trigger the isWalking to true and cause the EMAT_RUN animation to play, however it just remains in stand.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Well, this is a comparison:

Code: Select all

isWalking == true; 
use this:

Code: Select all

isWalking = true; 
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

I tried changing the key to be pressed down to J and commented out IamarCam and added in an FPS cam, because of previous complications, however neither of those worked.

I also changed == to =.
Post Reply