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 11-29-2001, 01:09 PM
Hiker Hiker is offline
Registered User
Hiker's Avatar
Join Date: Nov 2001
Location: Darklands
Posts: 522
Hiker is on a distinguished road
Send a message via ICQ to Hiker Send a message via AIM to Hiker
Post Moving lights

How do u make lights move?
I mean like the lights in the underground cave when u go pearl diving. they seem to have a glow that moves in and out.
__________________
r0x th3 50x wi7h th3 1337 b34t
b3c4u53 h3 c4n!
Reply With Quote
  #2  
Old 11-29-2001, 04:06 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Here is one...

kinda cheap:
NPC Code:

if (created) {
setimg light2.png;
dontblock;
}
if (playerenters) {
setcoloreffect 1,1,1,0.99;
drawaslight;
this.i=1;
this.goingup=1;
timeout=.05;
}
if (timeout) {
if (this.i<99&&this.goingup==1) this.i++;
if (this.i>1&&this.goingup==0) this.i--;
if (this.i==98) this.goingup=0;
if (this.i==1) this.goingup=1;
setcoloreffect 1,1,0,this.i%99/100;
setzoomeffect this.i%2;
timeout=.05;
}

__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #3  
Old 11-29-2001, 04:07 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
a kind of cool one...

NPC Code:

if (created) {
this.rgoingup=1;
this.bgoingup=1;
this.ggoingup=1;
this.goingup=1;
this.red=178;
this.blue=158;
this.green=12;
this.i=2;
this.r=7;
this.c=0;
this.a=3.14/2;
this.ox=x;
this.oy=y;
}
while(this.r>2) {
this.x=this.ox+cos(this.a)*this.r;
this.y=this.oy+sin(this.a)*this.r;

if (this.red<200&&this.rgoingup==1) this.red+=.85;
if (this.red>1&&this.rgoingup==0) this.red-=.85;
if (this.red==199) {this.rgoingup=0;setplayerprop #c,rd;}
if (this.red==1) {this.rgoingup=1;setplayerprop #c,ru;}

if (this.blue<200&&this.bgoingup==1) this.blue+=.75;
if (this.blue>1&&this.bgoingup==0) this.blue-=.75;
if (this.blue==199) {this.bgoingup=0;setplayerprop #c,bd;}
if (this.blue==1) {this.bgoingup=1;setplayerprop #c,bu;}

if (this.green<200&&this.ggoingup==1) this.green+=.67;
if (this.green>1&&this.ggoingup==0) this.green-=.67;
if (this.green==199) {this.ggoingup=0;setplayerprop #c,gd;}
if (this.green==1) {this.ggoingup=1;setplayerprop #c,gu;}

if (this.i<99&&this.goingup==1) this.i+=1;
if (this.i>1&&this.goingup==0) this.i-=1;
if (this.i==99) this.goingup=0;
if (this.i==1) this.goingup=1;

this.a+=.314;
showimg 201,light2.png,this.x,this.y;
changeimgcolors 201,int(this.red)/100,int(this.green)/100,int(this.blue)/100,(this.i%99)/100;
changeimgzoom 201,.75;
this.c=this.c+.01;
sleep .05;
}

__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #4  
Old 11-29-2001, 04:08 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
fun to play with...

NPC Code:

timereverywhere;
if (created) {
setarray lights,300;
for(this.i=0;this.i<301;this.i+=3 {
lights[this.i] = random(0,64);
lights[this.i+1] = random(0,64);
}
}
while (zero==0) {
for(this.i=0;this.i<300;this.i+=3 {
showimg this.i+200,light2.png,lights[this.i],lights[this.i+1];
changeimgcolors this.i+200,int(random(0,1.5)),int(random(0,1.5)),i nt(random(0,1.5)),random(.5,.99);
changeimgzoom this.i+200,random(.5,1.25);
this.random=random(0,2);
if (this.random>1) {
lights[this.i]+=random(0,.5);
lights[this.i+1]--;
}
if (this.random<=1) {
lights[this.i]-=random(0,.5);
lights[this.i+1]++;
}
if (lights[this.i+1]>=62) lights[this.i+1] = 2;
if (lights[this.i]>=62) lights[this.i] = 2;
if (lights[this.i+1]<=2) lights[this.i+1] = 62;
if (lights[this.i]<=2) lights[this.i] = 62;
}
this.i = 0;
sleep .05;
}

__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #5  
Old 11-29-2001, 05:18 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
those are really good
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:25 AM.


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