Graal Forums

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

TheFox1 07-31-2001 09:35 PM

NPC person...
 
I wanna know a script to make a NPC squirrel to run around

KJS 07-31-2001 09:39 PM

ok...
 
ok well this has no onwall detections (it wouldn't be hard to add)
I just made this off the top of my head and didn't feel like adding onwall lol...

this is the basic stuff
NPC Code:
if(created){
//ani junk
timeout=0.05;
}
if(timeout){
this.rnd=int(random(0,4))
if(this.rnd==0) y--;
elseif(this.rnd==1) x--;
elseif(this.rnd==2) y++;
elseif(this.rnd==3) x++;
}


ZORG1986 07-31-2001 10:26 PM

Yeah but that one doesny change the direction of the squirrel gif, we need to know the GFX names, or just show us the files themselfs. Besides u should make badgers run around badgers are much better than squirrels.

BIG MEATY BADGERS!
FULL OF MEATY GOODNESS!

KJS 07-31-2001 10:27 PM

well you could use
showcharacter

and use a gani that bases off the direction of the character...

but hten you have to set the dir also in the if then statments

TheFox1 07-31-2001 10:33 PM

1 Attachment(s)
....
i want to get the fullscript so i can make the little guy run around..

KJS 07-31-2001 11:00 PM

I dont think anyone wants to make full scripts here...

basically most people will help you but they dont want to make the whole script that is not what we are here for..

TheFox1 07-31-2001 11:25 PM

Quote:

Originally posted by KJS
I dont think anyone wants to make full scripts here...

basically most people will help you but they dont want to make the whole script that is not what we are here for..


:( I suck at NPC's

Merlin 08-01-2001 01:29 AM

FLUFFY.

Shard_IceFire 08-01-2001 02:40 AM

Quote:

TheFox1 quote:
I suck at NPC's
Point being...? Y'know it'd be better to go out there and learn to script instead of begging us for long scripts that no one really feels like doing...




08-01-2001 03:24 AM

I'll make it... I already started i probly only need a half houre to a houre more.

TrueHeaT 08-01-2001 03:31 AM

Quote:

Originally posted by TheFox1
....
i want to get the fullscript so i can make the little guy run around..

Erm, that's the squirrel from Zelda, it's copywritten. Make your own.

08-01-2001 03:39 AM

Quote:

Originally posted by TrueHeaT

it's copywritten. Make your own.

yep, i noticed that. So now I am not so sure if i want to script it for him now.

TheFox1 08-01-2001 04:29 AM

Quote:

Originally posted by TrueHeaT


Erm, that's the squirrel from Zelda, it's copywritten. Make your own.

I found it in my Graal folder... in Webgif's....

Merlin 08-01-2001 04:44 AM

i bet it's from deleteria.

08-01-2001 08:13 AM

Quote:

Originally posted by Merlin
i bet it's from deleteria.
dont be stupid now...

08-01-2001 08:14 AM

NPC Code:

timereverywhere;
if (created){
// Sets a few values
// this.csquirrelalive=1 means the squirrel is "alive" and free to move
// this.csquirrelalive=0 means it's dead
// this.csquirrelspeed the squirrel's speed (*this.cincreasespeed when running from player)
// this.ccloseness is how close the player gets before the player runs
this.csquirrelalive=1;
this.ncurdist=64;
this.csquirrelspeed=.6;
this.ccloseness=10;
this.cincreasespeed=1.5;
setgifpart squirrel.gif,0,0,22,23;
timeout=.05;
hearts=1;
}
if (timeout){
if (this.csquirrelalive==1){
// Basic tile check is below.
iputx = int(x/2)*2;
iputy = int(y/2)*2;
for (i=0; i<2; i++) for (j=0; j<2; j++) {
ib = board[iputx+i+64*(iputy+j)];
ibx = ib % 16;
iby = int(ib / 16);
}
// Checks to see of all the players on, which is closest.
this.ncurdist=64;
for (ipindex=0;ipindex<playerscount;ipindex++){
if (players[ipindex].id>=0){
this.nnewdist=((players[ipindex].x-x)^2+(players[ipindex].y-y)^2)^.5;
// If the newly tested distance is less than the old distance, then make it the current distance
if (this.nnewdist<=this.ncurdist){
this.ncurdist=this.nnewdist;
this.iplayer=ipindex;
}
}
}
// Tells what to do when the closest player is less than 10 spaces away
if (this.iplayer==0){
if (this.ncurdist<=this.ccloseness){
// When this.count reaches 5 it does the following to determine which random direction the squirrel will run.
if (this.icount>=5){
this.icount=0;
this.nxdist=abs(players[this.player].x-x);
this.nydist=abs(players[this.player].y-y);
// Based on the x and y distance from the player, only 3 directions may be selected.
if (this.nxdist>this.nydist){
if (players[this.iplayer].x<x){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=0;
if (this.itemp==2) this.cdir=2;
if (this.itemp==3) this.cdir=3;
}
if (players[this.iplayer].x>x){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=0;
if (this.itemp==2) this.cdir=1;
if (this.itemp==3) this.cdir=2;
}
}
if (this.nxdist<this.nydist){
if (players[this.iplayer].y<y){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=1;
if (this.itemp==2) this.cdir=2;
if (this.itemp==3) this.cdir=3;
}
if (players[this.iplayer].y>y){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=0;
if (this.itemp==2) this.cdir=1;
if (this.itemp==3) this.cdir=3;
}
}
}
this.icount++;
// Different things to do if the squirrel is under bramble.
if ((ibx==5&&iby==48)||(ibx==5&&iby==49)||(ibx==6&&ib y==48)||(ibx==6&&iby==49)){
setgifpart squirrel.gif,94,0,32,14;
if (this.cdir==0&&!onwall(x,y-(this.csquirrelspeed*this.cincreasespeed))&&!onwat er(x,y-(this.csquirrelspeed*this.cincreasespeed))) y-=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==1&&!onwall(x-(this.csquirrelspeed*this.cincreasespeed),y)&&!onw ater(x-(this.csquirrelspeed*this.cincreasespeed),y)) x-=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==2&&!onwall(x,y+(this.csquirrelspeed*th is.cincreasespeed))&&!onwater(x,y+(this.csquirrels peed*this.cincreasespeed))) y+=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==3&&!onwall(x+(this.csquirrelspeed*this .cincreasespeed),y)&&!onwater(x+(this.csquirrelspe ed*this.cincreasespeed),y)) x+=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
sleep .05;
setgifpart squirrel.gif,94,29,32,16;
}else{
// Tells where to move, and what image to show based on direction.
if (this.cdir==0){
setgifpart squirrel.gif,72,27,22,19;
if (!onwall(x,y-(this.csquirrelspeed*this.cincreasespeed))&&!onwat er(x,y-(this.csquirrelspeed*this.cincreasespeed))){
y-=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,72,0,22,23;
}
if (this.cdir==1){
setgifpart squirrel.gif,22,23,25,23;
if (!onwall(x-(this.csquirrelspeed*this.cincreasespeed),y)&&!onw ater(x-(this.csquirrelspeed*this.cincreasespeed),y)){
x-=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,21,0,24,23;
}
if (this.cdir==2){
setgifpart squirrel.gif,0,24,22,22;
if (!onwall(x,y+(this.csquirrelspeed*this.cincreasesp eed)+1)&&!onwater(x,y+(this.csquirrelspeed*this.ci ncreasespeed)+1)){
y+=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,0,0,22,23;
}
if (this.cdir==3){
setgifpart squirrel.gif,47,23,25,23;
if (!onwall(x+(this.csquirrelspeed*this.cincreasespee d)+1,y)&&!onwater(x+(this.csquirrelspeed*this.cinc reasespeed)+1,y)){
x+=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,47,0,24,23;
}
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
}
}else{
// What to do when the player is farther than 10 spaces.
this.icount=10;
// Sets the squirrel's "mode" every .5 seconds (1=moving)
if (this.icount2==5){
this.imode=(int(random(1,3)));
this.cdir=(int(random(0,4)));
this.icount2=0;
}
// When the squirrel is supposed to move, here's what to do.
if (this.imode==1){
// What to do when the squirrel is under bramble.
if ((ibx==5&&iby==48)||(ibx==5&&iby==49)||(ibx==6&&ib y==48)||(ibx==6&&iby==49)){
setgifpart squirrel.gif,94,0,32,14;
if (this.cdir==0&&!onwall(x,y-this.csquirrelspeed)&&!onwater(x,y-this.csquirrelspeed)) y-=this.csquirrelspeed;
if (this.cdir==1&&!onwall(x-this.csquirrelspeed,y)&&!onwater(x-this.csquirrelspeed,y)) x-=this.csquirrelspeed;
if (this.cdir==2&&!onwall(x,y+this.csquirrelspeed)&&! onwater(x,y+this.csquirrelspeed)) y+=this.csquirrelspeed;
if (this.cdir==3&&!onwall(x+this.csquirrelspeed,y)&&! onwater(x+this.csquirrelspeed,y)) x+=this.csquirrelspeed;
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
sleep .05;
setgifpart squirrel.gif,94,29,32,16;
}else{
// Tells where to move, and what image to show based on direction.
if (this.cdir==0){
setgifpart squirrel.gif,72,27,22,19;
if (!onwall(x,y-this.csquirrelspeed)&&!onwater(x,y-this.csquirrelspeed)){
y-=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,72,0,22,23;
}
if (this.cdir==1){
setgifpart squirrel.gif,22,23,25,23;
if (!onwall(x-this.csquirrelspeed,y)&&!onwater(x-this.csquirrelspeed,y)){
x-=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,21,0,24,23;
}
if (this.cdir==2){
setgifpart squirrel.gif,0,24,22,22;
if (!onwall(x,y+this.csquirrelspeed+1)&&!onwater(x,y+ this.csquirrelspeed+1)){
y+=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,0,0,22,23;
}
if (this.cdir==3){
setgifpart squirrel.gif,47,23,25,23;
if (!onwall(x+this.csquirrelpeed+1,y)&&!onwater(x+thi s.csquirrelspeed+1,y)){
x+=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,47,0,24,23;
}
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
}
}
this.icount2++;
}
}
}
timeout=.05;
}
// How to kill the squirrel.
if (washit || wasshot || waspelt){
hearts--;
setgifpart squirrel.gif,130,0,27,21;
timeout=.05;
this.csquirrelalive=0;
timeout=.10;
this.csquirrelalive=1;
}


SkooL 08-01-2001 08:39 AM

*blinks* You ripped that from the New World bunnies. You didn't even take the time to change the setgifparts to fit this guys squirrel.gif image correctly...
Quote:

Originally posted by IcePick_2001
NPC Code:

timereverywhere;
if (created){
// Sets a few values
// this.csquirrelalive=1 means the squirrel is "alive" and free to move
// this.csquirrelalive=0 means it's dead
// this.csquirrelspeed the squirrel's speed (*this.cincreasespeed when running from player)
// this.ccloseness is how close the player gets before the player runs
this.csquirrelalive=1;
this.ncurdist=64;
this.csquirrelspeed=.6;
this.ccloseness=10;
this.cincreasespeed=1.5;
setgifpart squirrel.gif,0,0,22,23;
timeout=.05;
hearts=1;
}
if (timeout){
if (this.csquirrelalive==1){
// Basic tile check is below.
iputx = int(x/2)*2;
iputy = int(y/2)*2;
for (i=0; i<2; i++) for (j=0; j<2; j++) {
ib = board[iputx+i+64*(iputy+j)];
ibx = ib % 16;
iby = int(ib / 16);
}
// Checks to see of all the players on, which is closest.
this.ncurdist=64;
for (ipindex=0;ipindex<playerscount;ipindex++){
if (players[ipindex].id>=0){
this.nnewdist=((players[ipindex].x-x)^2+(players[ipindex].y-y)^2)^.5;
// If the newly tested distance is less than the old distance, then make it the current distance
if (this.nnewdist<=this.ncurdist){
this.ncurdist=this.nnewdist;
this.iplayer=ipindex;
}
}
}
// Tells what to do when the closest player is less than 10 spaces away
if (this.iplayer==0){
if (this.ncurdist<=this.ccloseness){
// When this.count reaches 5 it does the following to determine which random direction the squirrel will run.
if (this.icount>=5){
this.icount=0;
this.nxdist=abs(players[this.player].x-x);
this.nydist=abs(players[this.player].y-y);
// Based on the x and y distance from the player, only 3 directions may be selected.
if (this.nxdist>this.nydist){
if (players[this.iplayer].x<x){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=0;
if (this.itemp==2) this.cdir=2;
if (this.itemp==3) this.cdir=3;
}
if (players[this.iplayer].x>x){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=0;
if (this.itemp==2) this.cdir=1;
if (this.itemp==3) this.cdir=2;
}
}
if (this.nxdist<this.nydist){
if (players[this.iplayer].y<y){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=1;
if (this.itemp==2) this.cdir=2;
if (this.itemp==3) this.cdir=3;
}
if (players[this.iplayer].y>y){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=0;
if (this.itemp==2) this.cdir=1;
if (this.itemp==3) this.cdir=3;
}
}
}
this.icount++;
// Different things to do if the squirrel is under bramble.
if ((ibx==5&&iby==48)||(ibx==5&&iby==49)||(ibx==6&&ib y==48)||(ibx==6&&iby==49)){
setgifpart squirrel.gif,94,0,32,14;
if (this.cdir==0&&!onwall(x,y-(this.csquirrelspeed*this.cincreasespeed))&&!onwat er(x,y-(this.csquirrelspeed*this.cincreasespeed))) y-=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==1&&!onwall(x-(this.csquirrelspeed*this.cincreasespeed),y)&&!onw ater(x-(this.csquirrelspeed*this.cincreasespeed),y)) x-=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==2&&!onwall(x,y+(this.csquirrelspeed*th is.cincreasespeed))&&!onwater(x,y+(this.csquirrels peed*this.cincreasespeed))) y+=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==3&&!onwall(x+(this.csquirrelspeed*this .cincreasespeed),y)&&!onwater(x+(this.csquirrelspe ed*this.cincreasespeed),y)) x+=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
sleep .05;
setgifpart squirrel.gif,94,29,32,16;
}else{
// Tells where to move, and what image to show based on direction.
if (this.cdir==0){
setgifpart squirrel.gif,72,27,22,19;
if (!onwall(x,y-(this.csquirrelspeed*this.cincreasespeed))&&!onwat er(x,y-(this.csquirrelspeed*this.cincreasespeed))){
y-=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,72,0,22,23;
}
if (this.cdir==1){
setgifpart squirrel.gif,22,23,25,23;
if (!onwall(x-(this.csquirrelspeed*this.cincreasespeed),y)&&!onw ater(x-(this.csquirrelspeed*this.cincreasespeed),y)){
x-=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,21,0,24,23;
}
if (this.cdir==2){
setgifpart squirrel.gif,0,24,22,22;
if (!onwall(x,y+(this.csquirrelspeed*this.cincreasesp eed)+1)&&!onwater(x,y+(this.csquirrelspeed*this.ci ncreasespeed)+1)){
y+=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,0,0,22,23;
}
if (this.cdir==3){
setgifpart squirrel.gif,47,23,25,23;
if (!onwall(x+(this.csquirrelspeed*this.cincreasespee d)+1,y)&&!onwater(x+(this.csquirrelspeed*this.cinc reasespeed)+1,y)){
x+=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,47,0,24,23;
}
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
}
}else{
// What to do when the player is farther than 10 spaces.
this.icount=10;
// Sets the squirrel's "mode" every .5 seconds (1=moving)
if (this.icount2==5){
this.imode=(int(random(1,3)));
this.cdir=(int(random(0,4)));
this.icount2=0;
}
// When the squirrel is supposed to move, here's what to do.
if (this.imode==1){
// What to do when the squirrel is under bramble.
if ((ibx==5&&iby==48)||(ibx==5&&iby==49)||(ibx==6&&ib y==48)||(ibx==6&&iby==49)){
setgifpart squirrel.gif,94,0,32,14;
if (this.cdir==0&&!onwall(x,y-this.csquirrelspeed)&&!onwater(x,y-this.csquirrelspeed)) y-=this.csquirrelspeed;
if (this.cdir==1&&!onwall(x-this.csquirrelspeed,y)&&!onwater(x-this.csquirrelspeed,y)) x-=this.csquirrelspeed;
if (this.cdir==2&&!onwall(x,y+this.csquirrelspeed)&&! onwater(x,y+this.csquirrelspeed)) y+=this.csquirrelspeed;
if (this.cdir==3&&!onwall(x+this.csquirrelspeed,y)&&! onwater(x+this.csquirrelspeed,y)) x+=this.csquirrelspeed;
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
sleep .05;
setgifpart squirrel.gif,94,29,32,16;
}else{
// Tells where to move, and what image to show based on direction.
if (this.cdir==0){
setgifpart squirrel.gif,72,27,22,19;
if (!onwall(x,y-this.csquirrelspeed)&&!onwater(x,y-this.csquirrelspeed)){
y-=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,72,0,22,23;
}
if (this.cdir==1){
setgifpart squirrel.gif,22,23,25,23;
if (!onwall(x-this.csquirrelspeed,y)&&!onwater(x-this.csquirrelspeed,y)){
x-=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,21,0,24,23;
}
if (this.cdir==2){
setgifpart squirrel.gif,0,24,22,22;
if (!onwall(x,y+this.csquirrelspeed+1)&&!onwater(x,y+ this.csquirrelspeed+1)){
y+=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,0,0,22,23;
}
if (this.cdir==3){
setgifpart squirrel.gif,47,23,25,23;
if (!onwall(x+this.csquirrelpeed+1,y)&&!onwater(x+thi s.csquirrelspeed+1,y)){
x+=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,47,0,24,23;
}
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
}
}
this.icount2++;
}
}
}
timeout=.05;
}
// How to kill the squirrel.
if (washit || wasshot || waspelt){
hearts--;
setgifpart squirrel.gif,130,0,27,21;
timeout=.05;
this.csquirrelalive=0;
timeout=.10;
this.csquirrelalive=1;
}



LiquidIce00 08-01-2001 09:21 AM

LOL Icepick should be banned cuz releasing New World stuff is illegal.

TrueHeaT 08-01-2001 09:28 AM

Quote:

Originally posted by IcePick_2001
NPC Code:

timereverywhere;
if (created){
// Sets a few values
// this.csquirrelalive=1 means the squirrel is "alive" and free to move
// this.csquirrelalive=0 means it's dead
// this.csquirrelspeed the squirrel's speed (*this.cincreasespeed when running from player)
// this.ccloseness is how close the player gets before the player runs
this.csquirrelalive=1;
this.ncurdist=64;
this.csquirrelspeed=.6;
this.ccloseness=10;
this.cincreasespeed=1.5;
setgifpart squirrel.gif,0,0,22,23;
timeout=.05;
hearts=1;
}
if (timeout){
if (this.csquirrelalive==1){
// Basic tile check is below.
iputx = int(x/2)*2;
iputy = int(y/2)*2;
for (i=0; i<2; i++) for (j=0; j<2; j++) {
ib = board[iputx+i+64*(iputy+j)];
ibx = ib % 16;
iby = int(ib / 16);
}
// Checks to see of all the players on, which is closest.
this.ncurdist=64;
for (ipindex=0;ipindex<playerscount;ipindex++){
if (players[ipindex].id>=0){
this.nnewdist=((players[ipindex].x-x)^2+(players[ipindex].y-y)^2)^.5;
// If the newly tested distance is less than the old distance, then make it the current distance
if (this.nnewdist<=this.ncurdist){
this.ncurdist=this.nnewdist;
this.iplayer=ipindex;
}
}
}
// Tells what to do when the closest player is less than 10 spaces away
if (this.iplayer==0){
if (this.ncurdist<=this.ccloseness){
// When this.count reaches 5 it does the following to determine which random direction the squirrel will run.
if (this.icount>=5){
this.icount=0;
this.nxdist=abs(players[this.player].x-x);
this.nydist=abs(players[this.player].y-y);
// Based on the x and y distance from the player, only 3 directions may be selected.
if (this.nxdist>this.nydist){
if (players[this.iplayer].x<x){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=0;
if (this.itemp==2) this.cdir=2;
if (this.itemp==3) this.cdir=3;
}
if (players[this.iplayer].x>x){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=0;
if (this.itemp==2) this.cdir=1;
if (this.itemp==3) this.cdir=2;
}
}
if (this.nxdist<this.nydist){
if (players[this.iplayer].y<y){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=1;
if (this.itemp==2) this.cdir=2;
if (this.itemp==3) this.cdir=3;
}
if (players[this.iplayer].y>y){
this.itemp=(int(random(1,4)));
if (this.itemp==1) this.cdir=0;
if (this.itemp==2) this.cdir=1;
if (this.itemp==3) this.cdir=3;
}
}
}
this.icount++;
// Different things to do if the squirrel is under bramble.
if ((ibx==5&&iby==48)||(ibx==5&&iby==49)||(ibx==6&&ib y==48)||(ibx==6&&iby==49)){
setgifpart squirrel.gif,94,0,32,14;
if (this.cdir==0&&!onwall(x,y-(this.csquirrelspeed*this.cincreasespeed))&&!onwat er(x,y-(this.csquirrelspeed*this.cincreasespeed))) y-=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==1&&!onwall(x-(this.csquirrelspeed*this.cincreasespeed),y)&&!onw ater(x-(this.csquirrelspeed*this.cincreasespeed),y)) x-=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==2&&!onwall(x,y+(this.csquirrelspeed*th is.cincreasespeed))&&!onwater(x,y+(this.csquirrels peed*this.cincreasespeed))) y+=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==3&&!onwall(x+(this.csquirrelspeed*this .cincreasespeed),y)&&!onwater(x+(this.csquirrelspe ed*this.cincreasespeed),y)) x+=this.csquirrelspeed*this.cincreasespeed;
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
sleep .05;
setgifpart squirrel.gif,94,29,32,16;
}else{
// Tells where to move, and what image to show based on direction.
if (this.cdir==0){
setgifpart squirrel.gif,72,27,22,19;
if (!onwall(x,y-(this.csquirrelspeed*this.cincreasespeed))&&!onwat er(x,y-(this.csquirrelspeed*this.cincreasespeed))){
y-=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,72,0,22,23;
}
if (this.cdir==1){
setgifpart squirrel.gif,22,23,25,23;
if (!onwall(x-(this.csquirrelspeed*this.cincreasespeed),y)&&!onw ater(x-(this.csquirrelspeed*this.cincreasespeed),y)){
x-=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,21,0,24,23;
}
if (this.cdir==2){
setgifpart squirrel.gif,0,24,22,22;
if (!onwall(x,y+(this.csquirrelspeed*this.cincreasesp eed)+1)&&!onwater(x,y+(this.csquirrelspeed*this.ci ncreasespeed)+1)){
y+=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,0,0,22,23;
}
if (this.cdir==3){
setgifpart squirrel.gif,47,23,25,23;
if (!onwall(x+(this.csquirrelspeed*this.cincreasespee d)+1,y)&&!onwater(x+(this.csquirrelspeed*this.cinc reasespeed)+1,y)){
x+=this.csquirrelspeed*this.cincreasespeed;
} else {
this.icount=10;
}
sleep .05;
setgifpart squirrel.gif,47,0,24,23;
}
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
}
}else{
// What to do when the player is farther than 10 spaces.
this.icount=10;
// Sets the squirrel's "mode" every .5 seconds (1=moving)
if (this.icount2==5){
this.imode=(int(random(1,3)));
this.cdir=(int(random(0,4)));
this.icount2=0;
}
// When the squirrel is supposed to move, here's what to do.
if (this.imode==1){
// What to do when the squirrel is under bramble.
if ((ibx==5&&iby==48)||(ibx==5&&iby==49)||(ibx==6&&ib y==48)||(ibx==6&&iby==49)){
setgifpart squirrel.gif,94,0,32,14;
if (this.cdir==0&&!onwall(x,y-this.csquirrelspeed)&&!onwater(x,y-this.csquirrelspeed)) y-=this.csquirrelspeed;
if (this.cdir==1&&!onwall(x-this.csquirrelspeed,y)&&!onwater(x-this.csquirrelspeed,y)) x-=this.csquirrelspeed;
if (this.cdir==2&&!onwall(x,y+this.csquirrelspeed)&&! onwater(x,y+this.csquirrelspeed)) y+=this.csquirrelspeed;
if (this.cdir==3&&!onwall(x+this.csquirrelspeed,y)&&! onwater(x+this.csquirrelspeed,y)) x+=this.csquirrelspeed;
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
sleep .05;
setgifpart squirrel.gif,94,29,32,16;
}else{
// Tells where to move, and what image to show based on direction.
if (this.cdir==0){
setgifpart squirrel.gif,72,27,22,19;
if (!onwall(x,y-this.csquirrelspeed)&&!onwater(x,y-this.csquirrelspeed)){
y-=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,72,0,22,23;
}
if (this.cdir==1){
setgifpart squirrel.gif,22,23,25,23;
if (!onwall(x-this.csquirrelspeed,y)&&!onwater(x-this.csquirrelspeed,y)){
x-=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,21,0,24,23;
}
if (this.cdir==2){
setgifpart squirrel.gif,0,24,22,22;
if (!onwall(x,y+this.csquirrelspeed+1)&&!onwater(x,y+ this.csquirrelspeed+1)){
y+=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,0,0,22,23;
}
if (this.cdir==3){
setgifpart squirrel.gif,47,23,25,23;
if (!onwall(x+this.csquirrelpeed+1,y)&&!onwater(x+thi s.csquirrelspeed+1,y)){
x+=this.csquirrelspeed;
}else{
this.cdir=(int(random(0,4)));
}
sleep .05;
setgifpart squirrel.gif,47,0,24,23;
}
if (this.cdir==0&&y-5<=5) this.cdir=2;
if (this.cdir==1&&x-5<=5) this.cdir=3;
if (this.cdir==2&&y+5>=59) this.cdir=0;
if (this.cdir==3&&x+5>=59) this.cdir=1;
}
}
this.icount2++;
}
}
}
timeout=.05;
}
// How to kill the squirrel.
if (washit || wasshot || waspelt){
hearts--;
setgifpart squirrel.gif,130,0,27,21;
timeout=.05;
this.csquirrelalive=0;
timeout=.10;
this.csquirrelalive=1;
}


you're pathetic..

08-01-2001 09:56 AM

umm no... my friend helped me out with this script and thats what he did..

kyle0654 08-01-2001 10:01 AM

did you just run that through a text replacer and overwrite rabbit with squirrel?!?! I'm looking at the old New World rabbit script right now and they're EXACTLY the same...down to variable names and formatting.

08-01-2001 10:01 AM

I am sorry all, I didnt know that was a newworld script...

kyle0654 08-01-2001 10:02 AM

and I'm supposed to believe you why?

Falcor 08-01-2001 10:12 AM

You didnt know that you copied a script. I believe you :rolleyes:

And the Squirl is in Webgifs if you were on Damasca. Since there whole tielset / theme was based on Zelda. (I guess thats one of the reasons it was taken down)


All times are GMT +2. The time now is 06:37 PM.

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