A chat functoin that replies

Game Editor comments and discussion.

A chat functoin that replies

Postby supa-tails » Wed Oct 15, 2008 10:08 pm

Ok, I have been having trouble with this for way to long now, and my small forums doesn't have too many people who understand good code (Except Kall and J2Graves) But I want to know how to make a text actor reply to what you say using a if command, example:
If ( textinput.text = "hi")
{textoutput.text = "hello! =D"}
I know this code won't work and I have a longer script for it in the game but it doesn't work anyway so I am just giving an example. Please help :D
................................................................................................ www.freewebs.com/thebiverse .....................................................................................




c'ya on the other side
User avatar
supa-tails
 
Posts: 269
Joined: Fri Jul 27, 2007 3:03 pm
Location: In an aliens tummy... Or in cumming Georgia USA
Score: 17 Give a positive score

Re: A chat functoin that replies

Postby feral » Thu Oct 16, 2008 2:10 am

supa-tails wrote:Ok, I have been having trouble with this for way to long now, and my small forums doesn't have too many people who understand good code (Except Kall and J2Graves) But I want to know how to make a text actor reply to what you say using a if command, example:
If ( textinput.text = "hi")
{textoutput.text = "hello! =D"}
I know this code won't work and I have a longer script for it in the game but it doesn't work anyway so I am just giving an example. Please help :D



do you want the actor to respond to random input ? or are you going to supply a list of possible things to say ?

eg: say to actor (input box)
1. hi
2. bye
3. do you know where the dragon is ?
4. prepare to die !

select choice eg getkey pressed...

then in code
if (choice==1)
{
textactor.text="hello !"
}

etc ? ? ?
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: A chat functoin that replies

Postby Fuzzy » Thu Oct 16, 2008 6:04 am

An ancient problem. The early adventure games like kings quest had to deal with this. What you do is compile a list of words in catagories, storing them in arrays. For example, hi, hello, hiya, hey. are all equivalent. Then special catagories like player, self, other and proper names as well for nouns. You build a type of variable to reflect what the sentence means, rather than the actual words. so you might have

01 56 which means "hello person" which is the same as "hello Fuzzy". This simplifies programing and figuring out responses!. So if the players text was encoded as 01 50, that might be "hello player" which could cause the other actor to ask why you are saying hello to yourself, or they could say "no my name is..."

You only really have to do this for the possibilities that the player could type out. The other actors responses could be canned text. Of course, you will never ever get all the possibilites, so you have to have a catch all response for "What did you say?", perhaps "Say that a different way, I dont understand."

Use proper language. Do not require the player to use lol and smilies or other internet codes. It will be far less confusing.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: A chat functoin that replies

Postby Kalladdolf » Thu Oct 16, 2008 8:16 am

I think what supatails wants is a chatbot that replies with certain messages to certain messages typed in by the user.
Further it should be programmable (that means that while running the chatbot, you can still customize your chatbot replies).
But that shouldn't be too difficult, I'm fixing up a demo for him.
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: A chat functoin that replies

Postby supa-tails » Sun Oct 26, 2008 4:03 pm

Sorry for the delay in replying! :o Anyway, what I want is something where if I were to say "Hi chatbot!" then the chatbot would reply with something like "Hi supa tails!" Or whatever you set your name to be. But I would like kind of what fuzzy was saying where he randomly replies with something accordingly, such as "hi (yourname), hello (yourname), yo (yourname), hiya (yourname)" ect. With many combinations that I wouldn't mind programming, as long as I know what I'm doing. Like if you custom type your name to be "supa tails" than you custom type the chatbots name to be "kalladolf" than the following conversation might sound something like this:
"Hi Kalladolf"
"Hiya supa tails, how are you?"
than the conversation would advance like if I say:
"My day was good, how about yours?" he would reply something like:
"Great, (random sequence here)" Random sequence such as he chooses from a list of nouns, verbs, and adjectives randomly and puts them in the proper order, sounding like this:
"Great, I ate a yellow dog but he was crunchy" Just as an example, because it probably won't make sence but this is kinda the only realisticly possible way I can think of doing it.
................................................................................................ www.freewebs.com/thebiverse .....................................................................................




c'ya on the other side
User avatar
supa-tails
 
Posts: 269
Joined: Fri Jul 27, 2007 3:03 pm
Location: In an aliens tummy... Or in cumming Georgia USA
Score: 17 Give a positive score

Re: A chat functoin that replies

Postby jimmynewguy » Sun Oct 26, 2008 6:31 pm

http://game-editor.com/forum/viewtopic.php?f=1&t=6214
when i gave you that example it wasnt what you needed?
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: A chat functoin that replies

Postby supa-tails » Mon Oct 27, 2008 12:18 am

OH YEAH! When I tried that I couldn't understand any of it. Do you think you can make something like that without the sword? something simple like:
if (textinput.text = "hi")
{textoutput.text = "hello}
................................................................................................ www.freewebs.com/thebiverse .....................................................................................




c'ya on the other side
User avatar
supa-tails
 
Posts: 269
Joined: Fri Jul 27, 2007 3:03 pm
Location: In an aliens tummy... Or in cumming Georgia USA
Score: 17 Give a positive score

Re: A chat functoin that replies

Postby jimmynewguy » Mon Oct 27, 2008 10:57 am

ok ill fix it when i get back from skewl (:lol: attempted humer)
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: A chat functoin that replies

Postby supa-tails » Sun Nov 02, 2008 2:25 am

lol I'm waiting XD no pressure
................................................................................................ www.freewebs.com/thebiverse .....................................................................................




c'ya on the other side
User avatar
supa-tails
 
Posts: 269
Joined: Fri Jul 27, 2007 3:03 pm
Location: In an aliens tummy... Or in cumming Georgia USA
Score: 17 Give a positive score

Re: A chat functoin that replies

Postby BlarghNRawr » Sun Nov 02, 2008 10:16 pm

i just saw something and im not sure if you know this yet...

but for the chat, it just needs to recognize a few words, not the whole sentance... like instead of putting a reply for:

hello, what is your name,
or: hey, whts ur name?
or: anything else like this,

just make ge check if the line has the words name and a ? in it, then replies with his/her/its name, then you dont need to make replies for everything...

not sure if this helps :/
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: A chat functoin that replies

Postby supa-tails » Mon Nov 03, 2008 11:13 pm

yeah that is kinda what I am going for but I don't know how complicated it will be until I learn how the scrips for this works.
................................................................................................ www.freewebs.com/thebiverse .....................................................................................




c'ya on the other side
User avatar
supa-tails
 
Posts: 269
Joined: Fri Jul 27, 2007 3:03 pm
Location: In an aliens tummy... Or in cumming Georgia USA
Score: 17 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron