talking to actors?

Game Editor comments and discussion.

talking to actors?

Postby hunter84 » Sat Nov 12, 2011 3:22 am

okay in my game i want to make a character that you have to talk to is that possible?
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: talking to actors?

Postby SuperSonic » Sat Nov 12, 2011 4:10 am

Yeah it is :D

Here is one way you could do it. First you would have two actors:

1. Player: The main character that you control
2. AI: The actor you talk to

Now what you want to do is set up a key down event for the AI actor like this:
Code: Select all
AI -> Key down -> whatever button you want -> script editor ->
if(distance(Player.x, Player.y, AI.x, AI.y) <= some distance)
{
    //put your talking code here
}

Hope that helped :D
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: talking to actors?

Postby hunter84 » Sat Nov 12, 2011 5:43 am

i did that and it said
error line 1: Undeclared identifier some
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: talking to actors?

Postby master0500 » Sat Nov 12, 2011 5:46 am

post your script
master0500
 
Posts: 409
Joined: Sun Jun 26, 2011 9:42 pm
Score: 27 Give a positive score

Re: talking to actors?

Postby SuperSonic » Sat Nov 12, 2011 1:23 pm

hunter84 wrote:i did that and it said
error line 1: Undeclared identifier some

Haha, you are supposed to replace "some distance" with a number. That number is how close the player has to be in order to talk to AI :D
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: talking to actors?

Postby hunter84 » Sat Nov 12, 2011 3:35 pm

o well how far away should he be i want it to be where in the game you go in front of him and press the up key to talk
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: talking to actors?

Postby SuperSonic » Sat Nov 12, 2011 6:48 pm

hunter84 wrote:o well how far away should he be

That is for you to decide. Play around with different numbers to find one that fits :wink:
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: talking to actors?

Postby hunter84 » Sat Nov 12, 2011 8:04 pm

okay so if i replace some with 10 it says

error line 1: expected )
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: talking to actors?

Postby SuperSonic » Sat Nov 12, 2011 8:39 pm

You have to replace "some distance" not just "some". Like this:
Code: Select all
AI -> Key down -> whatever button you want -> script editor ->
if(distance(Player.x, Player.y, AI.x, AI.y) <= 10)
{
    //put your talking code here
}

That should work :wink:
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: talking to actors?

Postby hunter84 » Sat Nov 12, 2011 8:41 pm

okay thanks and i saw that you are making animations?
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: talking to actors?

Postby hunter84 » Sat Nov 12, 2011 8:46 pm

okay and should repeat be on?
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: talking to actors?

Postby SuperSonic » Sat Nov 12, 2011 8:50 pm

hunter84 wrote:okay thanks and i saw that you are making animations?

You're welcome and yes, I do make animations. Are you in need of any? :)
hunter84 wrote:okay and should repeat be on?

No :)
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: talking to actors?

Postby hunter84 » Sat Nov 12, 2011 8:54 pm

and why does the player go behind Al instead of in front of Al?
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: talking to actors?

Postby SuperSonic » Sat Nov 12, 2011 8:56 pm

It is probobly a problem with your zdepth. Try lowering the zdepth for AI
A tree never hits an automobile except in self-defence.

Want to use your joystick or controller with Game Editor? Check out my controller engine =D
User avatar
SuperSonic
 
Posts: 1443
Joined: Fri Sep 24, 2010 9:24 pm
Location: Anywhere
Score: 72 Give a positive score

Re: talking to actors?

Postby hunter84 » Sat Nov 12, 2011 9:04 pm

yes i would like to have some game art because i tried making a character and it wasn't any good.

how do i change the z depth?
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Next

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest