Alice Community  

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

Reply
 
Thread Tools Display Modes
How do I make a character talk when you move into it?
Old
badben
Guest
 
Status:
Posts: n/a
Unhappy How do I make a character talk when you move into it? - 03-31-2015, 02:28 PM

I am doing an Alice project and I need the characters to talk when you move into them. I used an event listener to allow you to use arrow keys to move the camera and I want other characters to talk when you move the camera into them. How do I do that?
   
Reply With Quote
It's Do-able
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 500
Join Date: Sep 2007
Location: Austin, Texas
Smile It's Do-able - 03-31-2015, 03:23 PM

Depending on how many characters, which version of Alice you are using, and what you want them to say, there are several ways.
You might want to create a "while world is running" method that runs in an infinite loop, constantly looks through a list of objects checking for a collision between the camera, and an item from the list.
When a collision with one of the items is detected, it's up to you what happens next.
1) Same response from all.
2) Unique response from each.
3) Random responses

Each of these could pull information from parallel lists.

Last edited by MrMoke; 03-31-2015 at 03:27 PM.
   
Reply With Quote
Old
Funnybone
Senior Member
 
Funnybone's Avatar
 
Status: Offline
Posts: 177
Join Date: Jan 2015
Default 03-31-2015, 06:34 PM

There's usually a camera look-at feature.

Mixing the statements with the camera feature having them like below:

"Insert text here"
(Camera Look At)
"Insert text here"
(Camera Look At)

Those are variables that can be looped within each different statement.

They aren't hard to find. They should be on the bottom left box.


hello
















this signature loves you
   
Reply With Quote
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 212
Join Date: Dec 2012
Location: Frosno, Ca
Default 04-01-2015, 05:13 PM

Quote:
Originally Posted by badben View Post
I am doing an Alice project and I need the characters to talk when you move into them. I used an event listener to allow you to use arrow keys to move the camera and I want other characters to talk when you move the camera into them. How do I do that?
Quote:
Originally Posted by badben View Post
I am doing an Alice project and I need the characters to talk when you move into them. I used an event listener to allow you to use arrow keys to move the camera and I want other characters to talk when you move the camera into them. How do I do that?
I would add an item like a small sphere to the movie, you could use a dummy object but I have sometimes had problems with dummy or invisible objects not detecting a collision.
Next put the object where you want the camera to be looking when you "move into them."
Set the vehicle of your new object to the camera and set its opacity to something like 70% so that it is translucent but visible. When you get the movie working you can make the opacity 5-10 % so that it is not as noticeable to the user.
Create a world method that takes an object parameter and does whatever you are looking to do when you move into something.
Finally, create a while event for each object you want to react when you move into them and use the "during" section to call your method passing in the object that has triggered the event.
I have added an example movie with two objects to show you what I mean. Also note that the arrow keys do not allow you to move up and down. I used the old man's neck as the target as his center is on the ground, between his feet.
While this approach will (I believe) work for what you want, keep in mind that there are 374.375 approaches that are just as valid.

Mark
Attached Files
File Type: a2w withinTest.a2w (941.5 KB, 4 views)


Mark Henwood
mhenwood@ieee.org
   
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.