View Single Post
  #1  
Old 03-12-2002, 07:28 AM
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
Talking Some Optimization for You All...

Talk about optimization:
This is a beginning. ;)
NPC Code:

// I could really care less if anyone uses this, because it will be 2 player in about a week.
if (created || initialized) {
disabledefmovement;
this.vars = {1,1,int(random(0,360)),32,32,this.vars[3]-5,this.vars[4]-5,this.vars[3]-10,this.vars[4]-10,this.vars[5],this.vars[6],.75,.5,this.vars[3],this.vars[6],0};
setarray this.keys,11;
timeout=.05;
}
if (timeout) {
for (i=0;i<11;i++;) this.keys[i] = (keydown(i) ? 1 : 0);
this.ix = (cos(this.vars[2]/57.3)*this.vars[11])-(cos(this.vars[2]/57.3));
this.iy = (sin(this.vars[2]/57.3)*this.vars[11])-(sin(this.vars[2]/57.3));
this.vars = {(this.vars[9]>=this.vars[3]&&this.vars[10] in |this.vars[14]-.75,this.vars[14]+.25| ? 0 : (this.vars[9]<=this.vars[7] ? 1 : this.vars[0])),(this.vars[10]>=this.vars[4] ? 0 : (this.vars[10]<=this.vars[8] ? 1 : this.vars[1])),this.vars[2],this.vars[3],this.vars[4],this.vars[5],this.vars[6],this.vars[7],this.vars[8],this.vars[9]+(this.vars[0]==1 ? abs(this.ix) : -abs(this.ix)),this.vars[10]+(this.vars[1]==1 ? abs(this.iy) : -abs(this.iy)),this.vars[11],this.vars[12],this.vars[13],this.vars[14]+(this.keys[2]==1&&this.vars[14]<this.vars[4] ? this.vars[12] : (this.keys[0]==1&&this.vars[14]>this.vars[8] ? -this.vars[12] : 0)),(this.vars[9]>this.vars[3]+.25&&!(this.vars[10] in |this.vars[14]-.75,this.vars[14]+.25|) ? 1 : 0),this.vars[16]+(this.vars[9]>=this.vars[3]&&this.vars[10] in |this.vars[14]-.75,this.vars[14]+.25| ? 1 : 0)};
if (this.vars[15]==1) say2 You Lost!;
showimg 1,@.,this.vars[9],this.vars[10];
showimg 2,@|,this.vars[13],this.vars[14]; changeimgzoom 2,.5;
showimg 3,@#v(this.vars[16]),25,100; changeimgvis 3,4; changeimgzoom 3,.5;
timeout=(this.vars[15]==0 ? .05 : 0);
}

__________________

!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