Alice Community  

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

Reply
 
Thread Tools Display Modes
Open gate when camera is near
Old
dkchandler
Junior Member
 
Status: Offline
Posts: 2
Join Date: Jul 2013
Default Open gate when camera is near - 07-16-2013, 01:24 PM

I know this is probably super simple, but I can not get it to work. I just want to let the user move around in the world with the mouse and when they get close to the haunted gate it opens. I am using the 'gate distance to camera' and it is not triggering the gate to open???? Any suggestions? Thanks

Dan

Alice 2.3
   
Reply With Quote
Old
dkchandler
Junior Member
 
Status: Offline
Posts: 2
Join Date: Jul 2013
Default 07-16-2013, 02:07 PM

I figured it out.... I needed to use an IF statement and wrap that in a WHILE loop.

Dan
   
Reply With Quote
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 212
Join Date: Dec 2012
Location: Frosno, Ca
Default 07-17-2013, 11:20 AM

Quote:
Originally Posted by dkchandler View Post
I figured it out.... I needed to use an IF statement and wrap that in a WHILE loop.

Dan
You could also use an event. This would be more efficient than doing it in a method and Alice keeps track of continuously checking the event.

Mark
   
Reply With Quote
Old
AliceMaster00
Senior Member
 
AliceMaster00's Avatar
 
Status: Offline
Posts: 167
Join Date: Oct 2011
Location: You know that gap between the bottom of your dresser and the floor? Yeah, there.
Lightbulb 07-30-2013, 06:38 PM

if camera is within <threshold> of <gate-name>
do
{
<whatever>
}
else
{
nothing
}


sorry if this is confusing, im used to scripting in C# and Java, so i tried my best to match the visual scripting.

Basically, just grab the function stated above (within threshold of),
then put in whatever you'd like the gate to do. If you're making it open, i suggest creating a dummy facing the direction you would like the gate doors to face when open. Then move the dummies(one for each door) about a meter or 2 forward(make sure axis zed"blue axis" is facing the angle the doors are going to swing open to). After thats done in the do section of the if statement put this

if camera is within <threshold> of <gate-name>
do
{
do together
{
<gate-door-1> face (orient to) <dummy1>
<gate-door-2> face (orient to) <dummy2>
}
}


placing a "turn" function would make the doors turn every time you got near them, and you'll end up with the gates doing 360's through walls (if you had)
or if you used a "while" function as well.


What a piece of work is a man? How noble in reason, how infinite in faculties, in form and in motion, how express and admirable how like an angel! What apprehension oh how like a god! The beauty of thee world, the paragon of animals, and yet- to me, what is this quintessence o' dust? Man delights, not me. Nor woman either, nor woman either.
   
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.