Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-26-2008, 11:08 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Some help with weather system

Well, I released the code to my weather system just a little while ago, but I need to change the way it works. I'm changing it to use classes for the weather effects, but for some reason it doesn't do anything.

Here's the class:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
with (findImg(201)) {
    
// Emitter attributes
    
layer 2;
    
player.xplayer.y;
    
emitter.delaymin 0.1;
    
emitter.delaymax 0.3;
    
emitter.nrofparticles 5;
    
emitter.emissionoffset = {-12, -1550};
    
emitter.checkbelowterrain true;

    
// Basic particle attributes
    
emitter.particle.lifetime 20;
    
emitter.particle.zoom 2;
    
emitter.particle.image "abjorn_particle_rain.gif";
    
emitter.particle.rotation = -degtorad(10);

    
// Movement
    
emitter.particle.zangle = -1;
    
emitter.particle.speed 15;
    
emitter.particle.alpha 1;
    
emitter.particle.mode 0;

    
emitter.addglobalmodifier("impulse"0.20.2"zangle""multiply"0.950.95);
    
emitter.addlocalmodifier("impulse"020"zoom""add", -1.5.2);
    
emitter.addlocalmodifier("once"00"angle""replace"degtorad(260), degtorad(230));
    
emitter.addlocalmodifier("once"00"x""add", -6464);
    
emitter.addlocalmodifier("once"00"y""add", -100);
    
emitter.addlocalmodifier("once"00"zoom""replace"0.61.2);
    
emitter.addlocalmodifier("range"010"speed""add"13);
    
emitter.addglobalmodifier("range"0.125"angle""add", -degtorad(45), degtorad(45));
  }
  
this.timer 0;
  
this.lifetime 0;
  
setTimer(0.1);
}
function 
onTimeOut() {
  
temp.findImg(201);
  
temp.i.player.xtemp.i.player.y;
  if (
this.timer .5)
    
this.timer += .1;
  else {
    if (
this.lifetime 800) {
      if (
temp.i.emitter.nrofparticles 150
        
temp.i.emitter.nrofparticles++;
      
this.timer 0;
    }
  }
  if (
this.lifetime 800)
    
this.lifetime += .1;
  else {
    if (
temp.i.emitter.nrofparticles 0)
      
temp.i.emitter.nrofparticles--;
  }
  
hideimg(202);
  if (
temp.i.emitter.nrofparticles 75) {
    
temp.chance int(random(0500));
    if (
temp.chance 495) {
      
showpoly(202, {0,0,screenwidth,0,screenwidth,screenheight,0,screenheight});
      
changeimgvis(202,4);
      
changeimgcolors(202,1,1,1,.1);
    }
  }
  
setTimer(0.1);

If I do something like set the players chat in the timeout loop or in onCreated() that will work, but nothing else seems to, I can't figure it out.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:39 AM.


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