Graal Forums

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

Luigi203 05-08-2004 12:53 AM

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

Lance 05-08-2004 01:23 AM

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. :)

billybob256 05-08-2004 01:39 AM

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
}


Lance 05-08-2004 01:57 AM

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...

HoudiniMan 05-08-2004 08:17 AM

mousex and mousey in screenx and screeny would also be helpful I'd bet you.

Dach 05-08-2004 05:52 PM

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

R0bin 05-08-2004 05:54 PM

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;
}




osrs 05-08-2004 07:41 PM

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.

VeX_RaT_Boy 05-08-2004 09:06 PM

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.

R0bin 05-09-2004 04:49 PM

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.

protagonist 05-09-2004 05:02 PM

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.

osrs 05-10-2004 03:50 PM

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. :\

VeX_RaT_Boy 05-10-2004 07:51 PM

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.

R0bin 05-10-2004 10:38 PM

Oi.
No fighting ladies.

VeX_RaT_Boy 05-13-2004 02:29 PM

Quote:

Originally Posted by R0bin
Oi.
No fighting ladies.

Ok, whatever you say grandma >_<


All times are GMT +2. The time now is 04:45 PM.

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