I have a edit box, where the player can enter in somthing. I would like to know how to retrive what they typed in once they hit enter. So say they typed in, HI. If text = "Hi" then...
Im sure this is probly simple, I cant seem to figure it out.
We are the music makers, we are the dreamers of dreams...
You could save the text out as a file (with the name of the file being the text in the edit box) into your games directory and then you use the search object to search your games directory for the file name.
99 percent chance that the above post is 100 percent correct.
Hmm, I think its very sad how retrieving text is so hard, I think its pathetic on Clickteams part. How the heck are you suppost to make a text based game, like the good ol ones where you TYPE to do stuff, like PICK UP STICK.
We are the music makers, we are the dreamers of dreams...
use the 'compare two general variables' event. then just say, if "text in textbox1" equals "Hi" then add your actions. find the event under the special events i think.
I think that Mr Coffee must think you're talking about something else - Gimley's method above will work. The "get text" does exist, it's just not where you would expect to find it.
Actually, don't ignore the "Compare two general values" event, it's useful for a lot of things. For instance, rather than using "Compare counter to a value" you can use it instead.
By the way, to get rid of the case sensitivity in MMFusion you can convert the string to capitals. Use something like Caps$(Gettext$("Edit Object")) = "HELLO". (NB That's probably not the formula, I'm just making this up.)
Thanx guys for the wonderfull help, I was about to change everything to counters.
Oh and sorry about the clickteam comment, should of waited a little longer.
Has anybody attempted a good ol fashioned Text game? Im trying to remember the names of those old PC games, I think one was called Haunted House or somthing. Oh and Police Quest. Good times good times.
We are the music makers, we are the dreamers of dreams...
"Hmm, I think its very sad how retrieving text is so hard, I think its pathetic on Clickteams part"
If you've ever done strings in C\C++ you'd understand why it's hard. actually, it's about 1,000 times easier in mmf
Edited by the Author.
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
No, I understood the question. Using compare two general values will also work, but it won't work quite as well. For example, with my method if you say "hi, how are you doing" it will detect the "hi" but the compare two general values method will not.
99 percent chance that the above post is 100 percent correct.