Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-22-2011, 07:15 AM
pig132 pig132 is offline
professional troll
Join Date: May 2006
Posts: 260
pig132 will become famous soon enough
What do you think of my particle?

Looking for some feedback on my particle I recently finished. Looks a lot better in the actual level than in the video. If you'd like to see it you can go to Testbed and warp to "bad.nw".


http://www.youtube.com/watch?v=IqT-pmSAC5E


edit: youtube embed won't work for some reason
Reply With Quote
  #2  
Old 09-22-2011, 07:26 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I think it would look better if you used particletypes and set specific colors (I.e: Red, Green, Blue, Yellow) instead of relying on "random" to generate a color.

PHP Code:
// Often generates odd/mainly white colors
red random(0,1);
green random(0,1);
blue random(0,1); 
I believe it would work something like this:

PHP Code:
with (findimg(200)) {
  
temp.colorz = {
    {
100},
    {
010},
    {
001},
    {
110}
  };
  
emitter.particletypes temp.colorz.size();
  for (
temp.0temp.emitter.particletypestemp.i++) {
     
emitter.particle[temp.i].red temp.colorz[temp.i][0];
     
emitter.particle[temp.i].green temp.colorz[temp.i][1];
     
emitter.particle[temp.i].blue temp.colorz[temp.i][2];
  }

I'm sure you can apply this to other particle ideas as well. Nice work none the less.
__________________
Quote:
Reply With Quote
  #3  
Old 09-22-2011, 07:40 AM
pig132 pig132 is offline
professional troll
Join Date: May 2006
Posts: 260
pig132 will become famous soon enough
What exactly is 'particletypes'? I understand the colors and it produces some really nice colors that mine didn't, but also what that does is create a big white orb in the middle and then for some reason changes the angles of which they are shot out at.

Also, what are the 3 variables for in 'this.colorz' on each line?
Reply With Quote
  #4  
Old 09-22-2011, 01:32 PM
oralgnome oralgnome is offline
doesnt afraid of anything
oralgnome's Avatar
Join Date: Sep 2011
Posts: 34
oralgnome is an unknown quantity at this point
Quote:
Originally Posted by pig132 View Post
...also, what are the 3 variables for in 'this.colorz' on each line?
rgb?
__________________
Quote:
Originally Posted by CaySedaiSim View Post
Is there a GS2 for retards book..?
Reply With Quote
  #5  
Old 09-22-2011, 03:44 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Well by default there's only 1 particle type, setting it to 4 allows you have to your particle emitter emit 4 different types of particles.

The only difference is that you would have to use particle[index] instead of just particle.

Post your code so we can try and debug the white orb.

The array of colorz just stores multiple red, green, and blue values. I.e:

PHP Code:
temp.colorz = {
  {
redgreenblue},
}; 
__________________
Quote:
Reply With Quote
  #6  
Old 09-23-2011, 04:33 AM
pig132 pig132 is offline
professional troll
Join Date: May 2006
Posts: 260
pig132 will become famous soon enough
Ah, I assumed that was it.

PHP Code:
function onPlayerChats()
{
  if (
player.account "pig132")
  {
    if (
player.chat "/d")
    {
      
destroy();
    }
  }
}
//#CLIENTSIDE
function onPlayerEnters()
{
with (findimg(1)) {
  
  
temp.colors = {
  {
001},
  {
010},
  {
010},
  {
010}
  };
  
  
layer 2;
  
emitter.delaymin 0.01;
  
emitter.delaymax 0.01;
  
emitter.nrofparticles 1;

  
emitter.particle.lifetime 6;
  
emitter.particle.image "g4_particle_sun.png";
  
emitter.particle.mode 0;
  
emitter.particle.alpha 1;
  
emitter.particle.zoom 1;
  
  
emitter.particletypes temp.colors.size();
  
  for (
temp.0temp.emitter.particletypestemp.i++)
  {
    
emitter.particle[temp.i].red temp.colors[temp.i][0];
    
emitter.particle[temp.i].green temp.colors[temp.i][1];
    
emitter.particle[temp.i].blue temp.colors[temp.i][2];
    
sleep(0.05);
  }
  
  
emitter.particle.red 0;
  
emitter.particle.green 0;
  
emitter.particle.blue 0;

  
emitter.particle.angle pi 2;
  
emitter.particle.speed 4;
  
  
emitter.addlocalmodifier("once"00"angle""add"3030);
  
emitter.addemitmodifier("impulse".115.115"angle""add"degtorad(45), degtorad(45)); 
  
  
emitter.addlocalmodifier("range"24"alpha""replace"0.990);
  
emitter.addlocalmodifier("range"24"zoom""add"13);
  }

Reply With Quote
  #7  
Old 09-23-2011, 04:44 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Try..

PHP Code:
function onPlayerEnters()
{
with (findimg(1)) {
  
  
temp.colors = {
  {
001},
  {
010},
  {
010},
  {
010}
  };
  
  
layer 2;
  
emitter.delaymin 0.05;
  
emitter.delaymax 0.05;
  
emitter.nrofparticles 1;
  
  
emitter.particletypes temp.colors.size();
  
  for (
temp.0temp.emitter.particletypestemp.i++)
  {
    
emitter.particle[temp.i].red temp.colors[temp.i][0];
    
emitter.particle[temp.i].green temp.colors[temp.i][1];
    
emitter.particle[temp.i].blue temp.colors[temp.i][2];
    
emitter.particle[temp.i].angle pi 2;
    
emitter.particle[temp.i].speed 4;
    
emitter.particle[temp.i].lifetime 6;
    
emitter.particle[temp.i].image "g4_particle_sun.png";
    
emitter.particle[temp.i].mode 0;
    
emitter.particle[temp.i].alpha 1;
    
emitter.particle[temp.i].zoom 1;
    
//sleep(0.05); // not even needed...
  
}
  
  
emitter.addlocalmodifier("once"00"angle""add"3030);
  
emitter.addemitmodifier("impulse".115.115"angle""add"degtorad(45), degtorad(45)); 
  
  
emitter.addlocalmodifier("range"24"alpha""replace"0.990);
  
emitter.addlocalmodifier("range"24"zoom""add"13);
  }

__________________
Quote:
Reply With Quote
  #8  
Old 09-23-2011, 04:54 AM
pig132 pig132 is offline
professional troll
Join Date: May 2006
Posts: 260
pig132 will become famous soon enough
Cool, thank you. That removed the odd white orb, but for some reason its like it is skipping certain parts where it should be emitting. Like in the video, it emits in a complete circle. I'm not sure why though. It also seems to be changing the time between emits for some reason...All of those settings haven't been changed
Reply With Quote
  #9  
Old 09-23-2011, 06:36 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is just really niceTricxta is just really nice
Looks like a pretty cool effect, neat work
Reply With Quote
  #10  
Old 09-23-2011, 12:11 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by pig132 View Post
Cool, thank you. That removed the odd white orb, but for some reason its like it is skipping certain parts where it should be emitting. Like in the video, it emits in a complete circle. I'm not sure why though. It also seems to be changing the time between emits for some reason...All of those settings haven't been changed
That kind of stuff can heavily depend on emitter.maxparticles. Can't see it in your code, and I'm not even sure if it has a default value, but try setting that to something higher.
Reply With Quote
  #11  
Old 09-23-2011, 08:15 PM
pig132 pig132 is offline
professional troll
Join Date: May 2006
Posts: 260
pig132 will become famous soon enough
I always thought that if you didn't specify how many max particles, it just didn't have a max. Also, I set it to 100, and immediately it started skipping.
Reply With Quote
  #12  
Old 09-23-2011, 08:30 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by pig132 View Post
I always thought that if you didn't specify how many max particles, it just didn't have a max.
To be honest, I never tried it. I don't know what the default behavior is, it was just an assumption.
Reply With Quote
  #13  
Old 09-23-2011, 08:32 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by pig132 View Post
I always thought that if you didn't specify how many max particles, it just didn't have a max. Also, I set it to 100, and immediately it started skipping.
Because your delay is set to 0.05 and your particle lifetime is 6 seconds.

You would need at least a maximum of 120 (6/0.05) particles to keep a steady stream.

How to calc it:
emitter.maxparticles = (particle.lifetime / particle.delaymin) * emitter.nrofparticles
__________________
Quote:
Reply With Quote
  #14  
Old 09-24-2011, 03:31 AM
pig132 pig132 is offline
professional troll
Join Date: May 2006
Posts: 260
pig132 will become famous soon enough
Quote:
Originally Posted by fowlplay4 View Post
Because your delay is set to 0.05 and your particle lifetime is 6 seconds.

You would need at least a maximum of 120 (6/0.05) particles to keep a steady stream.

How to calc it:
emitter.maxparticles = (particle.lifetime / particle.delaymin) * emitter.nrofparticles
Well yeah, I even messed with the delaymin and max, lifetime, etc but still for some reason skips.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.