PDA

View Full Version : How do I make a character talk when you move into it?


badben
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?

MrMoke
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.

Funnybone
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.

chickentree
04-01-2015, 05:13 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?

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