Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-08-2002, 10:56 AM
psichill psichill is offline
Where's Princess Garnet..
psichill's Avatar
Join Date: Nov 2001
Location: In my chair ;D
Posts: 1,713
psichill is on a distinguished road
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;
}
__________________
Reply With Quote
  #2  
Old 01-08-2002, 10:59 AM
psichill psichill is offline
Where's Princess Garnet..
psichill's Avatar
Join Date: Nov 2001
Location: In my chair ;D
Posts: 1,713
psichill is on a distinguished road
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.
__________________
Reply With Quote
  #3  
Old 01-08-2002, 12:28 PM
psichill psichill is offline
Where's Princess Garnet..
psichill's Avatar
Join Date: Nov 2001
Location: In my chair ;D
Posts: 1,713
psichill is on a distinguished road
*bump*
__________________
Reply With Quote
  #4  
Old 01-08-2002, 02:39 PM
psichill psichill is offline
Where's Princess Garnet..
psichill's Avatar
Join Date: Nov 2001
Location: In my chair ;D
Posts: 1,713
psichill is on a distinguished road
*BUMP*!!!
*BUMO*!!
__________________
Reply With Quote
  #5  
Old 01-08-2002, 04:11 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
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...

__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #6  
Old 01-08-2002, 04:40 PM
psichill psichill is offline
Where's Princess Garnet..
psichill's Avatar
Join Date: Nov 2001
Location: In my chair ;D
Posts: 1,713
psichill is on a distinguished road
that was not cool spamming my thread :grrr:
__________________
Reply With Quote
  #7  
Old 01-08-2002, 11:34 PM
Xaviar Xaviar is offline
Registered User
Join Date: Aug 2001
Location: Fairyland
Posts: 463
Xaviar is on a distinguished road
Send a message via ICQ to Xaviar Send a message via AIM to Xaviar
Quote:
Originally posted by psichill
that was not cool spamming my thread :grrr:
You did.. *shrug*
__________________
One by one, the penguins steal my sanity.

*cookie for Xaviar* --Originally posted by Tyhm

--Xaviar

A m e r i c a
Reply With Quote
  #8  
Old 01-09-2002, 12:14 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
no really it wasn't spam i just haven't finished the script yet...i'll post it tonite...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #9  
Old 01-09-2002, 03:31 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
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.)
Reply With Quote
  #10  
Old 01-09-2002, 03:42 AM
haunter haunter is offline
Registered User
haunter's Avatar
Join Date: Mar 2001
Posts: 7,989
haunter is on a distinguished road
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...
Reply With Quote
  #11  
Old 01-09-2002, 03:58 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
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.
Reply With Quote
  #12  
Old 01-09-2002, 04:50 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
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.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:55 AM.


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