Keyboard input

Hey,
Is there a command to get input from the keyborad? Like to type in answers to math problems?
If not, I can use logic brick sensors for all 20 keys (num-pad and those other ones) :frowning: :x :frowning: :x :frowning:

You can use a keyboard sensor to store a sequence of keys that the user types, but it only stores strings. I remember seeing a password demo that used this.

Unfortunately I canā€™t find the demo now, maybe someone else still has it.

that would realy be helpful if somone could find somthing like this, and I would want strings anyway.

http://mhserver5.biz/~sutaitk1/keylog.blend

Nice sample Sutabi. Btw I was thinking about something. Like creating a game console. What if you make it so using blender fonts, you can hit ā€˜TABā€™, a console comes out and then you type /health, and you get 100 extra health :P. I was always thinking about this, it would be nice to have things inside the game running using the console you build inside the game. I can already do this with the blender console, but not inside a game with own made console. :-?

oh your killing me ^_- I see what I can do then hehā€¦

thank you. this is for a multiplication table game i am making for my little brother. maby iā€™ll post it when iā€™m done. (if you want to practice your multiplication tablesā€¦) :wink:

Iā€™m trying to do this as well but the only thing that I can think of is using the strings and attach them to actuators somehow maybe with a little pythonā€¦

hey sutabi, mind seeign if you can port my bloded module to the game engine?

j/k though it is in a way nice to see that JMS aint the only one who pumps out scripts etc. like a machine.

MacBlender

Hah funny I havenā€™t even started htis yet I am tring to finish up this php mysql shop plus I got my real jobā€¦ probably later tonight ill work on it

jeese with the way you and jms go i dinā€™t think you had jobs.

MacBlender

The script is just about done! The only problem right now is that the commands you give kinda repeats and another command is given =_=.

The way I set is up is that its ready the commands that end in ; and converts it into a fucntion, so there is not a bunch of if statments like:
if command == ā€œHealth;ā€
print Health

Code is messy but I am tried, and missin J leno! Ill fix/clean tomarrow

COmmands are entered by Enter key and must end in ; Which must be a varible on the player(which is the camera in this file) So Health; is a vailid command health; is not.

http://mhserver5.biz/~sutaitk1/command.blend

Yeah cool, I check when Iā€™m home. The problem is I can code the type health and print health in python easely. But the real strick is, let it show in a menu in the game engine and with a blender font :stuck_out_tongue:

Anyways I check the command thingy when Iā€™m home. 8)

instead of ifs you could go the ID way and use select case statements.

iā€™ve played around with the source for Q2 and the mod source for Q3 and thats how they do their console.

MacBlender

I fixed the script. The cube is the player this time so Click the cube and properties to extend the commands.

http://mhserver5.biz/~sutaitk1/images/command.jpg
http://mhserver5.biz/~sutaitk1/command.blend

hey sutabi, now add switches

i want to go ā€œHealth 100ā€ and have it set health at 100!

MacBlender

I already got that working now. Also cool this is you can make up your own property ^_-

Termenology:
Property: an Element of the object, also can create elements with Set synax.
Value: the return/input data of the Property
Type: varifies which kind of value is input
-----Types: i => set type to interger, f => set type to Float, blank will consider it as a string

Set Synax:
Property ValueType;
i.e.
Mana 100i; # sets Mana property as 100 interger(a number)

Get Synax:
Property;
i.e
Mana; #the property must be already created. To create a property use Set Synax
Prints: 40

same link to fileā€¦
http://mhserver5.biz/~sutaitk1/command.blend

Are you happy now Mac???

nope not really

now you need to add the ability to understand the tidle (~) and brign the console down so that i can be used then go back up when you hit tidle again.

MacBlender

Please do post it I would be interested in seeing it an maybe using it for my computer center kids.

thank you. this is for a multiplication table game i am making for my little brother.

Lol, I was just thinking about making one for my cousins. Well one that teaches multiplication and has a game for it. Hehe, with the other stuff Iā€™m doing I think Iā€™ll end up making one for algebra to be safe, lol.

Thumbs up to Sutabi. Woohoo, in game consoles. This is pretty cool. Could be used in many things. Wonder what Iā€™m going to use it for, Iā€™ll find a use :smiley: .

Jason Lin