Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
World.Mouse function errors
Old
GregW
Guest
 
Status:
Posts: n/a
Unhappy World.Mouse function errors - 05-06-2009, 09:27 PM

On both Mac and Linux, using the Mouse.getDistanceFrom(Top/Left)Edge function returns 'None' (And when I try to use it in an equation for my game, it crashes entirely). I tried, and 2.2 doesn't seem to work for this either. Is there a reason this, (Does it not just return a number?) or is it just a problem with the Mac and Linux versions of Alice?
Please help, and an early thanks to anybody who responds.
   
Reply With Quote
See if this works for you
Old
HisWorld
Guest
 
Status:
Posts: n/a
Default See if this works for you - 05-06-2009, 10:28 PM

Huh, I'm still new to Alice and never used that function but I just tried it out and it worked for me on a windows, I can try on a linux later but I'll include the game file.


Just make sure to right click on my world variable called "x-value" and "y-value" then check watch this variable. Then run the game. This was actually a game file I was working on from another poster.




Tell me if it works for you.
Attached Files
File Type: a2w randomexample.a2w (1.26 MB, 21 views)

Last edited by HisWorld; 05-06-2009 at 10:33 PM. Reason: adding x and y values
   
Reply With Quote
Old
GregW
Guest
 
Status:
Posts: n/a
Default 05-07-2009, 02:59 PM

Thanks, but it still came up as '<None>'.
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 05-07-2009, 04:12 PM

Quote:
Originally Posted by HisWorld View Post
world variable called "x-value" and "y-value" then check watch this variable.
I didn't actually see those variables in the version you posted, but taking the hint I added my own "x-value" (see attached) and the function works fine.

Not really a surprise as it has worked for me well in the past. Note that this is with Alice 2.0 - haven't tried it with other versions.
Attached Files
File Type: a2w randomexample2.a2w (1.28 MB, 4 views)
   
Reply With Quote
It crashes with an error message.
Old
GregW
Guest
 
Status:
Posts: n/a
Default It crashes with an error message. - 05-07-2009, 07:51 PM

I tried that one, and Alice closed out of the player and gave the message:
Quote:
Alice has detected an error with your world:
what must not be null.
It highlighted the say method. I would have a picture of the whole error message, but I can't take screenshots while the message is present for some strange reason. I tried the function on a separate Windows laptop, though, and it did work.
Attached Images
File Type: jpg Error.jpg (19.4 KB, 21 views)
   
Reply With Quote
Colossal failure!
Old
HisWorld
Guest
 
Status:
Posts: n/a
Default Colossal failure! - 05-07-2009, 07:58 PM

Haha, I meant to post a game i made called example.....not randomexample


Plus this one is more entertaining!
Attached Files
File Type: a2w example.a2w (83.5 KB, 8 views)
   
Reply With Quote
Old
HisWorld
Guest
 
Status:
Posts: n/a
Default 05-07-2009, 08:23 PM

Quote:
Originally Posted by HisWorld View Post
Haha, I meant to post a game i made called example.....not randomexample


Plus this one is more entertaining!
Ok well to GregW question. Yes I tried the way you suggested and my program crashed also. But there are many other way of manipulating the variables with strings! For one I tried out "think" and it worked, you can assign it to 3D text also.
Attached Files
File Type: a2w example22.a2w (55.5 KB, 6 views)
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 05-08-2009, 04:50 PM

This may be a version thing - the program works fine for me with 2.0 - yet the error message would seem to indicate that the function didn't actually work for some reason. I really don't understand why the other methods work.

What versions of Alice are you using? And does the value of x-value actually change (look at the variable in the world properties window)/
   
Reply With Quote
Old
HisWorld
Guest
 
Status:
Posts: n/a
Default 05-08-2009, 06:22 PM

The version I used when I encountered a similar error messege was Alice2.2. Which I usually prefer over Alice2.

Once again I only encountered the error messege when I tried to manipulate the numbers in a identical way as GregW. If you haven't yet, check out my game file for additional ways to safely use this method.

I noticed no one has looked at the last program example22.

Last edited by HisWorld; 05-09-2009 at 12:28 PM.
   
Reply With Quote
Old
GregW
Guest
 
Status:
Posts: n/a
Default 05-09-2009, 07:47 PM

The variable changes, but from one to <None>. I tried it on 2.2 for Mac, and it still did the same thing.
I tried your most recent thing, but it still just changed from

x-value = 1
x-value = 1

to

x-value = <None>
y-value = <None>
   
Reply With Quote
Reply


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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.