Page 1 of 1

How would I make the other characters in my game talk?

PostPosted: Thu Aug 02, 2007 12:18 am
by lilmuleman214
How would I make the other characters in my game talk, when I go to them?

PostPosted: Thu Aug 02, 2007 1:24 am
by pixelpoop
How about using the distance function on a key down event to determine if your player is close enough to a certain character. If it is then create an actor with the text you want to display in it.

PostPosted: Thu Aug 02, 2007 1:39 am
by arcreamer
hey pixel, whats the distant function?

PostPosted: Thu Aug 02, 2007 3:15 am
by lilmuleman214
yah, it sounds cool. How Do you do that?

PostPosted: Thu Aug 02, 2007 10:38 am
by pixelpoop
it looks like this: distance( x, y, x, y);

You could use it on a key down event to create a text actor, something like this:

if ( distance(player.x, player.y, character_01.x, character_01.y)<30){
CreateActor("text_box", "script_01", "view", "(none)", 0, 0, true);}

it reads, if the the distance between player and character_01 is less than 30 pixels then create actor text_box and goto the animation script_01.

PostPosted: Thu Aug 02, 2007 5:31 pm
by lilmuleman214
Do you have to make any certain actors to get it to work, like a textbox? or things like that? And are there any events that you have to add to certain actors to get it to work?
And one last question....Where would I put that code you just showed me?

PostPosted: Thu Aug 02, 2007 6:47 pm
by pixelpoop
you have to create your text actor. then change the name and animation where it says create actor. Here is a quick example.

PostPosted: Thu Aug 02, 2007 6:49 pm
by lilmuleman214
pixelpoop wrote:you have to create your text actor. then change the name and animation where it says create actor. Here is a quick example.

thanks

PostPosted: Thu Aug 02, 2007 6:54 pm
by lilmuleman214
ok I unsterstand how to it now, but if I wanted to add more then one of these how would I do That?