Graal Forums

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

hendelbroadaxe 09-25-2001 08:56 AM

jumping npc
 
i need a little help with this script all i need added to it is the onwall script to keep them from going over stuff like trees buildings etc.

if (playerenters) {
}
if (playertouchsme) {toweapons jump;
}

if (weaponfired) {
freezeplayer 1.5;playery-=1;sleep .1;
playery-=1;sleep .1;playery-=1;sleep .1;
playery-=1;sleep .1;playery-=1;sleep .1;
playery-=1;sleep .1;playery-=1;sleep .1;playery-=1;sleep .1;playery+=1;sleep .1;playery+=1;
sleep .1;playery+=1;sleep .1;playery+=1;sleep .1;
playery+=1;sleep .1;
playery+=1;sleep .1;
playery+=1;sleep .1;
playery+=1;sleep .1;}

if you can improve on it or think you can do it better than by all means do. thanks for any help with this.

chime 09-25-2001 09:42 AM

make it not go through walls?

Brady2 09-25-2001 09:54 AM

Jadis:

¡ES IMPOSIBLE!

chime 09-25-2001 10:14 AM

its not impossible to make it go up but not through walls

chime 09-25-2001 10:51 AM

ive seen it done

fuzie 09-25-2001 11:06 AM

if (onwall)

chime 09-25-2001 08:42 PM

?????????????/

Sep3kP2P 09-26-2001 02:18 AM

...crap
 
one, there are no for loopswhivch would make that 10x smaller, two an onwall detection for that is really pretty easy

Sep3kP2P 09-26-2001 02:19 AM

also you used sleep .1, if anything use .05, it makes it look less jumpy

Merlin 09-26-2001 02:20 AM

ew

chime 09-26-2001 02:22 AM

lol i think he wanted it to be jumpy.

Sep3kP2P 09-26-2001 02:28 AM

lol
 
nonono lol i meant jumpy as in not smooth =) wiseguy...

chime 09-26-2001 02:30 AM

lol so its not like floating HAHAHA lol like a falling napkin

EdgeP2P 09-26-2001 02:30 AM

yehda

chime 09-26-2001 02:32 AM

lol noone is answering this guys question just talking about it

EdgeP2P 09-26-2001 02:33 AM

lol

hendelbroadaxe 09-26-2001 02:41 AM

hahaha geez all i need is the onwall added to it so they can't get on buildings or through doors or to certain spots there not suppose to get too.

it has to be jumpy like it is now. not smooth like there doing some matrix deal.

LiquidIce00 09-26-2001 02:45 AM

simple linear jumping

NPC Code:

//jump height
this.jumpheight=16;

if (playertouchsme) {
//add weapon
toweapons jump;
say2 jump! hit S to flip;
}

if (weaponfired) {
//disable movement
disabledefmovement;
//set sprite
playersprite=30;
//make jump count
this.jumpcount=this.jumpheight-1;
//show shadow img
showimg 100,charshadow.gif,playerx+.5,playery+1.5;
changeimgvis 100,0;
//start loop
while (this.jumpcount>(this.jumpheight-(this.jumpheight*2))) {
//flip
//check key
if (keydown(5)&&this.jumpcount>0&&this.flip=0) {
//set flip
this.flip=1;
//set flip count
this.flipcount=0;
}
if (this.flip=1&&this.flipcount<4) { playerdir=(playerdir+1)%4; this.flipcount++; }
if (this.flipcount>=4) { this.flip=0; }
//end flip
//check onwall and move player
if (!onwall(playerx+1.5,playery-this.jumpcount/this.jumpheight)) {
playery-=this.jumpcount/this.jumpheight;
}
else {
if (this.jumpcount>=0) {
putleaps 2,playerx+1,playery;
this.jumpcount-=this.jumpcount*2;
}
}
//end checkwall and move
//add to counter
this.jumpcount-=1;
//sleep
sleep .1;
//re run loop
}
//hide
hideimg 100;
//reset variables
this.flip=0;
//reset sprite
playersprite=0;
//re-enable movement
enabledefmovement;
}


chime 09-26-2001 02:46 AM

and liquid ice saves the day

EdgeP2P 09-26-2001 02:48 AM

YAY!

LiquidIce00 09-26-2001 02:52 AM

Quote:

Originally posted by EdgeP2P
YAY!
kid u gotta stop spamming u have like every single topic (not thread)
wit ur name rite now (not ne more hahahah):spam:

Merlin 09-26-2001 02:52 AM

EDGE YUO = ***GOT,
stop spamming.

LiquidIce00 09-26-2001 05:55 AM

Quote:

Originally posted by Merlin
EDGE YUO = ***GOT,
stop spamming.

go eat joor cheeze and dont drop the flag again *smacks*


All times are GMT +2. The time now is 03:58 PM.

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