Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Proximity (http://www.alice.org/community/showthread.php?t=8264)

razielpro 03-26-2012 11:53 PM

Proximity
 
Hi,

I am trying to get the Alice Liddell object to turn 1/4 revolution when the camera is withing 1 meter of her. I've tried:
[INDENT]If Alice Lidell is within 1 meter of Camera[/INDENT][INDENT][INDENT]AliceLiddell turn Right.25 Revolutions [/INDENT][/INDENT]
I use the mouse to control the camera

When I advance toward Alice I go right through her and nothing happens.

Using
[INDENT]AliceLiddell is at least 1 meter away from Camera[/INDENT]
It seems like the instruction skips entirely and Alice will make the turn regardless of how far she is from the camera.

The goal is to have the user walk through the Amusement park using the mouse. When the user comes upon a ride or hotdog cart the a method will run and objects will interact.

Can this even be done?

Thank you in advance.

aikmin 03-27-2012 05:42 AM

Problem with your program
 
Use the method [object] move to [subject] to move the camera to aliceLiddell and you will notice that the model is actually very large and the 0,0 point is at her feet. Even moving the camera into aliceLiddell will not move the camera to within 1 meter of aliceLiddell since the distance from feet to camera is > 1 meter. Use the print [aliceLiddell] distance to [camera] to check the distance.

razielpro 03-27-2012 05:31 PM

Proximity
 
1 Attachment(s)
Thanks for getting back to me aikmin. I guess what I'm wondering is, how does alice know that the camera is near her? I could click on each individual ride to run the method but that's cheesey in my opinion. I think it woudl be more realistic if an object knew that the user was near it when they use the mouse to operate the camera.

I posted from my phone last night. This is my best guess at how to do this. Any help you can offer is greatly apppreciated

razielpro 03-29-2012 05:40 PM

This is what I was looking for
 
Nick Faldo's collision detection tutorial :)



[url]http://www.youtube.com/watch?v=2gstaiVGqkk[/url]

dakota95 03-30-2012 08:05 AM

Im going to guess that your problem is not puting your method in the right place. The method that you described in your first post up top, is the correct method. What you should do is to create a "when the world starts" then right click on it and change it to "while the world is running". Then Insert your method into this.

dakota95 03-30-2012 08:46 AM

1 Attachment(s)
Here is an example world that I made. Go to the ferris wheel cause that is the only ride that works. If you just want to see the ride go around in cicles back off and press space.

Arrow keys to move
Click on yes or no to answer questions

razielpro 04-04-2012 05:30 PM

RE: Proximity
 
[QUOTE=dakota95;47692]Here is an example world that I made. Go to the ferris wheel cause that is the only ride that works. If you just want to see the ride go around in cicles back off and press space.

Arrow keys to move
Click on yes or no to answer questions[/QUOTE]

This was very helpful Dakota.

Thanks!


All times are GMT -5. The time now is 01:43 AM.

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