Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Party lights script (https://forums.graalonline.com/forums/showthread.php?t=7292)

pkblu154 07-15-2001 06:12 AM

Party lights script
 
well i have a question in the following script how can i make it keep changing the backpal without stoping?
// NPC made by Draktha
if (playerenters) {
setbackpal afirebackpal.gif;
sleep.5;
setbackpal duskpal.png;
sleep.5;
setbackpal picsgold.gif;
sleep.5;
setbackpal picsgravity.gif;
sleep.5;
setbackpal picslightblue.gif;
sleep.5;
setbackpal picsyellowgreen.gif;
}
if (playersays(party lights off)) {
setbackpal pics1.png}
if (playersays(party lights on)){
setbackpal afirebackpal.gif;
sleep.5;
setbackpal duskpal.png;
sleep.5;
setbackpal picsgold.gif;
sleep.5;
setbackpal picsgravity.gif;
sleep.5;
setbackpal picslightblue.gif;
sleep.5;
setbackpal picsyellowgreen.gif;
}
oh and i dont care if u steal it.. it doesnt work right anyways

entravial 07-15-2001 07:52 AM

use a timeout

pkblu154 07-15-2001 12:33 PM

...?
 
:confused:Timeout?:confused: well i dont know how to use a timeout.. sry im kinda a N00b scripter. please explain....:(

entravial 07-15-2001 01:36 PM

ie:

if (playerenters) {timeout = 0.5;
}
if (timeout) {
setbackpal afirebackpal.gif;
sleep.5;
setbackpal duskpal.png;
sleep.5;
setbackpal picsgold.gif;
sleep.5;
setbackpal picsgravity.gif;
sleep.5;
setbackpal picslightblue.gif;
sleep.5;
setbackpal picsyellowgreen.gif; timeout = 0.5;
message Entravial rules you!;
}

You must leave entravial rules you in there for it to work

Poogle 07-17-2001 04:12 AM

Sleep script is the thing that stops it before it needs to be like:
sleep 0.5;

Poogle 07-17-2001 04:13 AM

Oh yeah if that script gets up it will be VERY VERY lagy and I use ADSL

kyle0654 07-17-2001 04:26 AM

it'd only be laggy client-side if you have a slow computer...

NPC Code:

if (created) {
this.speed = .5;
// don't edit below here;

setstring this.backpals,afirebackpal.gif duskpal.png picsgold.gif picsgravity.gif picslightblue.gif picsyellowgreen.gif;
this.pal = 0;
tokenize #s(this.backpals);
timeout = .05;
}
if (timeout) {
this.pal = (this.pal+1)%tokenscount;
setbackpal #t(this.pal);
timeout = this.speed;
}


hehe, for extra super fun change this.speed to .05 ;)

entravial 07-17-2001 02:02 PM

oh here comes kyle with his fancy scripting :mad:
hehe.
that's the hard way to do it, i just use the easy way, even if it is long.
unless the hard way is the better way

kyle0654 07-18-2001 01:48 AM

heh, it's actually better in the long run....cuz if you want to add stuff to the script later you don't have to mess with sleeps. I ALWAYS used to use a while loop with sleeps in it, for about 3 months when I started scripting. Then I finally learned timeout and have used it ever since.

Sleep freezes the script, so nothing else can run. So say you wanted to have one script that moved things at different speeds. You couldn't do it with sleep (well, you could, but it'd be longer), but with timeout it's a simple matter of adding a counter and checking the value of the counter.

SkooL 07-18-2001 01:56 AM

Switching backpals that often is laggy. Try seteffect instead.

kyle0654 07-18-2001 02:38 AM

he's right, seteffect will work better for this situation. (setbackpal would be better for like changing the tileset appearance (grass to snow))

entravial 07-18-2001 08:39 AM

mmm

ownerofbabylon 07-18-2001 02:12 PM

OMG, i never realized kyle was such a good scripter.

entravial 07-18-2001 02:31 PM

lol, and you have never stolen one of his scripts :rolleyes:

ownerofbabylon 07-18-2001 02:57 PM

I dont think so, I have the bomy script but that was given to me

Valder 07-18-2001 02:58 PM

a lot of people have every script, it's just useless unless you have the NPC (Server)

kyle0654 07-18-2001 04:08 PM

Only one person has MY final version of the bomy-boots script (other than Antago and Stefan)...

toad1413 07-18-2001 07:04 PM

Quote:

Originally posted by kyle0654
Only one person has MY final version of the bomy-boots script (other than Antago and Stefan)...
I'm just curious... but who?

konidias 07-18-2001 07:49 PM

I have the bomy level with the 5 different bomy's you can pick from, you can swim in the river, you can jump off the cliff, you can play hacky, you can eat bombs.. its pretty complete i would imagine =) I can't even remember who I got it from

kyle0654 07-18-2001 11:13 PM

lol, if it can play hacky it's not my final version ;)

I'm not telling who has it, cuz I don't want them to be bombarded with "can I have the bomy script please!?!" It has kicking in it though ;)

ownerofbabylon 07-19-2001 09:49 AM

wow cool, :D I havent ever seen Antagano online. =\ hes a ghost :eek:

konidias 07-19-2001 11:09 AM

The version I have seems complete.. it has everything, including kicking, ducking, using the health thing, eating bombs, kicking bushes.. etc Maybe it got passed around.. or someone made it into another level heh heh

kyle0654 07-20-2001 05:56 AM

I'd give my version out...but it's too old to be very useful other than some of the onwall stuff, and it's pretty darn confusing...I'm also not sure if Stefan would approve me handing it out either though...cuz people could and would copy it.

entravial 07-20-2001 01:30 PM

Yeah but what will they do with it?

There will be like 3 people who actually understand it (i'm guessing you used alot of C,G and that stuff functions like you usually do) and they would be smart enough not to copy it. And the people who do copy it will just stick it on thier server, which won't even make it on!


All times are GMT +2. The time now is 12:35 AM.

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