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 07-31-2001, 09:35 PM
TheFox1 TheFox1 is offline
Registered User
TheFox1's Avatar
Join Date: Mar 2001
Location: The Land Down Under
Posts: 696
TheFox1 is on a distinguished road
NPC person...

I wanna know a script to make a NPC squirrel to run around
__________________
Temporary Unbanned
Stefan Knorr
Reply With Quote
  #2  
Old 07-31-2001, 09:39 PM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
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++;
}

__________________
Thanks,
-KJL
Reply With Quote
  #3  
Old 07-31-2001, 10:26 PM
ZORG1986 ZORG1986 is offline
Registered User
ZORG1986's Avatar
Join Date: Jul 2001
Location: England - Yes thats the small Island in Europe that Ownz you all.
Posts: 783
ZORG1986 is on a distinguished road
Send a message via ICQ to ZORG1986 Send a message via AIM to ZORG1986
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!
__________________


Zorg (Era Staff) - Contact : [email protected]
Reply With Quote
  #4  
Old 07-31-2001, 10:27 PM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
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
__________________
Thanks,
-KJL
Reply With Quote
  #5  
Old 07-31-2001, 10:33 PM
TheFox1 TheFox1 is offline
Registered User
TheFox1's Avatar
Join Date: Mar 2001
Location: The Land Down Under
Posts: 696
TheFox1 is on a distinguished road
....
i want to get the fullscript so i can make the little guy run around..
Attached Images
 
__________________
Temporary Unbanned
Stefan Knorr
Reply With Quote
  #6  
Old 07-31-2001, 11:00 PM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to 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..
__________________
Thanks,
-KJL
Reply With Quote
  #7  
Old 07-31-2001, 11:25 PM
TheFox1 TheFox1 is offline
Registered User
TheFox1's Avatar
Join Date: Mar 2001
Location: The Land Down Under
Posts: 696
TheFox1 is on a distinguished road
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
__________________
Temporary Unbanned
Stefan Knorr
Reply With Quote
  #8  
Old 08-01-2001, 01:29 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
FLUFFY.
Reply With Quote
  #9  
Old 08-01-2001, 02:40 AM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
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...



__________________

-=Shard IceFire=-
Reply With Quote
  #10  
Old 08-01-2001, 03:24 AM
Guest
Posts: n/a
I'll make it... I already started i probly only need a half houre to a houre more.
Reply With Quote
  #11  
Old 08-01-2001, 03:31 AM
TrueHeaT TrueHeaT is offline
Zatoichi
Join Date: Jun 2001
Posts: 7,277
TrueHeaT is an unknown quantity at this point
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.
__________________

If anyone has any of my tilesets and graphics, please PM me as I would really love to have them.
Reply With Quote
  #12  
Old 08-01-2001, 03:39 AM
Guest
Posts: n/a
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.
Reply With Quote
  #13  
Old 08-01-2001, 04:29 AM
TheFox1 TheFox1 is offline
Registered User
TheFox1's Avatar
Join Date: Mar 2001
Location: The Land Down Under
Posts: 696
TheFox1 is on a distinguished road
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....
__________________
Temporary Unbanned
Stefan Knorr
Reply With Quote
  #14  
Old 08-01-2001, 04:44 AM
Merlin Merlin is offline
Banned
Merlin's Avatar
Join Date: Jul 2001
Location: Merlin - U S A Malak - United Kingdom
Posts: 2,543
Merlin is on a distinguished road
Send a message via ICQ to Merlin Send a message via AIM to Merlin
i bet it's from deleteria.
Reply With Quote
  #15  
Old 08-01-2001, 08:13 AM
Guest
Posts: n/a
Quote:
Originally posted by Merlin
i bet it's from deleteria.
dont be stupid now...
Reply With Quote
  #16  
Old 08-01-2001, 08:14 AM
Guest
Posts: n/a
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;
}

Reply With Quote
  #17  
Old 08-01-2001, 08:39 AM
SkooL SkooL is offline
somebody to love
Join Date: Jun 2001
Location: bat country.
Posts: 3,446
SkooL is on a distinguished road
Send a message via AIM to SkooL
*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;
}

__________________
the sky is falling

Last edited by SkooL; 08-01-2001 at 08:45 AM..
Reply With Quote
  #18  
Old 08-01-2001, 09:21 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
LOL Icepick should be banned cuz releasing New World stuff is illegal.
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #19  
Old 08-01-2001, 09:28 AM
TrueHeaT TrueHeaT is offline
Zatoichi
Join Date: Jun 2001
Posts: 7,277
TrueHeaT is an unknown quantity at this point
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..
__________________

If anyone has any of my tilesets and graphics, please PM me as I would really love to have them.
Reply With Quote
  #20  
Old 08-01-2001, 09:56 AM
Guest
Posts: n/a
umm no... my friend helped me out with this script and thats what he did..
Reply With Quote
  #21  
Old 08-01-2001, 10:01 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
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.
Reply With Quote
  #22  
Old 08-01-2001, 10:01 AM
Guest
Posts: n/a
I am sorry all, I didnt know that was a newworld script...
Reply With Quote
  #23  
Old 08-01-2001, 10:02 AM
kyle0654 kyle0654 is offline
-. .`
kyle0654's Avatar
Join Date: Mar 2001
Posts: 1,000
kyle0654 will become famous soon enough
and I'm supposed to believe you why?
Reply With Quote
  #24  
Old 08-01-2001, 10:12 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
You didnt know that you copied a script. I believe you

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)
__________________

subliminal message: 1+1=3
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 04:16 PM.


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