Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Mouse Distance From Function (http://www.alice.org/community/showthread.php?t=4729)

JAA 07-11-2010 10:26 PM

I Need Help With "mouse distance to" Functions
 
I made a simple world with the following event:

When the world begins do [world.my first method]

...and the following method:

[U]world.my first method[/U]
While [true]
-Print [mouse distance to left edge]
-Print [mouse distance to top edge]

My goal was to get a print out of the mouse's position relative to the left and top edge of the screen as I move the mouse around. Instead it just keeps printing:

"the value of world.my first method mouse distance from left edge is none"
"the value of world.my first method mouse distance from top edge is none"

...as I move the mouse around.

I can't figure out why this is the case, can someone help me?

If I could get Alice to recognize these values I would make the following events:
(note: L = distance from left edge of screen to the center of the screen
: T = distance from top edge of screen to the center of the screen)

While [mouse distance from left edge > L]
Beginning:
During: [camera turn left at speed [1/4 revolution] per [1]second]
End:

While [mouse distance from right edge < L]
Beginning:
During: [camera turn right at speed [1/4 revolution] per [1]second]
End:

While [mouse distance from left edge > T]
Beginning:
During: [camera turn forward at speed [1/4 revolution] per [1]second]
End:

While [mouse distance from left edge < T]
Beginning:
During: [camera turn backward at speed [1/4 revolution] per [1]second]
End:

...Then I'd throw in a tiny "+" at the center of the screen with its vehicle set to the camera.
Why can't it be this simple?!!!!!!
I know that that the above events would make it nearly impossible to keep the screen still but i don't care for now. I just want this basic thing to work and I'll tweak it later.

x2495iiii 07-11-2010 11:11 PM

Hang on a sec, let me see if I can duplicate your conditions. So far it's working fine for me...

x2495iiii 07-11-2010 11:23 PM

1 Attachment(s)
Well, I tried doing what you said you did and it works fine. See for yourself.

JAA 07-11-2010 11:29 PM

I think I know why
 
I think I figured out the problem. Rich0e0rick said, "The functions that figure out the mouse movements don't work on the mac version of Alice." If this is the case then I really hope they fix this. I notice the Mac version is really buggy.

I was trying this on my Mac. I'll try it on a PC and see what happens.

JAA 07-11-2010 11:45 PM

No worries
 
No worries, I got Alice on my PC and I'm going to fix my Windows partition on my Mac so I don't have to deal with this.

There are very few things I like better about Windows than Mac and Alice is one of them.

x2495iiii 07-11-2010 11:58 PM

I don't want to get into the whole PC vs. Mac debate or anything cause it's pointless, I just know what I like. I like Windows.

JAA 07-12-2010 01:13 AM

1 Attachment(s)
[QUOTE=x2495iiii;23027]I don't want to get into the whole PC vs. Mac debate or anything cause it's pointless, I just know what I like. I like Windows.[/QUOTE]

Lol. Hey that's fine I'm a Mac and your a PC. Well, except for right now I'm a PC, but only to make the camera follow the mouse in Alice. We can still get along though. I attached the program below; it only works for PC:(


All times are GMT -5. The time now is 11:48 PM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.