Graal Forums

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

spi 10-21-2001 12:53 PM

sliding doors.
 
I need a sliding door script that slides over 3 tiles left. And another that slides over 3 tiles right.

I believe there was one like
NPC Code:
f (housegateopen) {
set gateisopen;
play stonemove.wav;
for (i=0; i<64; i++) {
x += 1/16;
sleep 0.05;
}
}



but i can't figure out how to get that to move exactly 3 tiles. :|
(I want the stonemove.wav to play in it, too.)
Thanks.

mhermher 10-21-2001 12:59 PM

Hello,
Make a Gani,
Bye.

LiquidIce00 10-21-2001 01:09 PM

Quote:

Originally posted by mhermher
Hello,
Make a Gani,
Bye.

in ur quote u dont need { or } in single lined if's (just like in Delphi)
so thats dumb ^^

AlexH 10-21-2001 01:16 PM

dont use a gani
use the simple command move
it works like
move x,y,dx,dy
veeeeeeeeeeeeeeeeeeeeeeeeeeery simple

royce 10-21-2001 01:44 PM

yah move in incriments of .5's

ownerofbabylon 10-21-2001 02:26 PM

do like

if(playertouchsme){
timeout=.1;
}

if(timeout&&x<10){
x+=.1;
timeout=.1;
}

or something

or u can use move command which would work good or if you use what i said u should prolly use a this.mode so that it doesnt slide all the way along the wall

wetferret1 10-21-2001 03:53 PM

Just go buy one a "Jerry's"

mhermher 10-21-2001 04:17 PM

[QUOTE]Originally posted by LiquidIce00


in ur quote u dont need { or } in single lined if's (just like in Delphi)
so thats dumb ^^
[/QUOTE

if u use a { then u have to use a } *******

nyghtGT 10-21-2001 04:33 PM

he meant ....
 
Quote:

Originally posted by mhermher
if u use a { then u have to use a } *******
Ok, first off i think he meant ... you do not have to use {} if your script looks like this:
NPC Code:

if (playerenters) show;


and secondly ... jumping to the conlclusion of granting someone ******* should take a little more evaluation then you put forth ....

spi 10-21-2001 10:21 PM

Sadly, Gastly is right.

You need to use a { when you use a ;} at the end, or else you'll get an error.

Hulk Hogan 10-21-2001 11:34 PM

if (created) {
show;
}

if (playertouchsme) {
play stonemove.wav;
x=x+1;
sleep .2;
x=x+1;
sleep .2;
x=x+1;
}

and

if (created) {
show;
}

if (playertouchsme) {
play stonemove.wav;
x=x-1;
sleep .2;
x=x-1;
sleep .2;
x=x-1;
}

Would that work?

prozac424242 10-21-2001 11:46 PM

even better...
 
here is a sliging door.

// NPC made by Prozac
//SLIDING DOOR
if (playerenters){show; this.slide=0;}

if (playertouchsme && this.slide=0) {
this.slide=1;
for (this.i=32; this.i>1; this.i--;)
{
setimgpart door.gif,0,0,32,this.i;
if (this.i>2){sleep .05;}
}
for (this.h=0; this.h<32; this.h++;)
{
setimgpart door.gif,0,0,32,this.h;
sleep .05;
}
this.slide=0;
}

except for the fll image mico-belch in the middle its
quite snazzy.
feel free to use this for anything


use http://www.figmentcode.com/cgi-bin/npc1.pl
my npc search engine of commands, liek search for img
its useful

royce 10-22-2001 12:30 AM

how bout make a animated pic of it !!!

TDO2000 10-22-2001 12:35 AM

never heared of programs like animation shop?
then move the pic of the door a little bit to the side in every frame ;)

SagaTCN 10-22-2001 12:37 AM

Make things simple and use the move command :)

//Door that moves 3 tiles to the left.
if(created) {
move -3,0,1,; //Format is move dx,dy,time,params
playsound stonemove.wav;
sleep 1;
move 3,0,1,;
}

You should be able to play around with that and make another door based on that script. Also, I believe there's a paramater that allows the door to move automatically in the other direction once the first movement is complete, so a sleep command wouldn't be needed. -Yin

btedji 10-22-2001 01:25 AM

Quote:

Originally posted by LiquidIce00


in ur quote u dont need { or } in single lined if's (just like in Delphi)
so thats dumb ^^

you should always use { and } when your are scripting its a whole lot more organized and easier

nyghtGT 10-22-2001 03:19 AM

Re: sliding doors.
 
Quote:

Originally posted by spi
I need a sliding door script that slides over 3 tiles left. And another that slides over 3 tiles right.

I believe there was one like
NPC Code:
f (housegateopen) {
set gateisopen;
play stonemove.wav;
for (i=0; i<64; i++) {
x += 1/16;
sleep 0.05;
}
}



but i can't figure out how to get that to move exactly 3 tiles. :|
(I want the stonemove.wav to play in it, too.)
Thanks.

try this ...
NPC Code:

if (housegateopen) {
set gateisopen;
play stonemove.wav;
for (i=0; i<64; i++) {
x += 1/3;
sleep 0.05;
}
}


nyghtGT 10-22-2001 03:20 AM

mandatory ...
 
Quote:

Originally posted by btedji


you should always use { and } when your are scripting its a whole lot more organized and easier

but what he was pointing out was that its not mandatory ...


All times are GMT +2. The time now is 04:18 AM.

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