Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   I need the a script! (https://forums.graalonline.com/forums/showthread.php?t=2507)

Termina_GP7 05-10-2001 06:35 AM

i need someone to make a beach ball that when you hit it it will fly up in the air and it only works in water please reply

05-20-2001 03:01 AM

Well, I made all that I can of that script, I tryed to do the bouncing part but it didn't work out so good.


NPC Code:

// NPC made by Ice Pick
canbecarried;

//left wall action
if(onwall(x,y) && !onwall(x+4,y))
{
x+=1.5;
y+=.25;
sleep .05;
x+=1.4;
y+=.25;
sleep .05;
x+=1.3;
y+=.25;
sleep .05;
x+=1.2;
y+=.25;
sleep .05;
x+=1.06;
y+=.25;
sleep .05;
x+=.9;
y+=.25;
sleep .05;
x+=.7;
y+=.25;
sleep .05;
x+=.5;
y+=.25;
sleep .05;
//bounce again...
x+=.3;
y-=.5;
sleep .05;
x+=.3;
y-=.35;
sleep .05;
x+=.3;
y-=.15;
sleep .05;
x+=.3;
y-=.05;
sleep .05;
x+=.3;
y+=.05;
sleep .05;
x+=.3;
y+=.15;
sleep .05;
x+=.3;
y+=.35;
sleep .05;
x+=.3;
y+=.5;
sleep .05;

}


//right wall action
if(onwall(x+2,y) && !onwall(x-2,y))
{
x-=1.5;
y+=.25;
sleep .05;
x-=1.4;
y+=.25;
sleep .05;
x-=1.3;
y+=.25;
sleep .05;
x-=1.2;
y+=.25;
sleep .05;
x-=1.06;
y+=.25;
sleep .05;
x-=.9;
y+=.25;
sleep .05;
x-=.7;
y+=.25;
sleep .05;
x-=.5;
y+=.25;
sleep .05;
//bounce again...
x-=.3;
y-=.5;
sleep .05;
x-=.3;
y-=.35;
sleep .05;
x-=.3;
y-=.15;
sleep .05;
x-=.3;
y-=.05;
sleep .05;
x-=.3;
y+=.05;
sleep .05;
x-=.3;
y+=.15;
sleep .05;
x-=.3;
y+=.35;
sleep .05;
x-=.3;
y+=.5;
sleep .05;

}



//top wall action
if(onwall(x,y+1.5) && !onwall(x,y+5))

{
y+=1.5;
sleep .05;
y+=1.4;
sleep .05;
y+=1.3;
sleep .05;
y+=1.2;
sleep .05;
y+=1.06;
sleep .05;
y+=.9;
sleep .05;
y+=.7;
sleep .05;
y+=.5;
sleep .05;
//bounce again...
y+=.05;
sleep .05;
y+=.1;
sleep .05;
y+=.15;
sleep .05;
y+=.2;
sleep .05;
y+=.25;
sleep .05;
y+=.3;
sleep .05;
y+=.35;
sleep .05;
y+=.4;
sleep .05;

}

//bottom wall action
if(onwall(x,y+4) && !onwall(x,y))

{
y-=1.5;
sleep .05;
y-=1.4;
sleep .05;
y-=1.3;
sleep .05;
y-=1.2;
sleep .05;
y-=1.06;
sleep .05;
y-=.9;
sleep .05;
y-=.7;
sleep .05;
y-=.5;
sleep .05;
//bounce again...
y-=.05;
sleep .05;
y-=.1;
sleep .05;
y-=.15;
sleep .05;
y-=.2;
sleep .05;
y-=.25;
sleep .05;
y-=.3;
sleep .05;
y-=.35;
sleep .05;
y-=.4;
sleep .05;

}
//TEST FOR END OF MAP!
//left wall action
if(x < 2)
{
x+=1.5;
y+=.25;
sleep .05;
x+=1.4;
y+=.25;
sleep .05;
x+=1.3;
y+=.25;
sleep .05;
x+=1.2;
y+=.25;
sleep .05;
x+=1.06;
y+=.25;
sleep .05;
x+=.9;
y+=.25;
sleep .05;
x+=.7;
y+=.25;
sleep .05;
x+=.5;
y+=.25;
sleep .05;
//bounce again...
x+=.3;
y-=.5;
sleep .05;
x+=.3;
y-=.35;
sleep .05;
x+=.3;
y-=.15;
sleep .05;
x+=.3;
y-=.05;
sleep .05;
x+=.3;
y+=.05;
sleep .05;
x+=.3;
y+=.15;
sleep .05;
x+=.3;
y+=.35;
sleep .05;
x+=.3;
y+=.5;
sleep .05;

}


//right wall action
if(x > 62)
{
x-=1.5;
y+=.25;
sleep .05;
x-=1.4;
y+=.25;
sleep .05;
x-=1.3;
y+=.25;
sleep .05;
x-=1.2;
y+=.25;
sleep .05;
x-=1.06;
y+=.25;
sleep .05;
x-=.9;
y+=.25;
sleep .05;
x-=.7;
y+=.25;
sleep .05;
x-=.5;
y+=.25;
sleep .05;
//bounce again...
x-=.3;
y-=.5;
sleep .05;
x-=.3;
y-=.35;
sleep .05;
x-=.3;
y-=.15;
sleep .05;
x-=.3;
y-=.05;
sleep .05;
x-=.3;
y+=.05;
sleep .05;
x-=.3;
y+=.15;
sleep .05;
x-=.3;
y+=.35;
sleep .05;
x-=.3;
y+=.5;
sleep .05;

}



//top wall action
if(y < 2)

{
y+=1.5;
sleep .05;
y+=1.4;
sleep .05;
y+=1.3;
sleep .05;
y+=1.2;
sleep .05;
y+=1.06;
sleep .05;
y+=.9;
sleep .05;
y+=.7;
sleep .05;
y+=.5;
sleep .05;
//bounce again...
y+=.05;
sleep .05;
y+=.1;
sleep .05;
y+=.15;
sleep .05;
y+=.2;
sleep .05;
y+=.25;
sleep .05;
y+=.3;
sleep .05;
y+=.35;
sleep .05;
y+=.4;
sleep .05;

}

//bottom wall action
if(y > 62)

{
y-=1.5;
sleep .05;
y-=1.4;
sleep .05;
y-=1.3;
sleep .05;
y-=1.2;
sleep .05;
y-=1.06;
sleep .05;
y-=.9;
sleep .05;
y-=.7;
sleep .05;
y-=.5;
sleep .05;
//bounce again...
y-=.05;
sleep .05;
y-=.1;
sleep .05;
y-=.15;
sleep .05;
y-=.2;
sleep .05;
y-=.25;
sleep .05;
y-=.3;
sleep .05;
y-=.35;
sleep .05;
y-=.4;
sleep .05;

}

if(playerchats)
{
if (strcontains(#c,recoverred))
{
if(playerdir==0)
{
x=playerx;
y=playery-4;
}
if(playerdir==1)
{
x=playerx-4;
y=playery;
}
if(playerdir==3)
{
x=playerx+4;
y=playery;
}
if(playerdir==2)
{
x=playerx;
y=playery+4;
}

}
}
if (playerenters) {
}
if (playertouchsme) {
set ballisheld;

if(onwater(x,y))
{
//vars for player so ball doesn't dynamically update player pos
myy=players[player].y;
myx=players[player].x;
y-=(myy-y)/5;
x-=(myx-x)/5;
sleep .05;
y-=(myy-y)/6;
x-=(myx-x)/6;
sleep .05;
y-=(myy-y)/7;
x-=(myx-x)/7;
sleep .05;
y-=(myy-y)/8;
x-=(myx-x)/8;
sleep .05;
y-=(myy-y)/9;
x-=(myx-x)/9;
sleep .05;
y-=(myy-y)/12;
x-=(myx-x)/12;
sleep .05;
y-=(myy-y)/16;
x-=(myx-x)/16;
sleep .05;
y-=(myy-y)/20;
x-=(myx-x)/20;
sleep .05;
y-=(myy-y)/25;
x-=(myx-x)/25;
sleep .05;
}
}


if (washit) {

//vars for player so ball doesn't dynamically update player pos
myy=players[player].y;
myx=players[player].x;
//If character is sort of below the NPC
y-=(myy-y)/5;
x-=(myx-x)/5;
sleep .05;
y-=(myy-y)/6;
x-=(myx-x)/6;
sleep .05;
y-=(myy-y)/7;
x-=(myx-x)/7;
sleep .05;
y-=(myy-y)/8;
x-=(myx-x)/8;
sleep .05;
y-=(myy-y)/9;
x-=(myx-x)/9;
sleep .05;
y-=(myy-y)/12;
x-=(myx-x)/12;
sleep .05;
y-=(myy-y)/16;
x-=(myx-x)/16;
sleep .05;
y-=(myy-y)/20;
x-=(myx-x)/20;
sleep .05;
y-=(myy-y)/25;
x-=(myx-x)/25;
sleep .05;


}

if(wasthrown)
{
sleep 1;
if(dir==0)
{
y-=.05;
sleep .05;
y-=.1;
sleep .05;
y-=.15;
sleep .05;
y-=.2;
sleep .05;
y-=.25;
sleep .05;
y-=.3;
sleep .05;
y-=.35;
sleep .05;
y-=.4;
sleep .05;
}
}


kyle0654 05-20-2001 03:03 AM

*trembling, takes out bottle of pills, shakes some into hand, then stuffs them down his throat...and shakes uncontrollably*

Lion'el-Jonson 05-20-2001 03:32 AM

::scratches head::

Cyboars 05-20-2001 03:44 AM

*falls over*
*eyes fall out of sockets*
Holy....
*passes out from lack of scripting powers, and ability to withstand the shock of an immense script*

freddyfox 05-20-2001 05:25 AM

Quote:

Originally posted by IcePick_2001
Well, I made all that I can of that script, I tryed to do the bouncing part but it didn't work out so good.

[/code]


AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!

*Motions for kyle to hand him some of those pills*

I MUST NOW GOUGE MY EYEBALLS OUT!

kyle0654 05-20-2001 05:33 AM

*looks at script again*
*runs to kitchen, takes out bag of salt, and pours in eyes, then slowly crawls back to computer, curls up in a small ball on the floor, and twitches insanely*

CrazedMerlin 05-20-2001 09:03 AM

did ice pick say he MADE a script?
OMGOMGOMG
its a first

_Shoey_Fighter_ 05-20-2001 10:45 AM

I've always wondered why people never use the for command...

But, it is nice seeing Icepick trying to help out for a change... ;)

entravial 05-20-2001 02:50 PM

umm, who's a script??

j/k
------
Entravial (Bravo NAT)


05-20-2001 10:05 PM

Yes, I did make that script. Why do you ask? :confused:

CrazedMerlin 05-20-2001 11:21 PM

Eh...
Its a little big :D

05-21-2001 12:17 AM

Yes I know, But once you get the first 50 lines or so done, It gets very easy.

bb2k1 05-21-2001 01:06 AM

IcePick, the script is crap. It's horribley coded and doesn't need to be nearly
that long.

LiquidIce00 05-21-2001 11:31 AM

Ice_Pick..
get in touch with your sine and cosine and loops.
it makes it alot easier and alot better effect.
and with sine / cosine you would be able to change 'force' and such making how far it travels and stuff like that..
:cool:


All times are GMT +2. The time now is 05:48 PM.

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