mouse clicks and flags
Author: | DerbiaN
|
Submitted: | 15th April, 2003
|
Views: | 4579
| Rated: |
|
|
Mouse clicks:
If you use the condition "upon pressing left mouse button" and test it by repeatedly pressing the left mouse button, you will notice that not every click is recorded. Many of you probably already know how to fix this, but for those that don't, here's how it can be fixed: the reason for this is that when you repeatedly press the button, MMF counts 50% of the clicks as double-clicks. If you duplicate the event and modify the other event's condition to a "upon double-clicking left mouse button", and keep the same actions, it should work with every click. Another way of doing this is with the "repeat while mouse-key is pressed"-condition. However to get it to count only single clicks you will have to restrict it with flags or some other way. This is one way of doing it:
*Repeat when mousekey is pressed
*Flag 1 is on
-set flag 1 off
*Repeat when mousekey is NOT pressed
-set flag 1 on
Flags:
I had a problem a while ago where the flags seemed to "conflict" with each other. After a bit of testing, I found out that there is indeed a limit on the amount of flags. Each object has 32 unique flags. The confusing part is that the expression evaluator lets you type in any flag you want. So this means that if you set flag 33 on, then it actually sets flag 1 on. Flag 34 sets flag 2 on etc. So if you first set flag 16 on, then set flag 2000 off, it sets the flag 16 off. The best way to avoid conflicts is to use only flags 1-32 in events.
|
|
DerbiaN
Registered 27/03/2003
Points 512
|