Page 1 of 1

delaying time

Posted: Tue Jul 18, 2006 3:08 pm
by irrlicher
I'm making a FPS game with Irrlicht but i've a question about using times:
I've made a spark to my weapon and when i click on left mouse i want to appear that spark for 100 miliseconds and then disappear it.How can i make it?
Thanks in advance!

Posted: Tue Jul 18, 2006 3:26 pm
by stodge
If the spark is a particle, set its lifetime to 100ms. I'm not familiar with the particle system in Irrlicht.

Posted: Tue Jul 18, 2006 3:33 pm
by irrlicher
i'm afraid it is a billboard :( I load a image into billboard and set it's position to weapon.

Posted: Tue Jul 18, 2006 3:45 pm
by cadue
you can use a delete animator!

Code: Select all

ISceneNodeAnimator* delete = smgr->createDeleteAnimator(time);
node->addAnimator(delete);
Anyway I think a children 13 years old can make a 3d games...I'm 14 and I studied programming when I was 12...
:)

I've created a FPS a month ago...(whitout the enemy's intelligence). I've created the shots, the decals of the shots, jump, recoil of the gun, the movement of the gun while you're moving...
Tomorrow I'll start a travel, if not I wold be happy of help you! W the joung programmers!

Posted: Tue Jul 18, 2006 6:21 pm
by irrlicher
Really?? I'm very pleased to found a young programmer at last :D I thought i am the only young programmer in this forum. I began to programming when i was 12 too and i'm 13 now :D

However i don't use a animation :( i make a billboard scene node set it's picture and i change it's lightning to appear and disappear.However i couldn't set the time correctly.When the user left clicks i do these:

Code: Select all

{
bill->setMaterialFlag(video::EMF_LIGHTING, false);
bill->setMaterialFlag(video::EMF_LIGHTING, true);
}
But it changes in a milisecond and i can't keep it.It appear and disappear immedetly.That's my problem and i'm trying to track this.

Anyway thanks for your reply!!Nice to meet you and good journey!!! :)
W the joung programmers!!!

Posted: Tue Jul 18, 2006 7:11 pm
by cadue
Why the deleteAnimator donesn't work? The deleteAnimator deletes the node when the time you set is expire. It's simple to use:

Code: Select all

if(shot){
   IBillboardSceneNode* effect = smgr->ad.....blablabla;
   ISceneNodeAnimator* delete = smgr->createDeleteAnimator(100);
   effect->addAnimator(delete);
}
perhap you think that a delete animator delete the animator....but the DeleteAnimator drop the node!. I've used it in my FPS and it works very well.

Instead of change the lighting you can set "false" the visible in this way:
node->setVisible(false);
When I'll return from the journey I want know all about you project....my e-mail and MSN is: cadue90@gmail.com (I was born in 1991, but i commited an error when i wrote my e-mail) :roll:
See u soon

Posted: Tue Jul 18, 2006 7:52 pm
by irrlicher
That worked now!!Thanks a lot dude!I'll tell you a lot if you want my msn is:
masterprog2005@hotmail.com you can send mails there too.
See you and thanks a lot again! 8)