Graal Forums

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

joseyisleet 08-23-2001 03:29 AM

Help me.
 
Can someome tell me how to make a person 'walk' faster, without being able to walk on walls. Thanks.

Lyndzey8000 08-23-2001 03:37 AM

Do you mean like running boots? Hmm...
NPC Code:

// NPC Made by Lyndzey
if(created){
this.speed=.5;
}
if(playerenters){
toweapons Running Boots;
}
if(weaponfired){
if(this.bootson==0){
this.bootson=1;
}
if(this.bootson==1){
this.bootson=0;
}
if(this.bootson==1&&!onwall(playerx+.1,playery+.4) &&!onwall(playerx+.9,playery+1.4)&&!onwall(playerx +.1,playery+1.4)&&!onwall(playerx+.9,playery+.4)) {
if (playersprite in |1,8| || playersprite in |25,33|) {
if (playerdir==0) {playery-=this.speed}
if (playerdir==1) {playerx-=this.speed}
if (playerdir==2) {playery+=this.speed}
if (playerdir==3) {playerx+=this.speed}
}
}
}


A little messy, but that should work.

LiquidIce00 08-23-2001 05:14 AM

onwall = evil
Lyndzeys onwall wouldnt be the best .
x.x and i dont have ne right now that i can post . but Stefan posted one a while back that is like as good as Graal can get ;)

nyghtGT 08-23-2001 08:17 AM

running boots
 
//NPC made by Nyght (FAQ)
if (playertouchsme) {toweapons Runnin' Shoes

}

if (weaponfired) {
if (this.activated==0) {
setplayerprop #c, Runnin' Shoes On;
this.activated = 1;
timeout = 0.05;
}
else {
this.activated = 0;
setplayerprop #c, Runnin' Shoes Off;
}
}
if (playerchats && strcontains(#c,speed)) {
if (strequals(#c,speed 0.5)) {
this.speed=0.5;
}
if (strequals(#c,speed 1)) {
this.speed=1;
}
if (strequals(#c,speed 1.5)) {
this.speed=1.5;
}
if (strequals(#c,speed 2)) {
this.speed=2;
}
}
This dont seem right i need to add a onwall thingy i think ....
http://www.deceptiononline.f2s.com/nyghtdoll.gif

joseyisleet 08-23-2001 08:52 PM

Thank ya.
 
Thanks, I'll use both of the code and mix 'em around a little bit.

08-23-2001 10:54 PM

I like mine better :p It had stars going behind it but i took it out, it looked weird.
NPC Code:

function drawstars()
{
onlyoncevar+=1;
if(onlyoncevar==1)
{
this.savedx=players[player].x;
this.savedy=players[player].y;
}
if(playery+5 < this.savedy || playery-5 > this.savedy)
this.savedy=playery;
if(playerx+5 < this.savedx || playerx-5 > this.savedx)
this.savedx=playerx;

if(this.savedx != players[player].x)
{

players[player].x=((players[player].x-this.savedx)*3)+this.savedx;
if(onwall(playerx+1.6, playery) || onwall(playerx, playery))
players[player].x=this.savedx;
this.savedx=players[player].x;
}
if(this.savedy != players[player].y)
{
// if (onwall(playerx, ((players[player].y-this.savedy)*3)+this.savedy)) // Y movement runs you into wall
// {}else
{

players[player].y=((players[player].y-this.savedy)*3)+this.savedy;
if(onwall(playerx, playery+1.8) || onwall(playerx, playery-.2))
players[player].y=this.savedy;
this.savedy=players[player].y;
}
}
// if(playerx > 58 || playerx < 4 || playery > 58 || playery < 4) //Reached the edge of the map. Does strange things. :|
// {
// umokison=0;
// onlyoncevar=0;
// }
sleep .05; // Run every frame.
if(this.umokison==1) // Only if toggled.
{
drawstars();
}
}
if(playertouchsme)
{
toweapons Umok Boots;
hide;
}
if(weaponfired)
{
if(this.umokison==0)
{
this.umokison=1;
myy=players[player].y;
myx=players[player].x;
mydir=players[player].dir;
players[player].sprite=24;
drawstars();

}
else
{
this.umokison=0;
onlyoncevar=0;
}



freddyfox 08-23-2001 11:10 PM

Straight from the levels pack, the Pegasus Boots script:

NPC Code:

if (playertouchsme) {
say 6;
toweapons Pegasus Boots;
set gotpegasusboots;
}
if (weaponfired) {
this.m=1;
this.oldx = playerx;
this.oldy = playery;

if (this.inuse=0) this.inuse=1; else this.inuse=0;
if (this.inuse=1) timeout=.05
}
if (timeout && this.inuse=1) {
if (playersprite<1 || playersprite>8) {this.inuse=0;}
else {
this.mx=0; this.my=0;
if (playerx<this.oldx) this.mx=this.m;
if (playery<this.oldy) this.my=this.m;
if (playerx>this.oldx) this.mx=-1*this.m;
if (playery>this.oldy) this.my=-1*this.m;
this.dir=10*this.my+this.mx;

//HORIZONTAL movement (X)
this.rx=1;
if (this.mx<0) this.rx=4-1;
if (this.mx>0) this.rx=-1.5-1;
ok=1;
for (i=1;i<=2;i+=.25; ) {
this.rx+=.25;
for (this.ry=1;this.ry<=2.5;this.ry+=.5) {
if (onwall(playerx+this.rx+this.mx,playery+this.ry)) {
ok=0;
}
}
}
if (ok==1) playerx-=this.mx;

//VERTICAL movement (Y)
this.ry=1;
if (this.my<0) this.ry=4.5-1.5;
if (this.my>0) this.ry=-1-1.5;
ok=1;
for (i=1;i<=3;i+=.25; ) {
this.ry+=.25;
for (this.rx=.75;this.rx<=2.5;this.rx+=.5) {
if (onwall(playerx+this.rx,playery+this.ry+this.my)) {
ok=0;
}
}
}
if (ok==1) playery-=this.my;

this.oldx = playerx;
this.oldy = playery;
timeout=.05;
}
}


08-23-2001 11:24 PM

nice :)

nyghtGT 08-24-2001 09:06 AM

hey Ice
 
does penny knw your usig her boot script ????
http://www.deceptiononline.f2s.com/nyghtdoll.gif

08-24-2001 10:17 AM

Re: hey Ice
 
Quote:

Originally posted by nyghtGT
does penny knw your usig her boot script ????
http://www.deceptiononline.f2s.com/nyghtdoll.gif

what?

nyghtGT 08-24-2001 11:02 AM

please ...
 
1 Attachment(s)
Please dont make me kill you again Ice .. and to make it worse ... i killed you oin m bomy account !!! with 0.5 life ....

nyghtGT 08-24-2001 11:14 AM

(Penny here)
 
Penny speaking...

Wow, Icepick.. still using my old stale scripts after all this time, huh? It's sure pathetic that after spending so much of your "life" on Graal, you can't script, build levels, or run a server worth a damn.
Besides, anyone who knows me at all would recognize the "umok" vars that I used in that script and realize you stole it.. I find it absolutely silly that you would lie to everyone and say that you wrote it, though...

Everyone here who does NOT happen to be familiar with what a complete ***** Icepick is, check out this page:

http://www.frontiernet.net/~sponge/aiminfo.html

You'll get a good laugh, I'm sure.

BTW, Icepick.. What's with using like 10 images as your sig? Are you TRYING to look dumb? o_O

-Penny, who will never trust a ***** with any of her scripts again.

joseyisleet 08-24-2001 11:28 AM

thanks again.
 
Thanks again.

"Stolen scripts? Made scripts? *** scripts? Lame scripts? Useless scripts? WHO GIVES A DAMN!?"

Just what one of my friends said earlier. =)
Oh yeah, my 'sig' owns jo0 all!

Skatche 08-24-2001 08:59 PM

Re: thanks again.
 
Quote:

Originally posted by joseyisleet
Thanks again.

"Stolen scripts? Made scripts? *** scripts? Lame scripts? Useless scripts? WHO GIVES A DAMN!?"

Just what one of my friends said earlier. =)
Oh yeah, my 'sig' owns jo0 all!

Yes, it's nice. Very minimalistic. The question mark is a nice touch.

kyle0654 08-25-2001 01:37 AM

Quote:

Originally posted by IcePick_2001
I like mine better :p It had stars going behind it but i took it out, it looked weird.
NPC Code:

function drawstars()
{
onlyoncevar+=1;
if(onlyoncevar==1)
{
this.savedx=players[player].x;
this.savedy=players[player].y;
}
if(playery+5 < this.savedy || playery-5 > this.savedy)
this.savedy=playery;
if(playerx+5 < this.savedx || playerx-5 > this.savedx)
this.savedx=playerx;

if(this.savedx != players[player].x)
{

players[player].x=((players[player].x-this.savedx)*3)+this.savedx;
if(onwall(playerx+1.6, playery) || onwall(playerx, playery))
players[player].x=this.savedx;
this.savedx=players[player].x;
}
if(this.savedy != players[player].y)
{
// if (onwall(playerx, ((players[player].y-this.savedy)*3)+this.savedy)) // Y movement runs you into wall
// {}else
{

players[player].y=((players[player].y-this.savedy)*3)+this.savedy;
if(onwall(playerx, playery+1.8) || onwall(playerx, playery-.2))
players[player].y=this.savedy;
this.savedy=players[player].y;
}
}
// if(playerx > 58 || playerx < 4 || playery > 58 || playery < 4) //Reached the edge of the map. Does strange things. :|
// {
// umokison=0;
// onlyoncevar=0;
// }
sleep .05; // Run every frame.
if(this.umokison==1) // Only if toggled.
{
drawstars();
}
}
if(playertouchsme)
{
toweapons Umok Boots;
hide;
}
if(weaponfired)
{
if(this.umokison==0)
{
this.umokison=1;
myy=players[player].y;
myx=players[player].x;
mydir=players[player].dir;
players[player].sprite=24;
drawstars();

}
else
{
this.umokison=0;
onlyoncevar=0;
}



there's no way you made that when you're asking me on ICQ for the variable for changing the player's heart count...

LiquidIce00 08-25-2001 02:12 AM

Quote:

Originally posted by kyle0654

there's no way you made that when you're asking me on ICQ for the variable for changing the player's heart count...

that's sad

BocoC 08-25-2001 03:18 AM

I made a perfect onwall script, but I am too lazy to extract the code from my npc. But, basically it checks every half a tile for an onwall statement. Every time it checks, it adds 0.5 to a counter. Now, if you are doing this:

playerx++;

Then if it detects a wall inbetween the starting point and destination of the player, it uses the counter to place the player in front of the wall. It's kinda complicated, but it works perfectly.

kyle0654 08-25-2001 03:27 AM

Quote:

Originally posted by BocoC
I made a perfect onwall script, but I am too lazy to extract the code from my npc. But, basically it checks every half a tile for an onwall statement. Every time it checks, it adds 0.5 to a counter. Now, if you are doing this:

playerx++;

Then if it detects a wall inbetween the starting point and destination of the player, it uses the counter to place the player in front of the wall. It's kinda complicated, but it works perfectly.

Fun (though you'll find that .5 tiles aren't quite accurate enough if you do anything really advanced). 1/16 tiles would be incredibly accurate, but also somewhat inefficient.

(Washington eh?)

BocoC 08-25-2001 03:33 AM

Re: hey Ice
 
Quote:

Originally posted by nyghtGT
does penny knw your usig her boot script ????
http://www.deceptiononline.f2s.com/nyghtdoll.gif

Do you know you are using mine?

BocoC 08-25-2001 03:35 AM

Quote:

Originally posted by kyle0654

Fun (though you'll find that .5 tiles aren't quite accurate enough if you do anything really advanced). 1/16 tiles would be incredibly accurate, but also somewhat inefficient.

(Washington eh?)

Well, I might be using 0.25 tiles. Not quite sure. I just know that it works. In my gravity script, I was falling like, 6.234 tiles at a time, and I still landed perfectly.

Yes, I live in Washington State. o.O

CyanideSR71 08-25-2001 04:09 AM

Did my remote controlled car have perfect onwall detection (other than I was too lazy to check for onwall on any other point but the exact middle)?

joseyisleet 08-25-2001 04:13 AM

hmm.
 
how long have you guys/girls/men/women been in graal?

BocoC 08-25-2001 04:37 AM

Since Graal 1.4

Lionel-Jonson 08-25-2001 05:02 AM

Quote:

Originally posted by kyle0654

there's no way you made that when you're asking me on ICQ for the variable for changing the player's heart count...

lmao

mhermher 08-25-2001 07:30 PM

Quote:

Originally posted by CyanideSR71
Did my remote controlled car have perfect onwall detection (other than I was too lazy to check for onwall on any other point but the exact middle)?

Um do you mind if i take the GFX for the car and the idea? i made my own car it have same functions but its your GFX and idea and i wanna know if i can use them

Grease_Man2 08-26-2001 10:11 AM

(Chance)

penny made that boot script...i can tell, the umok is a dead give away...ice pick stole what had to be over 50 of its weapons when it was working on its own server...Ice asked it to send him a level so he could see the progress, this was before Penny knew Ice Pick real well, BOOM! ice pick stole ALL the weapons and called them his own, luckily they were all in the beta stages and penny only sent 1 level of weapons and not a whole server :)
the end

Grease_Man2 08-26-2001 10:15 AM

hey guy, here's a script for ya...it gradually takes MP and you can turn them on and off, base of NPC made by Nyght aka Xero and i edited it a bunch, (if u still need the NPC i recomend this one). hope ya like it


// NPC made by Legend Xero
if (playertouchsme) {
toweapons TEST *****!!;
}
if (weaponfired&&playermp=>.5) {
if (this.activated==0) {
this.activated = 1;
timeout = 0.05;
}
else {
this.activated = 0;
}
}
if (timeout==0 && this.activated==1) {
if (!onwall(playerx,playery) && !onwall(playerx,playery+0.5) && !onwall(playerx,playery+1) && !onwall(playerx,playery+1.5) && !onwall(playerx,playery+2) && !onwall(playerx,playery+2.5) && !onwall(playerx,playery+3)
&& !onwall(playerx+0.5,playery) && !onwall(playerx+0.5,playery+0.5) && !onwall(playerx+0.5,playery+1) && !onwall(playerx+0.5,playery+1.5) && !onwall(playerx+0.5,playery+2) && !onwall(playerx+0.5,playery+2.5) && !onwall(playerx+0.5,playery+3)
&& !onwall(playerx+1,playery) && !onwall(playerx+1,playery+0.5) && !onwall(playerx+1,playery+1) && !onwall(playerx+1,playery+1.5) && !onwall(playerx+1,playery+2) && !onwall(playerx+1,playery+2.5) && !onwall(playerx+1,playery+3)
&& !onwall(playerx+1.5,playery) && !onwall(playerx+1.5,playery+0.5) && !onwall(playerx+1.5,playery+1) && !onwall(playerx+1.5,playery+1.5)&& !onwall(playerx+1.5,playery+2) && !onwall(playerx+1.5,playery+2.5) && !onwall(playerx+1.5,playery+3)
&& !onwall(playerx+2,playery) && !onwall(playerx+2,playery+0.5) && !onwall(playerx+2,playery+1) && !onwall(playerx+2,playery+1.5) && !onwall(playerx+2,playery+2) && !onwall(playerx+2,playery+2.5) && !onwall(playerx+2,playery+3)
&& !onwall(playerx+2.5,playery) && !onwall(playerx+2.5,playery+0.5) && !onwall(playerx+2.5,playery+1) && !onwall(playerx+2.5,playery+1.5) && !onwall(playerx+2.5,playery+2) && !onwall(playerx+2.5,playery+2.5) && !onwall(playerx+2.5,playery+3))
{
playermp-=.5;
if (keydown(0)) {
playery -= 1;
}
if (keydown(1)) {
playerx -= 1;
}
if (keydown(2)) {
playery += 1;
}
if (keydown(3)) {
playerx += 1;
}
if (playermp=0) {this.activated = 0;}
if (playerx > 61) {
playerx = 61;
}
if (playery > 61) {
playery = 61;
}
if (playerx < 0) {
playerx = 0;
}
if (playery < 0) {
playery = 0;
}
}
timeout = 0.05;
}


All times are GMT +2. The time now is 11:19 PM.

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