1 registered members (AndrewAMD),
1,298
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
how do I stop particles from emitting?
#308383
02/03/10 01:14
02/03/10 01:14
|
Joined: Dec 2009
Posts: 71
ncc1701d
OP
Junior Member
|
OP
Junior Member
Joined: Dec 2009
Posts: 71
|
newby here: maybe I missed in manual but. ... Just wondering how do you stop emmitting particles once they have started? I dont want to hide or unhide but turn off emitter so that last particle fades away as the fountain so to speak stops creating new particles in mid game play.
take for example the demo they show in manuals under the search word particles as an example. How would you stop them in that case? thanks
Last edited by ncc1701d; 02/03/10 01:15.
|
|
|
Re: how do I stop particles from emitting?
[Re: Espér]
#308403
02/03/10 08:39
02/03/10 08:39
|
Joined: Dec 2009
Posts: 71
ncc1701d
OP
Junior Member
|
OP
Junior Member
Joined: Dec 2009
Posts: 71
|
maybe you could tell me how what your saying fits into the context of what I am doing. I start the particle effect when pressing f1 but I cant get it to stop when release the key. here is the the code:
#include <acknex.h> #include <default.c> #include <atypes.h> //////////////////////////////
VECTOR* vTemp; function p_fountain(PARTICLE* p) { set(p, MOVE | BRIGHT); }
void start_particle_while_key(int key, VECTOR* vec) { while(1) { effect(p_fountain,maxv(1,40*time_step),vector(0,0,0),vector(0,0,4)); wait(1); } //stop effect code here I would think }
function key_down(key) //captures ALL key presses { switch(key) { case 59: start_particle_while_key(59, vTemp); break; } }
function main() { on_anykey = key_down;//tell any key press to call this function level_load(NULL); vec_set(camera.x,vector(-150,0,50)); }
Last edited by ncc1701d; 02/03/10 08:41.
|
|
|
Re: how do I stop particles from emitting?
[Re: ncc1701d]
#308432
02/03/10 10:41
02/03/10 10:41
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
Expert
|
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
create a new variable replace
while(1)
{
effect(p_fountain,maxv(1,40*time_step),vector(0,0,0),vector(0,0,4));
wait(1);
}
with
while(stopme == 0)
{
effect(p_fountain,maxv(1,40*time_step),vector(0,0,0),vector(0,0,4));
wait(1);
}
After that, add a new case to you keyswitch:
switch(key)
{
case 59:
start_particle_while_key(59, vTemp);
break;
case 0: // no key hitten
stopme = 1;
wait(2);
stopme = 0;
break;
}
*not tested.. at the moment, i´m at work and have no GStudio here*
|
|
|
Re: how do I stop particles from emitting?
[Re: Widi]
#308580
02/03/10 18:57
02/03/10 18:57
|
Joined: Dec 2009
Posts: 71
ncc1701d
OP
Junior Member
|
OP
Junior Member
Joined: Dec 2009
Posts: 71
|
|
|
|
|