Alice Community  

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

Reply
 
Thread Tools Display Modes
collision questions
Old
pdibiaso
Guest
 
Status:
Posts: n/a
Default collision questions - 10-20-2005, 12:40 PM

i am trying to add a maze to my world. i want to set the walls so that whatever character is being used will not walk through. is there a way to set the walls to solid?
   
Reply With Quote
Old
gabe
Administrator
 
gabe's Avatar
 
Status: Offline
Posts: 461
Join Date: Jul 2005
Location: Pittsburgh, PA
Default 10-21-2005, 12:07 PM

There is no collision detection built into Alice. What you can do is use the proximity function "<object x> is at least <y meters> from <object z>".

For example, if you want the chicken to move towards the penuin ntil it is right in front of it without touching, you can do something like:
Attached Images
File Type: jpeg noCollision.jpeg (25.6 KB, 1526 views)
   
Reply With Quote
collision
Old
pdibiaso
Guest
 
Status:
Posts: n/a
Default collision - 11-01-2005, 06:47 PM

you responded to my previous post. however, i want to use the arrow keys to move my character arround and when i use that code this does not work...i can still move the character forward (or which ever direction i am trying to go)

Last edited by pdibiaso; 11-01-2005 at 06:52 PM.
   
Reply With Quote
Old
gabe
Administrator
 
gabe's Avatar
 
Status: Offline
Posts: 461
Join Date: Jul 2005
Location: Pittsburgh, PA
Thumbs up 11-01-2005, 11:03 PM

I have merged your two threads together so as to make is easier when people are searching for information regarding collision detection.

Quote:
Originally Posted by pdibiaso
you responded to my previous post. however, i want to use the arrow keys to move my character arround and when i use that code this does not work...i can still move the character forward (or which ever direction i am trying to go)
Correct -- using the arrow keys to move a character will do nothing to prevent that character from going though other objects. You can try running an infinite loop where Alice first looks to see if one object is within x meters of another object, and then if it is, move it back (set duration to 0 seconds so it will be instant). This will sort of get around the problem, but might cause more problems.

Getting objects not to go through one another is a difficult thing to achieve, and there are certain "hacks" that you can do to try and mask the lack of collision detection. For example, in the Flight Simulator example world, the helicopter can go through the ground, but immediately there will be a crashing sound and lights flashing, to mask the helicopter intersect with the ground. Then, the helicopter moves back to the sky.

Another trick is to use a first-person perspective (i.e., use the camera as the character). Through this means, you can't go through another object. (Well, you can, but you have to move backwards.)

Keep at it!
   
Reply With Quote
Help
Old
Ashly
Guest
 
Status:
Posts: n/a
Default Help - 09-24-2011, 01:10 AM

How can we make that work for all objects? I am also trying to make a maze and I have made on of my fences a wall but all the others the character can still go though. I have tried a few things but nothing is working yet.
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,143
Join Date: Dec 2010
Location: The Twilight Zone!
Default 09-24-2011, 10:17 AM

Off Topic: This is a very old treasure.
_____

As for your question, I would gladly help you out, but the problem is I can't because I am using a laptop, and I don't have Alice installed.


██████████████████████
█░░░░░░░░░░░░░░░░░░░░█
█░▓▓▓▓░░░▓░▓░▓░░▓▓▓▓░█
█░▓░░░▓░░▓░▓░▓░░▓░░░░█
█░▓▓▓▓░░░▓░▓░▓░░▓▓▓░░█
█░▓░░░░░░▓░▓░▓░░▓░░░░█
█░▓░░░░░░░▓░▓░░░▓░░░░█
█░░░░░░░░░░░░░░░░░░░░█
██████████████████████

________________

Alice Hater? Rant Here!: http://tinyurl.com/HateAlice
   
Reply With Quote
Old
adams34
Guest
 
Status:
Posts: n/a
Default 09-25-2011, 11:03 AM

Correct -- using the arrow keys to move a character will do nothing to prevent that character from going though other objects. You can try running an infinite loop where Alice first looks to see if one object is within x meters of another object, and then if it is, move it back (set duration to 0 seconds so it will be instant). This will sort of get around the problem, but might cause more problems.
   
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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.