Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (TipmyPip, AndrewAMD, NewbieZorro), 16,055 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to stop my particle effect? #244261
01/03/09 17:22
01/03/09 17:22
Joined: Jul 2008
Posts: 14
The Netherlands
W
Warkey Offline OP
Newbie
Warkey  Offline OP
Newbie
W

Joined: Jul 2008
Posts: 14
The Netherlands
The particle can be activated by pressing M on keyboard. Then the effect shows up in the air like firework. I would like if the radius is 200, then the effect needs to be invissible. But i dont know how to script this.

Code:
VAR fireworkAnzahlPartikel = 1; //number of particles used for this effect
var radius = 0;

SOUND shellknal = <shellknal.wav>;

Function firework_spec_fun()
{
    if(my.size > 0) { my.size -= 0.117 *time; }else{my.lifespan = 0; }
    my.alpha -= 5 *time;
    IF(My.alpha < 0) { my.alpha = 0; my.lifespan = 0; }
}

Function fireworkspezial()
{
    my.blue = 233 ;
    my.green = 156 ;
    my.red = 250 ;
    my.vel_x = random( 3 ) - 1.500 ;
    my.vel_y = random( 3 ) - 1.500 ;
    my.vel_z = random( 3 );
    my.size = 4 ;
    my.alpha = 50 ;
    my.gravity = 0 ;
    my.streak = off;
    my.flare = on;
    my.bright = on;
    my.beam = off;
    my.move = on;
    my.transparent = on;
    my.function = firework_spec_fun;
	}
}


Function firework()
{
  while(1)
  {
     fireworkAnzahlPartikel = 1;
     my.skill9 = 0;
      my.skill11 = 360 ;
      
    if(radius >= 200){ 
    // effect needs to stop but how to do it?
    }
    
     while (my.skill9 < my.skill11)
     {
     	  radius += 0.1; 
        temp.x = my.x + cos(my.skill9)*radius ;
        temp.y = my.y + sin(my.skill9)*radius ;
        temp.z = my.z;
        my.skill9 += 15 ;
        effect(fireworkspezial,max(1,int(fireworkAnzahlPartikel*time)),temp,nullvector);
     }
     wait(1);
  }
}


action firework_action()
{
  my.invisible = on;
  My.passable = on;
  while(!key_m) { wait(1); }
  snd_play(shellknal,100,0);
  firework();
}


And when the effect is dissapered, it must be possible to show the particle effect again with M on the keyboard.

Anyone can help me? Thanks!
Regards, Warkey

Re: How to stop my particle effect? [Re: Warkey] #244265
01/03/09 17:47
01/03/09 17:47
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
Code:
action firework_action()
{
  my.invisible = on;
  My.passable = on;
  while(1) 
  {
     if(key_m){
        snd_play(shellknal,100,0);
        firework();
     }
     while(key_m){wait(1);}
     wait(1);
  }
  
}


this will allow you to repeat your fireworks with pressing the m key again



Ubi bene, ibi Patria.
Re: How to stop my particle effect? [Re: croman] #244269
01/03/09 18:03
01/03/09 18:03
Joined: Jul 2008
Posts: 14
The Netherlands
W
Warkey Offline OP
Newbie
Warkey  Offline OP
Newbie
W

Joined: Jul 2008
Posts: 14
The Netherlands
That works, but the effect isn't show up when pressed second time.

Re: How to stop my particle effect? [Re: Warkey] #244282
01/03/09 20:04
01/03/09 20:04
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline
Serious User
Blade280891  Offline
Serious User

Joined: Jan 2008
Posts: 1,580
shouldn't

while(key_m){wait(1);}

be

while(!key_m){wait(1);}


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: How to stop my particle effect? [Re: Blade280891] #244284
01/03/09 20:12
01/03/09 20:12
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
on your way it wont work blade!
it's standard method when you want to wait until user releases the button and presses it again to call that function again

btw, he got that problem solved

Last edited by cerberi_croman; 01/03/09 20:14.


Ubi bene, ibi Patria.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1