Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-31-2010, 12:27 AM
darkcloud667 darkcloud667 is offline
That One Guy.
darkcloud667's Avatar
Join Date: Dec 2009
Location: Missouri
Posts: 40
darkcloud667 will become famous soon enough
Emitter scripting problems.

alright.
so basically heres my problem, i have an effect, and it works fine.
until i move from one area to the other.
basically, im standing in npulse's level2, i see the stuff that the effect emits.
then i move to level3, and the lighting works, but the fog n stuff doesnt.
so i come here to you, my fellow graalians.

wat do.

EDIT: btw, ive tried setting a var to it to stay on and emit along the player, ive used attachtoowner, etc.
ive also tried to have it use a timeout to move it to the players x and y.

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  
say2("Say '/hallo on' to turn on,
Say '/hallo off' to turn off."
);
  }
function 
onPlayerChats() {
 if(
player.chat == "/hallo on") {
with(findimg(200)) {
  
attachtoowner true;
  
this.this.dx;
  
this.this.dy;
  
layer 3;
  
emitter.particle.speed 0;
  
emitter.particle.green .9;
  
emitter.particle.blue .9;
  
emitter.particle.red .9;
  
emitter.particle.image "g4_particle_smoke.png";
  
emitter.particle.lifetime 5;
  
emitter.delaymin .5;
  
emitter.delaymax 1;
  
emitter.maxparticles 20;
  
emitter.nrofparticles 5;
  
emitter.particle.mode 0;
  
emitter.particle.zoom 1;
  
emitter.particle.alpha .2;
  
emitter.particle.spin 0;
  
emitter.particle.angle 0;
  
emitter.particle.stretchx 5;
  
emitter.particle.stretchy .6;
  
emitter.continueafterdestroy false;
  
emitter.addlocalmodifier("once"00"speed""replace"14.5);
  
emitter.addlocalmodifier("once"00"stretchx""replace"2.510);
  
emitter.addlocalmodifier("once"00"zoom""replace"12.5);
  
emitter.addlocalmodifier("range"02.5"alpha""replace"0.35);
  
emitter.addlocalmodifier("range"2.55"alpha""replace".350);
  
emitter.addlocalmodifier("once"00"y""replace"player.y-30player.y+30);
  
emitter.addlocalmodifier("once"00"x""replace"player.x-30player.x+30);
}
with(findimg(201)) {
  
attachtoowner true;
  
this.this.dx;
  
this.this.dy;
  
layer 3;
  
emitter.particle.speed 5;
  
emitter.particle.green 1;
  
emitter.particle.blue 1;
  
emitter.particle.red 1;
  
emitter.particle.image "npulse-ghosteffect.png";
  
emitter.particle.lifetime 3;
  
emitter.delaymin .05;
  
emitter.delaymax 1;
  
emitter.maxparticles 10;
  
emitter.nrofparticles 1;
  
emitter.particle.mode 0;
  
emitter.particle.zoom 4.5;
  
emitter.particle.alpha .25;
  
emitter.particle.spin 0;
  
emitter.particle.angle degtorad(90);
  
emitter.continueafterdestroy false;
  
emitter.addlocalmodifier("range"01.5"alpha""replace"01);
  
emitter.addlocalmodifier("range"1.53"alpha""replace"10);
  
emitter.addlocalmodifier("range"02.5"zoom""replace"03.5);
  
emitter.addlocalmodifier("once"00"y""replace"player.y-30player.y+30);
  
emitter.addlocalmodifier("once"00"x""replace"player.x-30player.x+30);
}
with(findimg(202)) {
  
attachtoowner true;
  
this.this.dx;
  
this.this.dy;
  
layer 3;
  
emitter.particle.speed 0;
  
emitter.particle.green 0;
  
emitter.particle.blue 0;
  
emitter.particle.red 0;
  
emitter.particle.image "light4.png";
  
emitter.particle.lifetime .15;
  
emitter.delaymin .15;
  
emitter.delaymax .15;
  
emitter.maxparticles 1;
  
emitter.nrofparticles 1;
  
emitter.particle.mode 0;
  
emitter.particle.zoom 10;
  
emitter.particle.alpha .5;
  
emitter.particle.spin 0;
  
emitter.particle.angle degtorad(90);
  
emitter.continueafterdestroy false;
}
}
  if(
player.chat == "/hallo off") {
with(findimg(200)) {
  
this.this.dx;
  
this.this.dy;
  
emitter.particle.speed 0;
  
emitter.particle.green 0;
  
emitter.particle.blue 0;
  
emitter.particle.red 0;
  
emitter.particle.image "";
  
emitter.particle.lifetime 0;
  
emitter.delaymin 0;
  
emitter.delaymax 0;
  
emitter.maxparticles 0;
  
emitter.nrofparticles 0;
  
emitter.particle.mode 0;
  
emitter.particle.zoom 0;
  
emitter.particle.alpha 0;
  
emitter.particle.spin 0;
  
emitter.particle.angle 0;
  
emitter.particle.stretchx 0;
  
emitter.particle.stretchy 0;
}
with(findimg(201)) {
  
this.this.dx;
  
this.this.dy;
  
emitter.particle.speed 0;
  
emitter.particle.green 0;
  
emitter.particle.blue 0;
  
emitter.particle.red 0;
  
emitter.particle.image "";
  
emitter.particle.lifetime 0;
  
emitter.delaymin 0;
  
emitter.delaymax 0;
  
emitter.maxparticles 0;
  
emitter.nrofparticles 0;
  
emitter.particle.mode 0;
  
emitter.particle.zoom 0;
  
emitter.particle.alpha 0;
  
emitter.particle.spin 0;
  
emitter.particle.angle 0;
  
emitter.particle.stretchx 0;
  
emitter.particle.stretchy 0;
  }
with(findimg(202)) {
  
this.this.dx;
  
this.this.dy;
  
emitter.particle.speed 0;
  
emitter.particle.green 0;
  
emitter.particle.blue 0;
  
emitter.particle.red 0;
  
emitter.particle.image "";
  
emitter.particle.lifetime 0;
  
emitter.delaymin 0;
  
emitter.delaymax 0;
  
emitter.maxparticles 0;
  
emitter.nrofparticles 0;
  
emitter.particle.mode 0;
  
emitter.particle.zoom 0;
  
emitter.particle.alpha 0;
  
emitter.particle.spin 0;
  
emitter.particle.angle 0;
  
emitter.particle.stretchx 0;
  
emitter.particle.stretchy 0;
  }
  }

__________________
"Time is a great teacher, but unfortunately it kills all its pupils."

"Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings."

"The man who smiles when things go wrong has thought of someone to blame it on."
Reply With Quote
  #2  
Old 10-31-2010, 02:08 AM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
I think this is the problem:
PHP Code:
emitter.addlocalmodifier("once"00"y""replace"player.y-30player.y+30);
emitter.addlocalmodifier("once"00"x""replace"player.x-30player.x+30); 
It forces the particles to spawn around the place where the player last said "/hallo on". If he's at (32, 32), they'll spawn in the range 32-30 to 32+30 or 2 to 62, which will break when you're on a gmap.

Try this instead:
PHP Code:
emitter.addlocalmodifier("once"00"y""add", -30, +30);
emitter.addlocalmodifier("once"00"x""add", -30, +30); 

And unrelated to the problem, you can remove this:
PHP Code:
this.this.dx;
this.this.dy
And a good way to turn on/off particle effects is to toggle the emitter.emitautomatically flag.
Reply With Quote
  #3  
Old 10-31-2010, 02:18 AM
darkcloud667 darkcloud667 is offline
That One Guy.
darkcloud667's Avatar
Join Date: Dec 2009
Location: Missouri
Posts: 40
darkcloud667 will become famous soon enough
thanks bro, saved my ass.
__________________
"Time is a great teacher, but unfortunately it kills all its pupils."

"Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings."

"The man who smiles when things go wrong has thought of someone to blame it on."
Reply With Quote
  #4  
Old 11-01-2010, 11:40 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
I certainly hope you plan on adding particleeffectsenabled and lighteffectsenabled checks for this.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #5  
Old 11-01-2010, 11:55 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by xXziroXx View Post
I certainly hope you plan on adding particleeffectsenabled and lighteffectsenabled checks for this.
Yeah he should probably add things like..

PHP Code:
if (!particleeffectsenabled) {
  
emitter.delaymin emitter.delaymax 0.05;
  
emitter.maxparticles 1000;

__________________
Quote:
Reply With Quote
  #6  
Old 11-02-2010, 12:23 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Nope, He never does lol (take it from someone who has witnessed and seen him in process of making an effect)
__________________

Careful, thoughts and opinions here scare people.
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 09:04 PM.


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