Could anyone be so kind as to tell me how to add to a property? As in add +1, +2, +3, -1, -2, -3, you know, stuff like that.
And also, I could use some help with making something where you input text and it shows what you typed in somewhere on the screen and if you type in certain things like give_cube it spawns a cube, because I’m trying to make something like the console that is in most games that use the quake engine or a modified version of it, and in order to do that, I need to learn to switch properties and be able to input text. Thanks to all/anyone who replies.
EDIT: And by input text, I mean in a raw_input() kind of way. But I don’t know if raw_input() works in blender python
NameError: name ‘raw_input’ is not defined
Blender Game Engine Finished
Blender 2.63 by the way
try this (for an object with … python script and …) and property (Integer!) aInt
import bge, bpy
#res = raw_input()
c = bge.logic.getCurrentController()
c.owner['prop'] = "peter was here"
c.owner['aInt'] += 12
Sorry, but I am completely new to Blender python :o so I have a few questions… Do I have to put the name of the object in there? And where do I put the name of the property I want it to change? Also, in logic, do I make it like Keyboard - Python - and then what actuator if I need one?
EDIT: And also I use v2.59, if that is of any interest.
in python 3.2 it’s just
your_name = input("type your name here >")
the console/terminal will halt the python process until a user types a response or hits enter. Not sure if that works for BGE, but ‘raw_input()’ doesn’t exist as a function anymore.
Now how do I get that to be a property so I can make it appear on screen? Or just anyway I can make it on screen would be fine.
Is this for BGE for some kind of hud/console? I know nothing about BGE.
The “Chromoly ruler” tool accepts user input in 3dview, perhaps dig through that.
Hud and console both, yes. I need to learn about blender python a little bit more before asking questions about it. It’s a bit like someone who just started using blender asking how to make a FPS or something.