Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-28-2009, 07:35 AM
Nyght Nyght is offline
Registered User
Join Date: Apr 2009
Posts: 5
Nyght is on a distinguished road
particle effects...

So i'm trying to get this working on delteria dev and i'm needing some help with this code.

Initially this code did exactly what I needed to, than everytime I modify it one way or another it ends up giving me a single image rather than the flame effect i'm shooting for.


NPC Code:

//#CLIENTSIDE
function onTimeout()
{
findImg(200).x = player.x;
findImg(200).y = player.y;
this.setTimer(0.05);
}
function onCreated()
{
findImg(200).x = player.x;
findImg(200).y = player.y;
this.setTimer(0.05);
layer = 3;
with (emitter)
{
delaymin = 0.05;
delaymax = 0.05;
nrofparticles = 6;
maxparticles = 260;

with (particle)
{
angle = pi / 2;
lifetime = 4;
image = "light2s.png";
red = 0.85;
green = 0.09;
blue = 0.03;
alpha = 0.99;
speed = 0.35;
}

addlocalmodifier("impulse", 0, 0, "angle", "add", -0.04, 0.04);
addlocalmodifier("once", 0, 0, "x", "add", 0, 0.65);
addlocalmodifier("range", 0.5, 4, "alpha", "replace", 0.99, 0);
addlocalmodifier("range", 0.4, 4, "zoom", "replace", 0.6, 0);
addlocalmodifier("range", 0.2, 4, "speed", "replace", 0.5, 4);
}
}

Reply With Quote
  #2  
Old 05-28-2009, 07:03 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Could be due to using "add" .. try this:
PHP Code:
//#CLIENTSIDE

function onTimeout() 

{

 
findImg(200).player.x;

 
findImg(200).player.y;

 
this.setTimer(0.05);

}

function 
onCreated() 

{

 
findImg(200).player.x;

 
findImg(200).player.y;

 
this.setTimer(0.05);

 
layer 3;

 
with (emitter

 {

  
delaymin 0.05;

  
delaymax 0.05;

  
nrofparticles 6;

  
maxparticles 260;



  
with (particle)

  {

   
angle pi 2;

   
lifetime 4;

   
image "light2s.png";

   
red 0.85;

   
green 0.09;

   
blue 0.03;

   
alpha 0.99;

   
speed 0.35;

  }

  
removeModifiers();
  
removeParticles();

  
addlocalmodifier("impulse"00"angle""add", -0.040.04);

  
addlocalmodifier("once"00"x""add"00.65);

  
addlocalmodifier("range"0.54"alpha""replace"0.990);

  
addlocalmodifier("range"0.44"zoom""replace"0.60);

  
addlocalmodifier("range"0.24"speed""replace"0.54);

 }


__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 05-28-2009, 08:22 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Could be because you're editting the emitter object outside of the image object's scope.

As an edit to Tig's suggestion:

PHP Code:
//#CLIENTSIDE

function onTimeout() 

{

 
findImg(200).player.x;

 
findImg(200).player.y;

 
this.setTimer(0.05);

}

function 
onCreated() 

{

 
findImg(200).player.x;

 
findImg(200).player.y;

 
this.setTimer(0.05);

 
layer 3;
    
  
with(findimg(200)) 
  {
     
with (emitter

     {

      
delaymin 0.05;

      
delaymax 0.05;

      
nrofparticles 6;

      
maxparticles 260;



      
with (particle)

      {

       
angle pi 2;

       
lifetime 4;

       
image "light2s.png";

       
red 0.85;

       
green 0.09;

       
blue 0.03;

       
alpha 0.99;

       
speed 0.35;

      }

      
removeModifiers();
      
removeParticles();

      
addlocalmodifier("impulse"00"angle""add", -0.040.04);

      
addlocalmodifier("once"00"x""add"00.65);

      
addlocalmodifier("range"0.54"alpha""replace"0.990);

      
addlocalmodifier("range"0.44"zoom""replace"0.60);

      
addlocalmodifier("range"0.24"speed""replace"0.54);

     }
  }

Reply With Quote
  #4  
Old 05-31-2009, 01:26 AM
Nyght Nyght is offline
Registered User
Join Date: Apr 2009
Posts: 5
Nyght is on a distinguished road
Thanks guys...that helped tons!

Reply With Quote
  #5  
Old 05-31-2009, 10:26 AM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
looks awesome!
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 02:03 PM.


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