Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Emitter attachment offsets? (https://forums.graalonline.com/forums/showthread.php?t=65173)

Yen 04-03-2006 11:14 PM

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?

Admins 04-03-2006 11:53 PM

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.

Yen 04-04-2006 12:00 AM

:( That's not making it follow..

Yen 04-04-2006 12:12 AM

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. :/

Yen 04-04-2006 12:16 AM

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


All times are GMT +2. The time now is 11:48 PM.

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