Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   I need some help! (https://forums.graalonline.com/forums/showthread.php?t=20682)

psichill 01-08-2002 10:56 AM

I need some help!
 
Okay I need some help with an NPC.
I am trying to make it where, when you walk onto it it lights up but when you walk off the lights turn off.

Here was my attempt!

// NPC made by Ramsey
if (created) {
setimg whatever.gif;
dontblock;
drawunderplayer;
}
//#CLIENTSIDE
if (playertouchsme) {
setcoloreffect 1,1,1,0.99;
drawaslight;
sleep 1;
}

psichill 01-08-2002 10:59 AM

And also it's lighting the image up wieard so I I am not sure what is wrong. Maybe I would just put lights under it and have them triger on when you touch them and triger off when you stop touching them. But I still dont know how to do that.

psichill 01-08-2002 12:28 PM

*bump*

psichill 01-08-2002 02:39 PM

*BUMP*!!!
*BUMO*!!

Saga2001 01-08-2002 04:11 PM

since it seems psichill has decided to post with nothing important, i'll fix it...:-/
NPC Code:

PastAustin is too tired to script, he has decided instead to not answer, and go to bed since he has school tomarrow, the answer will come tomarrow when i can think about math...sorry...


psichill 01-08-2002 04:40 PM

that was not cool spamming my thread :rolleyes: :mad: :grrr:

Xaviar 01-08-2002 11:34 PM

Quote:

Originally posted by psichill
that was not cool spamming my thread :rolleyes: :mad: :grrr:
You did.. *shrug*

Saga2001 01-09-2002 12:14 AM

no really it wasn't spam i just haven't finished the script yet...i'll post it tonite...

Thak2 01-09-2002 03:31 AM

Re: I need some help!
 
Quote:

Originally posted by psichill
Okay I need some help with an NPC.
I am trying to make it where, when you walk onto it it lights up but when you walk off the lights turn off.

Here was my attempt!

// NPC made by Ramsey
if (created) {
setimg whatever.gif;
dontblock;
drawunderplayer;
}
//#CLIENTSIDE
if (playertouchsme) {
setcoloreffect 1,1,1,0.99;
drawaslight;
sleep 1;
}

I don't think that will work because, since it is dontblock, playertouchsme will not effect it.

You could use a timeout and do something like
if (playerx>x&&playery>y etc.)

haunter 01-09-2002 03:42 AM

Re: Re: I need some help!
 
Quote:

Originally posted by Thak2


I don't think that will work because, since it is dontblock, playertouchsme will not effect it.

You could use a timeout and do something like
if (playerx>x&&playery>y etc.)

like this maybe? (non-p2p script)

if (created) {
setimg image.gif;
dontblock;
drawaslight;
timeout=0.05;}
if (timeout) {
if (playertouchsme) {show; setcoloreffect 1,1,0,.99;}
else {hide;}
timeout=0.05;}



I dunno, im not too good at this scripting stuff...

Thak2 01-09-2002 03:58 AM

Re: Re: Re: I need some help!
 
Quote:

Originally posted by haunter


like this maybe? (non-p2p script)

if (created) {
setimg image.gif;
dontblock;
drawaslight;
timeout=0.05;}
if (timeout) {
if (playertouchsme) {show; setcoloreffect 1,1,0,.99;}
else {hide;}
timeout=0.05;}



I dunno, im not too good at this scripting stuff...

No, if it is set as dontblock, then the action playertouchsme won't work (I think).

I mean, have a thing to check to see if the player is within a box.

if (timeout&&playerx>x&&playerx<x+4&&playery>y&&playe ry<y+4)

The above would check in a 4 tile square... might be a bit laggy though. :(

adam 01-09-2002 04:50 AM

playertouchsme does work when it is non-blocking silly.


if might be cool if there was if (playertouchsme) was true the entire time the player was touching the npc and playernottouchingme was true when he stops touching it... but since we don't have that...


blah who knows.

I'd just check for the x y area in a timeout loop.


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

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