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 05-08-2004, 12:53 AM
Luigi203 Luigi203 is offline
Hamma Time
Luigi203's Avatar
Join Date: Mar 2003
Location: North East PA
Posts: 285
Luigi203 is on a distinguished road
Send a message via AIM to Luigi203
Mouseover..

Anyone know if there's a mouseover clause, or some way to tell when the mouse has rolled over an npc?
__________________


CAUTION
Reply With Quote
  #2  
Old 05-08-2004, 01:23 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by Luigi203
Anyone know if there's a mouseover clause, or some way to tell when the mouse has rolled over an npc?
Check if the mouse's position is within the NPC's area in a timeout.
Reply With Quote
  #3  
Old 05-08-2004, 01:39 AM
billybob256 billybob256 is offline
Rainbow Fox
Join Date: Apr 2004
Location: b is for ENgland
Posts: 23
billybob256 is on a distinguished road
Send a message via ICQ to billybob256 Send a message via AIM to billybob256 Send a message via MSN to billybob256
for example

NPC Code:

if (created||timeout){
if (x in |x-1,x+1| && y in |y-1,y+|){ //Checks to see if mouse in position
message Rar!; //Commands Here
}
timeout=0.05
}

Reply With Quote
  #4  
Old 05-08-2004, 01:57 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by billybob256
for example

NPC Code:

if (created||timeout){
if (x in |x-1,x+1| && y in |y-1,y+|){ //Checks to see if mouse in position
message Rar!; //Commands Here
}
timeout=0.05
}

If you are going to use the code tag, at least use it properly - that is, format the code which you put within the tags.

That said, you are not using the proper variables - you want to check if mousex and mousey are within those ranges, not if the NPC's x and y are. You also lack an operand within your second range...
Reply With Quote
  #5  
Old 05-08-2004, 08:17 AM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
mousex and mousey in screenx and screeny would also be helpful I'd bet you.
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #6  
Old 05-08-2004, 05:52 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally Posted by HoudiniMan
mousex and mousey in screenx and screeny would also be helpful I'd bet you.
You mean mousescreenx and mousescreeny for gui type purposes, I assume?


Whats with the x-1,x+1 type deal? Npcs' x and y are at the top left corner of the npc, so you'd need x,x+width... That's just like that distance formula crap people were doing so long ago, but with less excuse.. bah I'll just presume it was an example and let it go, even though it was misleading somewhat
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #7  
Old 05-08-2004, 05:54 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
NPC Code:

NPC Code:

if (created||timeout) {
this.npc=testnpc(mousex,mousey);
if (this.npc>-1) {
showtext -10,npcs[this.npc].x+1.5,npcs[this.npc].y-1,,c,#v(this.npc);
} else hideimg -10;
timeout=0.05;
}



Reply With Quote
  #8  
Old 05-08-2004, 07:41 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by R0bin
NPC Code:

NPC Code:

if (created||timeout) {
this.npc=testnpc(mousex,mousey);
if (this.npc>-1) {
showtext -10,npcs[this.npc].x+1.5,npcs[this.npc].y-1,,c,#v(this.npc);
} else hideimg -10;
timeout=0.05;
}



What's the point of negative indexes? I have noticed that you use negative indexs often.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #9  
Old 05-08-2004, 09:06 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Quote:
Originally Posted by osrs
What's the point of negative indexes? I have noticed that you use negative indexs often.
Does it really matter?
Indexes >200 and <0 is the same thing anyways.
__________________
-Kjetil Valen
Reply With Quote
  #10  
Old 05-09-2004, 04:49 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
yes.

-1 downto -inf = visible by client only
0 - 200 = visible by all clients in the level
201 - inf = visible by client only.

len(-1) < len(200) its just easier to type.
Reply With Quote
  #11  
Old 05-09-2004, 05:02 PM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally Posted by R0bin
yes.

-1 downto -inf = visible by client only
0 - 200 = visible by all clients in the level
201 - inf = visible by client only.

len(-1) < len(200) its just easier to type.
Hm. The things you learn.
Reply With Quote
  #12  
Old 05-10-2004, 03:50 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by VeX_RaT_Boy
Does it really matter?
Indexes >200 and <0 is the same thing anyways.
I don't think i was talking to you.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #13  
Old 05-10-2004, 07:51 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Quote:
Originally Posted by osrs
I don't think i was talking to you.
But I answered, so you got to live with that now.
__________________
-Kjetil Valen
Reply With Quote
  #14  
Old 05-10-2004, 10:38 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
Oi.
No fighting ladies.
Reply With Quote
  #15  
Old 05-13-2004, 02:29 PM
VeX_RaT_Boy VeX_RaT_Boy is offline
WannaBe Scripter
VeX_RaT_Boy's Avatar
Join Date: Aug 2002
Location: Norway
Posts: 960
VeX_RaT_Boy is on a distinguished road
Send a message via ICQ to VeX_RaT_Boy Send a message via AIM to VeX_RaT_Boy Send a message via Yahoo to VeX_RaT_Boy
Quote:
Originally Posted by R0bin
Oi.
No fighting ladies.
Ok, whatever you say grandma
__________________
-Kjetil Valen
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 08:10 AM.


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