Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Particle Emitters Disappearing + Level Changing (https://forums.graalonline.com/forums/showthread.php?t=134261099)

fowlplay4 11-15-2010 11:35 PM

Particle Emitters Disappearing + Level Changing
 
1 Attachment(s)
Alright here's my effect:

PHP Code:

if (created || playerenters || timeout) { 
  
with (findimg(50)) {
    
player.x;
    
player.y;
    
attachtoowner true;
    
attachoffset "-2.5,-2,0";
    
image "light2.png";
    
layer 3;
    
red .2;
    
green .5;
    
blue 0;
    
alpha .9;
    
zoom .4;
    
layer 2;
    if (
particleeffectsenabled) {
      
emitter.delaymin .4;
      
emitter.delaymax 1;
      
emitter.nrofparticles 1;
      
emitter.firstinfront false;
      
emitter.attachposition true;
      
emitter.continueafterdestroy true;

      
emitter.particle.lifetime .5;
      
emitter.particle.image "g4_particle_cloud.png";  
      
emitter.particle.red 0;
      
emitter.particle.green 1;
      
emitter.particle.blue 0;
      
emitter.particle.alpha .9;
      
emitter.particle.zoom .5;
      
emitter.particle.speed 0;

      
emitter.removemodifiers();
      
emitter.addlocalmodifier("once",0,0,"x","add"22.5);
      
emitter.addlocalmodifier("once",0,0,"y","add"12);
      
emitter.addlocalmodifier("once"00"spin""replace"13);
      
emitter.addlocalmodifier("once"00"zoom""replace".5.8);
      
emitter.addlocalmodifier("once"00"alpha""replace".6.9);
      
emitter.addlocalmodifier("once"00"green""replace"11);
      
emitter.addlocalmodifier("range"0.5"alpha""add", -1, -1);
    } 
  }
  
setTimer(1);


Standard procedure it just gets placed into a player's attr to display a poison ticking effect, then if you or the person with the effect changes levels it disappears.

If I 'refresh the effect' (clear the attr and re-add) it works fine and updating the gani file causes it to work as well.

I'm hoping there's a way to fix this in the gani file or if it's a bug that needs to be fixed.

See attached for the aftermath of changing levels.

Edit: Added the changes that made it work the way I wanted it to.

Crow 11-16-2010 05:45 PM

Why mix GS1 with GS2?

xXziroXx 11-16-2010 06:43 PM

The only error similar to this that I have encountered, is that if you use setlevel2 and teleport the player to the same level he already is in, all attached player ganis stop functioning.

xAndrewx 11-16-2010 07:33 PM

hmm try changing index > 200, don't know if it'll make a difference

fowlplay4 11-16-2010 09:16 PM

I've tried the index thing, and the only solution I came upon was using a 1 second timeout.

I.e:
1. Player A poisons Player B
2. Both see the effect fine
3a. Player A leaves level and re-enters, and the poison effect isn't visible anymore but it still is to B.
3b. Player B leaves level and re-enters, and the poison effect isn't visible to Player A anymore but it still is to B.

I feel like there's an event that I'm missing or something that has to apply to the above, I thought it was onPlayerEnters but obviously not.

Oh and the mixing the GS1 and GS2 is just how it was and I didn't feel like changing it.

MrOmega 11-17-2010 04:52 PM

just throwing this idea out there. But would calling playerenters and timeout cause any issues over and over again? maybe do a playerenters and check to see if the poison is still in effect, if so end script, and let the timeout run uninterrupted, otherwise just call the timeout.

fowlplay4 11-17-2010 05:02 PM

Quote:

Originally Posted by MrOmega (Post 1612101)
just throwing this idea out there. But would calling playerenters and timeout cause any issues over and over again? maybe do a playerenters and check to see if the poison is still in effect, if so end script, and let the timeout run uninterrupted, otherwise just call the timeout.

No issues from what I can tell, and the timeout is the only thing that keeps the gani 'alive' for other players since created and playerenters don't seem to get called for them.

MrOmega 11-17-2010 06:26 PM

Quote:

Originally Posted by fowlplay4 (Post 1612102)
No issues from what I can tell, and the timeout is the only thing that keeps the gani 'alive' for other players since created and playerenters don't seem to get called for them.

Well was just thinking that playerenters may be called for the one client when the player leaves and enters, causing the script to mess up.

Jiroxys7 11-23-2010 05:56 PM

This sounds similar to (if not exactly like) the problem I posted about a good while ago.
(http://forums.graalonline.com/forums...hp?t=134260623)

The only solutions I got seem more convoluted than it needs to be. It would be nice if this thing, bug or intentional, was fixed/changed.

Edit: It looks like your problem may not be the exact same as mine, but it may be related. Personally I'm hoping it is, anyway =q

Further jargon/thinking out loud:

Perhaps that one new serverop (The one you told me was only useful on iphone, cant recall what it was called.) could be changed to adjust the visibility range of such particles on pc servers, while keeping it's current function on iphone servers? Instead of having particles get cut out if the viewer and the source are not in the same level, it would only be cut out if the viewer is however many levels/pixels/tiles/watever away from the source.

Then again, Since it seems that only the levels adjacent to the player's current level, as well as the player's current level are loaded (clientside) at a time, I don't see why we couldn't flat-out remove the limit because the player will never have more than 9 levels loaded at a time, so it's not like their computer will be burdened by displaying all particles offscreen to the ends of the gmap or anything. and if the current way particles are cut really matters, we could also instead make a new serverop: oldparticlerules=boolean (true will cut them out like they do currently, false will allow them to be displayed within the entire 3x3 level square. although I don't see what use setting it to false would actually have)

Jiroxys7 02-05-2011 06:46 PM

Update (useless)/bump
Yep, I know where I've seen it before. My projectiles that use particle emitters will work just fine if you remain in your level. but if you cross a level on the GMAP, the projectile will appear to vanish. Don't know if my post above was actually related to it or not, but it's very annoying.

It's been quite some time though and it's still a problem. Think Stefan is even aware?

Also, onCreated() and onPlayerenters() unfortunately doesn't make any difference as far as fixing the problem goes.

fowlplay4 02-05-2011 08:40 PM

Are you using the latest V6? I believe he fixed the onPlayerEnters problem.

Jiroxys7 02-05-2011 09:58 PM

Quote:

Originally Posted by fowlplay4 (Post 1628302)
Are you using the latest V6? I believe he fixed the onPlayerEnters problem.

I actually haven't because for some reason, It's now refusing to run. I can double-click the icon and it'll have the little hourglass next to the mouse for about a second, and then nothing else ever happens.


All times are GMT +2. The time now is 07:33 AM.

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