I have had a bit of a search on Google and here but I am probably not asking the right question.
Can you enter text via keyboard into an objects properties during a game, then of course display it using the standard text plane setup? I am pretty good with python but for some reason I am missing something?
I wanted to do a level progression system like on SuperNintendo games where the player would be given a password after completing a level to remember until next time and pick up at the next level. I didn’t really need a game save/load state type setup. It would be the same password for all, all the time. This could also be used to enter a players name, or a directory path for loading files. That’s 3 reasons I need help.
Thanking All In Advance
Dave (Dr S)
I think so using text strings and having the logic bricks check for the a match, right?
Here, I made a quick example on how to input text:
Another demo that might be of some use, a basic text box example:
Social: That’s insane BGE skillz, right there. Do you have a license to use those features? Seriously, though, I didn’t know you could do that with Logic Bricks alone. Absolutely worthwhile information. I’m going to put that in my personal folder of useful things.
WOW! I never new you could do that!!! Yet verry simple. Cool!
Edit: Now he is going to ask how to make what you type match up with what the password is. AND IM WAITING TOO lol
I dunno… that looks too complicated for me.
Heh, thanks, but I’m afraid I can’t take credit on the “skillz” basis. That was simply a presentation of my awsome “search skillz”.
When I first read this thread I actually started writing this complex text handler using GameKeys and alot of crap hack python code. It didn’t take me long to start thinking: “There is no way this has to be this complicated, I mean it’s text, there has to be a built in method already”, so in my moment of briliance, I used the forum search function (like for the first time in 9 months) and I typed in “text input”.
As a result I came across this thread:
Then it was simply a matter of going to blendenzo.com, downloading an already setup text environment (thanks), and implementing z3r0_d’s instructions.
It all just fit together that time.
Here’s a blend demonstrating password entry:
I used Social’s blend as a base. Hope it helps.
Edit: The password is a property attached to the middle text plane. I’ll give you a hint. It’s the URL for the coolest website there is.
yah that’s what I meant lol
no really - because for about a period of 2 weeks I used blendenzo as my homepage so that whenever I fired up my browser I’d be confronted with blender knowledge. I read all of the parts that had to do with text I think.
Oh well, no love for my brilliant one liner =(
Wow, sorry MagicMyshu. Now that I read it again, that’s exactly what you suggested. Well, hopefully the blends help demonstrate how it’s done, though.
Hey, speaking of .blends, I thought it might be cool to have a masked password input, so here’s what I whipped up. (Sorry, I used 6 lines of Python code to mask the characters. It shouldn’t be too confusing.)
I thought I recognized that bitmap text…
Hey, just a quick question. Is it possible to dump the current state of an object to file in Python? I mean can you just grab the GameLogic object and go something like:
(Just a thought from a Java programmer who’s used to being able to make a data stream from just about anything!)
I’ve tried it before with no success. My understanding is that Python writes strings out to files, so everything to be written out must be converted with str() or pickle() first. Neither or those converters recognize Blender objects or the GameLogic module, because they are not native to Python itself. That’s not to say it’s impossible. If you feel like messing around with it a bit and come up with something, let me know.
Ok, well I made my own little version of this based on the two versions from Social and Blendenzo ;),
It allows you to press enter for it to either tell you the password is correct or incorrect.
Password = w
File: >> CLICK <<
But there is a bug in it:
When you get the password correct the “Password Correct” text is red, I think making a brand new plane with the text on it would fix it, so if you really want to use this then that’s how I think you fix that.
For those at the bottom, the password is “w”, without the quotes, yes!
Thank you to all, nice and very useful
Thanks Social and Everyone for your replies and demo stuff.
I am looking through them now and it all looks great.
Sorry guys, maybe I’m looking in the wrong direction, but having tried your text input (…just open the blend file go into Play mode and type away, right?), and password input blends in 2.47 , nothing moves, meaning the properties don’t seem to be getting the keyboard input - properties in debug mode don’t show any activity while I’m typing away…
Also, I was looking to do text objects: no two thoughts about it, insert new Text Object, type the text, and Bingo! text on the screen… Nothing!
I look at Social blend, : uses Plane object connect to the properties Ahh!!! Ok I try to duplicate this,: new Plane new props, all other switches in the same place (As much as I can figure…) no scripts… Naturally nothing but a Plane appears.
Ok what is the magic ??? Please! (and thanks in advance)
This is a thread more than a year and a half old. Please do not resurrect old threads.
Instead, make new ones.
Jmdeschamps: I have the same problem
The Red Hand: I actually, don’t see a problem with this
B3D00: Why make redundant threads?