Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   particle emitter question (https://forums.graalonline.com/forums/showthread.php?t=61343)

prozac424242 09-22-2005 04:28 AM

particle emitter question
 
Ok, I read the graal wiki guide and the document file posted here on particle emitters, but why does this code not work? And its a weapon on the server.

NPC Code:

//test of particle engine
//#CLIENTSIDE
function onCreated() {
showimg(1,"block.png",player.x,player.y);
with (findimg(1)) {
image = "light2.png";
layer=1;
x = player.x - 3;
y = player.y - 3;
alpha = .9;
emitter.attachposition=false;
emitter.delaymin=.05;
emitter.delaymax=1.0;
emitter.emissionoffset=playerx-3,playery-1,2;
emitter.firstinfront=true;
emitter.nrofparticles=3;
emitter.maxparticles=50;

//particle attributess

emitter.particle.lifetime=5;
emitter.particle.checkbelowterrain=false;
emitter.particle.clippingbox=0,0,-1,64,64,64;
emitter.particle.image=light2.png;
emitter.particle.mode=0;
emitter.particle.alpha=.5;

emitter.particle.zangle=pi;
emitter.particle.stretchx=2;

}


}
if (weaponfired)
{
emitter.emit();

}





nothing shows up on the screen when i fire the weapon.

napo_p2p 09-22-2005 04:37 AM

I haven't played around with emitters that much yet but maybe try ...

PHP Code:

with (findimg(1)) {
  
emitter.emit();


Also, you can use function onWeaponFired()

ForgottenLegacy 09-22-2005 04:45 AM

Quote:

emitter.emissionoffset=playerx-3,playery-1,2;
Emissionoffset is in delta, not absolute. As in, use "-3","-1", and "2". Also, it's an array, remember? You need the {} things.
Quote:

emitter.particle.clippingbox=0,0,-1,64,64,64;
Another array, and also check this one versus the DocuEmitters.txt. Use {} thingeys.
Quote:

if (weaponfired)
{
emitter.emit();

}
You need the thing inside a findimg(), otherwise it won't know which emitter to emit.


All times are GMT +2. The time now is 08:45 AM.

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