SHAOKEN!

i got this code here for the old Shaoken anyone got any clue what i need to do to get it to work? >:(

if (playertouchsme) {
playerdarts += 2 ;
this.step = 0;
toweapons Shaoken;
hide;
}
if (weaponfired && playerdarts>=2 && this.step<=0) {
hideimg 1;
hidesword 0.3;
this.steplen = 1.5;

timeout = 0.05;
this.step = 0;
this.oldx = playerx;
this.oldy = playery;
}
if (timeout) {
this.step++;
timeout = 0.05;
if (this.step<6) {
if (playerdir==0 || playerdir==2) playersprite = 13;
else playersprite = 6;
if (playerdir==0) showimg 1,wshuri.gif,playerx-0.7,playery+1.4;
if (playerdir==1) showimg 1,wshuri.gif,playerx+1.9,playery+1.5;
if (playerdir==2) showimg 1,wshuri.gif,playerx+2.3,playery+0.7;
if (playerdir==3) showimg 1,wshuri.gif,playerx-0.2,playery+1.5;
if (this.step==2) freezeplayer 0.2;
} else if (this.step==6) {
playersprite = 0;
this.mx = 0;
this.my = 0;
if (playerx>this.oldx) this.mx++;
if (playerx<this.oldx) this.mx–;
if (playery>this.oldy) this.my++;
if (playery<this.oldy) this.my–;
if (this.mx!=0 && this.my!=0) {
this.mx*=0.714;
this.my*=0.714;
}
if (this.mx==0 && this.my==0) {
if (playerdir==0) this.my–;
if (playerdir==1) this.mx–;
if (playerdir==2) this.my++;
if (playerdir==3) this.mx++;
}
this.flyx = playerx+0.5;
this.flyy = playery+1;
if (playerdir==0) this.flyx–;
if (playerdir==2) this.flyx++;
if (playerdarts<2) playerdarts=0;
else playerdarts -= 2;
} else {
this.oldx = this.flyx;
this.oldy = this.flyy;
this.flyx += this.mxthis.steplen;
this.flyy += this.my
this.steplen;
showimg 1,wshuri.gif,this.flyx,this.flyy;
if (onwall(this.flyx+0.3,this.flyy+0.3)) {
putleaps 4,this.oldx-0.7,this.oldy-0.7;
hideimg 1;
this.step = 0;
putnpc wshuri.gif,shaoken.txt,this.oldx,this.oldy;
timeout = 0;
} else
this.testhurt = 1;
}
}
if (playerenters) {
hideimg 1;
this.step = 0;
timeout = 0;
show;
}
if (this.testhurt == 1) {
for (i=0; i<compuscount; i++) {
if (abs(this.flyx-compus[i].x)<=1 &&
abs(this.flyy-(compus[i].y-0.5))<=1.5 &&
compus[i].mode!=3)
hitcompu i,1,this.flyx+0.5,this.flyy+0.5;
}
for (i=1; i<playerscount; i++) {
if (abs((this.flyx+0.7)-(players[i].x+1.5))<=1 &&
abs((this.flyy+0.5)-(players[i].y+1.5))<=1.5)
hitplayer i,1,this.flyx+0.5,this.flyy+0.5;
}
this.testhurt = 0;
}

Re: SHAOKEN!

Well straight off the bat I see two things:

You need the image wshuri.gif

and the file shaoken.txt (so that putnpc command will have something to call)

That should about do it, oh and make sure you have enough 'darts' to fire it ^^

Re: SHAOKEN!

Everyone should (based on what client they downloaded) in their levels\weapons\ folder.

shaoken.txt is what he posted I guess, so aslong as he keeps it also in a textfile in the same folder as the level.

Re: SHAOKEN!

I actually have a fixed version on my home computer.

Re: SHAOKEN!

I'm not really sure it's broken, just change all the instances of wshuri.gif to wshuri.png.

Though it doesn't have an animation well flying thru the air, only when it hits and when it's thrown.

if (playertouchsme) {
 playerdarts += 2 ;
 toweapons Shaoken;
 destroy;
}
if (weaponfired && playerdarts>=2 && this.step<=0) {
 hideimg 1;
 hidesword 0.3;
 this.steplen = 1.5;

 timeout = 0.05;
 this.step = 0;
 this.oldx = playerx;
 this.oldy = playery;
}
if (timeout) {
 this.step++;
 timeout = 0.05;
 if (this.step<6) {
  if (playerdir==0 || playerdir==2) playersprite = 13;
  else playersprite = 6;
  if (playerdir==0) showimg 1,wshuri.png,playerx-0.7,playery+1.4;
  if (playerdir==1) showimg 1,wshuri.png,playerx+1.9,playery+1.5;
  if (playerdir==2) showimg 1,wshuri.png,playerx+2.3,playery+0.7;
  if (playerdir==3) showimg 1,wshuri.png,playerx-0.2,playery+1.5;
  if (this.step==2) freezeplayer 0.2;
 } else if (this.step==6) {
  playersprite = 0;
  this.mx = 0;
  this.my = 0;
  if (playerx>this.oldx) this.mx++;
  if (playerx<this.oldx) this.mx--;
  if (playery>this.oldy) this.my++;
  if (playery<this.oldy) this.my--;
  if (this.mx!=0 && this.my!=0) {
   this.mx*=0.714;
   this.my*=0.714;
  }
  if (this.mx==0 && this.my==0) {
   if (playerdir==0) this.my--;
   if (playerdir==1) this.mx--;
   if (playerdir==2) this.my++;
   if (playerdir==3) this.mx++;
  }
  this.flyx = playerx+0.5;
  this.flyy = playery+1;
  if (playerdir==0) this.flyx--;
  if (playerdir==2) this.flyx++;
  if (playerdarts<2) playerdarts=0;
  else playerdarts -= 2;
 } else {
  this.oldx = this.flyx;
  this.oldy = this.flyy;
  this.flyx += this.mx*this.steplen;
  this.flyy += this.my*this.steplen;
  showimg 1,wshuri.gif,this.flyx,this.flyy;
  if (onwall(this.flyx+0.3,this.flyy+0.3)) {
   putleaps 4,this.oldx-0.7,this.oldy-0.7;
   hideimg 1;
   this.step = 0;
   putnpc wshuri.png,shaoken.txt,this.oldx,this.oldy;
   timeout = 0;
  } else
   this.testhurt = 1;
 }
}
if (playerenters) {
 hideimg 1;
 this.step = 0;
 timeout = 0;
}
if (this.testhurt == 1) {
 for (i=0; i<compuscount; i++) {
  if (abs(this.flyx-compus[i].x)<=1 &&
    abs(this.flyy-(compus[i].y-0.5))<=1.5 &&
    compus[i].mode!=3)
   hitcompu i,1,this.flyx+0.5,this.flyy+0.5;
 }
 for (i=1; i<playerscount; i++) {
  if (abs((this.flyx+0.7)-(players[i].x+1.5))<=1 &&
    abs((this.flyy+0.5)-(players[i].y+1.5))<=1.5)
   hitplayer i,1,this.flyx+0.5,this.flyy+0.5;
 }
 this.testhurt = 0;
}

note: make sure to update textfile also.