Page 1 of 1

Text Input

PostPosted: Mon Jan 25, 2016 9:44 am
by PerrySteven
Hello, I want to make a text-adventure type game in Game Editor, but the problem is I don't know how to create an input for text like at the bottom of this picture: http://ffp4g1ylyit3jdyti1hqcvtb-wpengin ... _45_PM.png

Any help would be much appreciated.

Re: Text Input

PostPosted: Mon Jan 25, 2016 9:57 am
by MrJolteon
In the Set Text window on a text actor, click the Text Input dropdown menu and select Yes. You should be able to enter text into that actor in game mode.

Image

Re: Text Input

PostPosted: Mon Jan 25, 2016 10:05 am
by PerrySteven
MrJolteon wrote:In the Set Text window on a text actor, click the Text Input dropdown menu and select Yes. You should be able to enter text into that actor in game mode.

Image


Okay, that's a start. But how do I allow the string to display a whole line? Currently, it only displays three characters at any one time.

Re: Text Input

PostPosted: Mon Jan 25, 2016 10:14 am
by MrJolteon
Just add some spaces in the text editor, and if needed, remove them in a create actor event.

Re: Text Input

PostPosted: Tue Jan 26, 2016 4:50 am
by PerrySteven
MrJolteon wrote:Just add some spaces in the text editor, and if needed, remove them in a create actor event.


Thank you for that piece of information. Though now I have another obstacle, I want to pass the string that is typed by the user through a syntax algorithm. I think I have some idea on how to write a syntax algorithm, but trying to fetch what is typed by the player to be used in string operations is now my main problem.

Re: Text Input

PostPosted: Wed Jan 27, 2016 8:13 am
by speckford123
PerrySteven wrote:
MrJolteon wrote:Just add some spaces in the text editor, and if needed, remove them in a create actor event.


Thank you for that piece of information. Though now I have another obstacle, I want to pass the string that is typed by the user through a syntax algorithm. I think I have some idea on how to write a syntax algorithm, but trying to fetch what is typed by the player to be used in string operations is now my main problem.


You could use something like this in your text actor
if(strcmp(text, "TextHere")==0) DoAThing;

But that would compare the entire text entered I think
Not quite sure how to compare individual words if you type more than one in the line

Re: Text Input

PostPosted: Mon Feb 29, 2016 9:03 pm
by Opium
Oh you are more than unsure, spec.
You simply have no clue.

Use &string1[Index_to_the_offset_char_of_some_word]
as the first argument of the function strncmp
and how much characters to compare as 3rd.

Or use scanf to copy a word to a buffer.
It copies up to a whitespace so it is ideal for obtaining words.