Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
I Need Help With "mouse distance to" Functions
Old
JAA
Member
 
JAA's Avatar
 
Status: Offline
Posts: 31
Join Date: Jul 2010
Default I Need Help With "mouse distance to" Functions - 07-11-2010, 10:26 PM

I made a simple world with the following event:

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

...and the following method:

world.my first method
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.


Out of the 7 schools I applied for, Carnegie Mellon is the only one that didn't accept me. They wait listed me, but I hold no grudges. Alice is awesome and Claytronics , om*g. Some one should figure out how to put these two projects together. It would revolutionize not only the gaming industry, but the world... scratch that, the Universe... scratch that, the Multiverse!

Last edited by JAA; 07-11-2010 at 10:49 PM.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 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...
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 07-11-2010, 11:23 PM

Well, I tried doing what you said you did and it works fine. See for yourself.
Attached Files
File Type: a2w StuffWorld.a2w (165.4 KB, 39 views)
   
Reply With Quote
I think I know why
Old
JAA
Member
 
JAA's Avatar
 
Status: Offline
Posts: 31
Join Date: Jul 2010
Default I think I know why - 07-11-2010, 11:29 PM

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.


Out of the 7 schools I applied for, Carnegie Mellon is the only one that didn't accept me. They wait listed me, but I hold no grudges. Alice is awesome and Claytronics , om*g. Some one should figure out how to put these two projects together. It would revolutionize not only the gaming industry, but the world... scratch that, the Universe... scratch that, the Multiverse!
   
Reply With Quote
No worries
Old
JAA
Member
 
JAA's Avatar
 
Status: Offline
Posts: 31
Join Date: Jul 2010
Default No worries - 07-11-2010, 11:45 PM

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.


Out of the 7 schools I applied for, Carnegie Mellon is the only one that didn't accept me. They wait listed me, but I hold no grudges. Alice is awesome and Claytronics , om*g. Some one should figure out how to put these two projects together. It would revolutionize not only the gaming industry, but the world... scratch that, the Universe... scratch that, the Multiverse!
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 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.
   
Reply With Quote
Old
JAA
Member
 
JAA's Avatar
 
Status: Offline
Posts: 31
Join Date: Jul 2010
Cool 07-12-2010, 01:13 AM

Quote:
Originally Posted by x2495iiii View Post
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.
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
Attached Files
File Type: a2w ScreenFollowsMouse.a2w (262.1 KB, 28 views)


Out of the 7 schools I applied for, Carnegie Mellon is the only one that didn't accept me. They wait listed me, but I hold no grudges. Alice is awesome and Claytronics , om*g. Some one should figure out how to put these two projects together. It would revolutionize not only the gaming industry, but the world... scratch that, the Universe... scratch that, the Multiverse!
   
Reply With Quote
Reply

Thread Tools
Display Modes

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



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