Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   My ungodly amount of questions thread. (https://forums.graalonline.com/forums/showthread.php?t=134257954)

Engine 02-11-2010 09:02 PM

Shouldn't this make the particle effects find the player? I have tried searching the forums but couldn't find anything about this. Can you even get the particles x/y and change it's angle after it has been emitted?
PHP Code:

function onTimeout(){
  
temp.dx = ((player.x+1.5) - (findimg(200).emitter.particle.x));
  
temp.dy = ((player.y+2) - (findimg(200).emitter.particle.y));
  
findimg(200).emitter.particle.angle getangle(temp.dx,temp.dy);
  
settimer(0.05);



fowlplay4 02-11-2010 09:17 PM

You can't edit/change an emitted particle, you'll have to use the addlocalmodifier and so on to get what you're looking for.

Engine 02-11-2010 09:18 PM

Can you read a particles x/y after it has been emitted? like
PHP Code:

emitter.particle.x

because that doesn't seem to want to work when i do
PHP Code:

player.chat emitter.particle.x SPC emitter.partilce.y


fowlplay4 02-11-2010 09:40 PM

I don't believe so since it works like this:

emitter.particle.property

When a particle emits, it uses the emitter, and particle variables that you defined and then it's out of your control.

If you want complete control over an image, you'll have to use a showimg/findimg method.

Engine 02-12-2010 05:13 AM

I ended up using move();
I'm having a problem of the particle hopping between players when they are both within range and then glitching out. I currently have the following in a loop move it using move(); I can't figure out why it keeps happening. I tried adding checks but I couldn't figure it out. Could someone tell me what I could do to keep it from jumping back and fourth between players?
PHP Code:

for (pl:findnearestplayers(this.x,this,y)){
if (
pl.x in |this.x-8this.x+8| && pl.y in |this.y-10this.y+10|){
  
this.dx = (pl.this.x);
  
this.dy = (pl.this.y);  
  break;  
  }



adam 02-20-2010 03:47 AM

Yes, I have been wondering about altering my particle engine script to use emitters, but I guess for the great speed there is also sacrafice of dynamic control.


All times are GMT +2. The time now is 12:53 AM.

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