text response

Game Editor comments and discussion.

text response

Postby ESL » Wed Aug 11, 2010 1:00 am

Are there any tutorials on using the text functions?

For example, the actor comes to a gate where a question is posed "What your name?"

and the user fills in the missing word "What is your name?" in order to proceed.
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: text response

Postby ESL » Wed Aug 11, 2010 2:52 am

Here is what I have so far.
Attachments
moonjangcity.ged
(1.63 KiB) Downloaded 94 times
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: text response

Postby DST » Wed Aug 11, 2010 12:10 pm

Create a text actor. In the text options dialogue, choose 'allow input - yes'.

You can choose more options in the config of the text - like get input focus - no - means that the player has to click on the actor before he can input text. Then, on this actor>keydown>enter, you can copy the text to another string, whether global string, or simply another actor's text:

strcpy(otheractor.text, text);

the variable 'text' will hold the text of whatever your text actor has in it, so the player can enter text and then retrieve it using strcpy or sprintf.

strcpy(password, text);

if you are using a string variable named password.

On mousebuttondown, you could:

strcpy(text, "");

to clear the text when the player clicks on the actor.....there's a lot you can do with it.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: text response

Postby ESL » Thu Aug 12, 2010 1:06 am

cool. I will try that. Actually, I had already solved the problem by creating a text character and then assiging it a keydown action to spell the word and then destroy the wall.

Your method is what I was trying to do but I could not figure out the code. :x

All mountains lead to the top.

Thanks!!
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: text response

Postby ESL » Sun Aug 15, 2010 8:31 am

I have it working so that when the user inputs the correct text, it destroys the wall but the keyboard focus resets itself so that the letters overlap.
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: text response

Postby Bee-Ant » Sun Aug 15, 2010 10:45 am

ESL wrote:I have it working so that when the user inputs the correct text, it destroys the wall but the keyboard focus resets itself so that the letters overlap.

Set the ZDepth?
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: text response

Postby ESL » Sun Aug 15, 2010 12:45 pm

No, that is not it. The letters type over each other.

Here is the game. You use the right arrow key to move the character and type in the missing parts of the sentence.

The answers are

is, are, do, old, you.
Attachments
moonjangcity1.ged
(5.83 KiB) Downloaded 69 times
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: text response

Postby Bee-Ant » Mon Aug 16, 2010 4:22 am

ESL wrote:No, that is not it. The letters type over each other.

Here is the game. You use the right arrow key to move the character and type in the missing parts of the sentence.

The answers are

is, are, do, old, you.

Can't open it correctly...
Make sure you have included the "data" folder
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: text response

Postby ESL » Mon Aug 16, 2010 2:19 pm

OK. I think this one will work.
Attachments
moonjangcity.ged
(5.91 KiB) Downloaded 65 times
moonjangdata.rar
(221.06 KiB) Downloaded 73 times
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: text response

Postby Bee-Ant » Mon Aug 16, 2010 3:55 pm

Ohhh...
It's because you mix the question and the answer text...
You should separate them into different actor like this http://dl.dropbox.com/u/3997355/TextInput.zip
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: text response

Postby ESL » Tue Aug 17, 2010 1:00 am

Thanks for your reply. It is still doing the same thing. What is strange is that it changes and only does it sometimes.
I think it has something to do with the key input selection being "Keys must be typed in the same order" but this is important to the game.
Attachments
moonjangcity.ged
(7.23 KiB) Downloaded 75 times
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score

Re: text response

Postby ESL » Wed Aug 18, 2010 2:54 am

I fixed the problem by making the man collide with the wall, then create the text1 actor, and a script that said if(text1,text,text == "is");
{DestroyActor("wall");}
ESL
 
Posts: 96
Joined: Mon Jun 28, 2010 2:05 am
Score: 1 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron