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 04-03-2006, 11:14 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Emitter attachment offsets?

I've got a particle emitter, which I attach to a player via attr[].

The emitter has the 'attachposition' variable.

However, I want the particles to emit at random points on the player. I'm using a modifier to change the particle's x and y to a random value in reference to the player.

However, when I attach the emitter it doesn't emit when the x/y modifiers are there. I'm assuming it's emitting at 0,0

Is there any other way to do this?
Reply With Quote
  #2  
Old 04-03-2006, 11:53 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
I guess you need
showimg.attachtoowner = true;
The showimg.emitter.attachposition attribute is only for saying if the particles should automatically move with the emitter or be independend.
Reply With Quote
  #3  
Old 04-04-2006, 12:00 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
That's not making it follow..
Reply With Quote
  #4  
Old 04-04-2006, 12:12 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
If it helps..

PHP Code:
if (created) {
  
with (findimg(30)) {
    
player.x;
    
player.y;
    
attachtoowner true;
    
layer 3;

    
emitter.delaymin .15;
    
emitter.delaymax .15;
    
emitter.nrofparticles 1;
    
emitter.emissionoffset = {1,1.5,0};
    
emitter.continueafterdestroy true;
    
emitter.firstinfront false;
    
emitter.particle.lifetime .5;
    
emitter.particle.image "g4_particle_bluex.png";
    
emitter.particle.red 0;
    
emitter.particle.green 1;
    
emitter.particle.blue 0;
    
emitter.particle.alpha .9;
    
emitter.particle.zoom 1;
    
emitter.particle.speed 0;
    
emitter.particle.angle pi 2;

    
emitter.addlocalmodifier("once"00"x""replace"player.x-1.5player.x+.5);
    
emitter.addlocalmodifier("once"00"y""replace"player.y-.5player.y+1);
    
emitter.addlocalmodifier("once"00"zoom""replace".61.2);
    
emitter.addlocalmodifier("once"00"speed""replace".83.3);
    
emitter.addlocalmodifier("once"00"spin""replace", -33);
    
emitter.addlocalmodifier("range".3.5"alpha""replace".9.3);
  }
  
this.timed 1.3;
  
setTimer(.05);
}
if (
timeout) {
  if (
this.timed 0) {
    
this.timed -= .05;
    if (
this.timed <= 0) {
      
with (findimg(30)) {
        
emitter.delaymin emitter.delaymax 60;
      }
    }
  }

I've also tried setting the x and y constantly in the timeout. It doesn't work. :/
Reply With Quote
  #5  
Old 04-04-2006, 12:16 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Nevermind, I'm silly.
I made it constantly change the x/y modifier in the timeout, it works now.


And I just noticed I triple posted. Sowwy. <3
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:45 PM.


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