Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-25-2012, 07:22 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Moving a Particle Emitter

First the story. I'm trying to make a new effect on Zodiac using the Blessing of Stamina gani as a template, since it makes an image float around behind, and in front of the player. I made a particle with a trail effect, and I'm trying to figure out how to move the emitter along the path that blessing of stamina uses. The problem is, I can't for the life of me figure out how to move it. And I have to move the emitter in order to retain the trailing effect. So moving the particle isn't an option here. Does anyone know how to do this?

This is the one that I had figured would work:
(I've also tried with(findimg(200)){emitter.x += stuff;emitter.y += stuff;} with no success.)

PHP Code:
GANI0001

CONTINUOUS
DEFAULTHEAD head19
.png
DEFAULTBODY body
.png

SCRIPT
function onPlayerenters(){
  
this.max 1;
  
this.0;
  
this.1;
  
this..2;
  if (
this.max <= 0this.max 1;
  
setarray(this.angle,this.max);
  
setarray(this.zed,this.max);
  
setarray(this.zmove,this.max);
  
setarray(this.zgoto,this.max);


  for(
a=0;a<this.max;a++) {
    
this.angle[a] = 4.78;
    
this.zed[a] = random(0,1.25);
    
this.zmove[a] = 0;
    
this.zgoto[a] = random(0,1.5);
  }

  
setTimer(.05);
}

function 
onTimeout(){
  
setTimer(.05);
  for(
a=0;a<this.max;a++) {
    
this.angle[a] = (this.angle[a]+.1)%6.28;
    if (
this.zgoto[a] > this.zed[a]) {
      if (
this.zmove[a] < .1this.zmove[a] += .05;
    }
    if (
this.zgoto[a] < this.zed[a]) {
      if (
this.zmove[a] > -.1this.zmove[a] -= .05;
    }
    if (
this.zed[ain |this.zgoto[a]-.1,this.zgoto[a]+.1|) this.zgoto[a] = random(0,1.5);
    
this.zed[a] += this.zmove[a];
    
findimg(200).x+=.75+sin(this.angle[a]);
    
findimg(200).y+=.5+cos(this.angle[a])*.5;
    
findimg(200).this.zed[a]-1;

    if (
this.angle[ain |1.57,4.71|) findimg(200).layer 1
    else 
findimg(200).layer 2;
  }
}

function 
onCreated()
{
  
with (findimg(200))
  {
    
spin degtorad(0);
    
rotation degtorad(0);
 
    
with (emitter)
    {
      
delaymin 0;
      
delaymax 0;
      
nrofparticles 1;
      
emitautomatically true;
      
autorotation false;
      
firstinfront true;
      
emissionoffset = {0,0,0};
      
attachposition true;
      
attachtoowner true;
      
checkbelowterrain false;
      
continueafterdestroy true;
      
maxparticles 100000;

      
particleTypes 1;

      
// Curse
      
with (particles[0])
      {
        
image "light4.png";
        
zoom 0.2;
        
red 0.5;
        
green 1;
        
blue 0;
        
alpha 1;
        
mode 2;
        
lifetime 1;
        
angle degtorad(270);
        
zangle degtorad(0);
        
speed 0;
        
rotation degtorad(0);
        
spin degtorad(0);
        
partx 0;
        
party 0;
        
partw 0;
        
parth 0;
        
stretchx 1;
        
stretchy 1;
        
sound "";
        
layer 2;
      }

      
addlocalmodifier("range"0.251"zoom""replace"0.20); // Zoom Out
      
addlocalmodifier("range"0.251"alpha""replace"0.990); // Fade Out
      
addlocalmodifier("range"00.5"red""replace"0.51); // Red
      
addlocalmodifier("range"00.5"blue""replace"01); // Blue
    
    
}
  }
}
SCRIPTEND

ANI
ANIEND 
__________________
MY POSTS ARE PRONE TO EDITS!

Last edited by Jiroxys7; 08-25-2012 at 10:05 PM..
Reply With Quote
 


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 03:48 PM.


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