Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Online lights (https://forums.graalonline.com/forums/showthread.php?t=74055)

Googi 05-19-2007 04:41 AM

Online lights
 
I have a light effect. The entire script is run clientside. It works offline but not online (even though the entire script is clientside.) Why is this?

DustyPorViva 05-19-2007 04:48 AM

What's the script?

Googi 05-19-2007 06:39 AM

Quote:

Originally Posted by DustyPorViva (Post 1309381)
What's the script?

We're allowed to post complete scripts now?

killerogue 05-19-2007 06:54 AM

Lol, yeah Googie.

Deadly_Killer 05-19-2007 08:00 AM

Quote:

Originally Posted by killerogue (Post 1309415)
Googie.

Undefined user.

Googi 05-19-2007 08:03 AM

PHP Code:

//#CLIENTSIDE
if (playerenters||timeout) {
  
this.max=90;
  
setarray this.x,this.max;
  
setarray this.y,this.max;
  
setarray this.movex,this.max;
  
setarray this.movey,this.max;
  
setarray this.active,this.max;
  
setarray this.speed,this.max;
  
setarray this.zoom,this.max;
  
setarray this.color1,this.max;
  
setarray this.color2,this.max;
  
setarray this.color3,this.max;
  for (
this.i=0;this.i<this.max;this.i++) {
    if (
this.active[this.i]=false) {
      
this.movex[this.i]=cos(this.angle);
      
this.movey[this.i]=sin(this.angle);
      
this.x[this.i]=x;
      
this.y[this.i]=y;
      
this.zoom[this.i]=random(.1,1.3);
      
this.color1[this.i]=random(0,1);
      
this.color2[this.i]=random(0,1);
      
this.color3[this.i]=random(0,1);
      
this.speed[this.i]=random(.3,1);
      
this.angle+=random(1,10);
      
this.active[this.i]=true;
    }
    else {
      if (
this.x[this.iin <-6,66> && this.y[this.iin <-6,66>) {
        
showimg this.i,light2.png,this.x[this.i],this.y[this.i];
        
changeimgzoom this.i,this.zoom[this.i];
        
changeimgcolors this.i,this.color1[this.i],this.color2[this.i],this.color3[this.i],.99;
        
this.x[this.i]+=this.movex[this.i]*this.speed[this.i];
        
this.y[this.i]+=this.movey[this.i]*this.speed[this.i];
      }
      else {
        
this.active[this.i]=false;
      }
    }
  }
  if (
this.angle>1000) {
    
this.angle=0;
  }
  
timeout=0.05;



Chompy 05-19-2007 01:29 PM

What's the layer (changeimgvis()) for the light effects?
They would work if they were 4 or higher, since the x and y is setted to 90..

tried an other max value?

And, it might be that you are uploading it on a gs2 enabled server and some stuff might not work as it should do as it did offline/on a gs1 server

Admins 05-19-2007 01:33 PM

Rename this.x and this.y (e.g. to this.lightx and this.lighty), eventually also this.zoom and this.angle

Gambet 05-19-2007 03:23 PM

Quote:

Originally Posted by Stefan (Post 1309444)
Rename this.x and this.y (e.g. to this.lightx and this.lighty), eventually also this.zoom and this.angle



Correct.


Such variables are predefined by the engine.


All times are GMT +2. The time now is 08:35 PM.

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