Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Using the mouse (https://forums.graalonline.com/forums/showthread.php?t=32141)

graaliholic 06-23-2002 08:02 AM

Using the mouse
 
Could somebody explain to me how the mouse wheel works and maybe give me a short example?

Shiftk03- 06-23-2002 08:33 AM

Re: Using the mouse
 
Quote:

Originally posted by graaliholic
Could somebody explain to me how the mouse wheel works and maybe give me a short example?
Well I suggest you start by reading your Newfeatures2002.txt in your Graal folder, it briefly explains the mousewheel and gives a small example on what is needed. If that don't help much, just PM me and I'll give you an example.

Falcor 06-23-2002 08:36 AM

If you are lazy

- the script functions for accessing the mouse are now
available in the game, some new functions have been added:
- mouse variables:
mousex, mousey - position of the mouse in the level
mousebuttons - tells you which mouse buttons are pressed,
it's a sum of the values 1 for left mouse button, 2 for middle
mouse button and 4 for the right mouse button, so it's 1+2+4=7
when all buttons are pressed; you can also use the flags described
later to easier check for the mouse buttons
mousescreenx, mousescreeny - position of the mouse in the game screen
mousewheeldelta - the movement of the mouse wheel in the last 0.05 seconds
- flags for checking if a mouse button is pressed:
leftmousebutton - is set when the left mouse button is down
middlemousebutton - is set when the middle mouse button is down
rightmousebutton - is set when the right mouse button is down
- events:
mousedown - occurs when a mouse button has been pressed, so
you can do things like if (mousedown && leftmousebutton) message hi;
mouseup - occurs when a mouse button has been released
mousewheel - occurs when the mouse wheel has been used
- triggered actions (only on npcs where the player has clicked on,
is also sent to the npcserver):
actionleftmouse - the player has clicked on the npc
actionmiddlemouse - the player has clicked with the middle mouse button on the npc
actionrightmouse - the player has right-clicked on the npc
actiondoublemouse - the player has double-clicked on the npc

graaliholic 06-23-2002 08:41 AM

I already read that, and looked for other other people who have asked the same question, but i'm still confused about how it works.

Falcor 06-23-2002 09:01 AM

If you are confused about simple flags and variables, maybe you should concentrate on the basics first.

graaliholic 06-23-2002 09:33 AM

i know the basics! i just dont know how this particular command works :(

Torankusu 06-23-2002 10:07 AM

oh, I enlightened myself on actionmouseleft / right and double click yesterday.

Shiftk03- 06-23-2002 10:23 AM

Quote:

Originally posted by graaliholic
i know the basics! i just dont know how this particular command works :(
Well its pretty self exclamitory. I could give an example but it would end up doing your script...and I'm not going to do that now am I?

Torankusu 06-23-2002 10:28 AM

Quote:

Originally posted by Shiftk03-


Well its pretty self exclamitory. I could give an example but it would end up doing your script...and I'm not going to do that now am I?

I don't have a mousewheel or a 3rd button on the mouse I use so it wouldn't help.

Falcor 06-23-2002 11:51 AM

All the moust stuff is extra build-in flag and variables!!!

if(mousex in |30,40|) message pie!!!;

or something. figure it out. If you can't, you don't know the basics becasue these are NOT commands, they are flags and variables.

Saga2001 06-23-2002 03:54 PM

watch my leetness.
NPC Code:

if (mousewheel) {
this.head = strtofloat(#e(4, strlen(#3)-4, #3));
this.head+=mousewheeldelta;
setplayerprop #3, head#v(this.head).png;
}


woot...shouldn't I mod these here forums, no?

moo....


All times are GMT +2. The time now is 09:14 AM.

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