Thread: Clientside Lag
View Single Post
  #1  
Old 03-13-2013, 06:57 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Clientside Lag

I sometimes die because of lag coming from monsters and spells in dungeons. (Yes, I have an old computer!!)

I noticed some of the spells are still not using particles?

For Example: g2k2spellcharge_ice.gani
PHP Code:
if (playerenters){
  
this.proj_multi 3;
  
this.proj_dither 10;
  
this.proj_angle 0;
  
this.proj_rotary 15;
  
this.proj_radius 1;
  
this.proj_red 0.2;
  
this.proj_green 0.2;
  
this.proj_blue 1;
  
this.proj_alpha 0.9;
  
this.proj_zoom 0.35;
  
setarray this.proj_x,this.proj_dither*this.proj_multi;
  
setarray this.proj_y,this.proj_dither*this.proj_multi;
  
setarray this.proj_z,this.proj_dither*this.proj_multi;
  
setarray this.proj_fade,this.proj_dither*this.proj_multi;
  for (
this.proj_setup 0;this.proj_setup this.proj_dither*this.proj_multi;this.proj_setup ++){
    
this.proj_fade[this.proj_setup] = int(this.proj_setup/this.proj_multi);
  }
  
this.proj_switch 0;

  for (
this.earth_charge 0;this.earth_charge 22this.earth_charge ++){
    if (
this.earth_charge 13){
      
this.proj_radius + (12 this.earth_charge)*9/12;
    }
    if (
this.earth_charge >= 13) {
      
this.proj_alpha = (22 this.earth_charge)/9;
    }
    if (
this.earth_charge 15){
      
this.proj_rotary -=1;
    }
    for (
this.proj_edit 0;this.proj_edit this.proj_multi;this.proj_edit ++){
      
showimg2 200 this.proj_edit,g2k2spell_projectile_blue.png,playerx 1*vecx(playerdir) + sin((this.proj_angle 360/this.proj_multi*this.proj_edit)/180*3.141592654)*this.proj_radius,playery 1.5 cos((this.proj_angle 360/this.proj_multi*this.proj_edit)/180*3.141592654)*this.proj_radius,playerz;
      if (
playerdir 0){
        
changeimgvis 200 this.proj_edit,0;
      }
      else {
        
changeimgvis 200 this.proj_edit,2;
      }
      
this.proj_fade[this.proj_switch] = this.proj_dither;
      
this.proj_x[this.proj_switch] = playerx 1.5 1*vecx(playerdir) + sin((this.proj_angle 360/this.proj_multi*this.proj_edit)/180*3.141592654)*this.proj_radius;
      
this.proj_y[this.proj_switch] = playery cos((this.proj_angle 360/this.proj_multi*this.proj_edit)/180*3.141592654)*this.proj_radius;
      
this.proj_z[this.proj_switch] = playerz;
      
this.proj_switch ++;
      if (
this.proj_switch >= this.proj_dither*this.proj_multi){
        
this.proj_switch 0;
      }
    }
    for (
this.proj_draw 0;this.proj_draw this.proj_dither*this.proj_multi;this.proj_draw ++){
      if (
lighteffectsenabled && this.proj_fade[this.proj_draw] > 0){
        
showimg2 200 this.proj_multi this.proj_draw,light4.png,this.proj_x[this.proj_draw] - 4,this.proj_y[this.proj_draw] - 4,this.proj_z[this.proj_draw];
        
changeimgvis 200 this.proj_multi this.proj_draw,3;
        
changeimgcolors 200 this.proj_multi this.proj_draw,this.proj_red,this.proj_green,this.proj_blue,this.proj_alpha/this.proj_dither*this.proj_fade[this.proj_draw];
        
changeimgzoom 200 this.proj_multi this.proj_draw,this.proj_zoom/this.proj_dither*this.proj_fade[this.proj_draw];
        
this.proj_fade[this.proj_draw] --;
      }
    }
    
this.proj_angle += this.proj_rotary;
    
sleep 0.05;
  }
  for (
this.proj_remove 0;this.proj_remove < (this.proj_dither 1)*this.proj_multi;this.proj_remove ++){
    
hideimg 200 this.proj_remove;
  }

Can be changed in to something like this
PHP Code:
//#CLIENTSIDE
function onPlayerEnters() {
  
with (findimg(200)) {
    
with (emitter) {
      
delaymin 0.5;
      
delaymax 1.5;
      
nrofparticles 1;
      
emitautomatically true;
      
firstinfront true;
      
emissionoffset = {0,0,0};
      
attachtoowner true;

      
continueafterdestroy true
      maxparticles 
1;

      
with (particle) {
        
image "g2k2spell_projectile_blue.png";
        
zoom 1;
        
red 1;
        
green 1;
        
blue 1;
        
alpha 1;
        
lifetime 5;
        
spin degtorad(100);
        
layer 2;
      }

      
addlocalmodifier("range"02"zoom""replace"010); // Zoom
      
addlocalmodifier("range"0.255"alpha""replace"0.990); // Fade Out
    
}
  }

__________________
Reply With Quote