That would also print the same thing.
Similarly, in Blender, if you ran;
own.text = 'One
Two'
it would display;
One
Two
But if you run
foobar = 'One
Two'
own.text = foobar
it displays
One
Two.
I can’t figure out why this happens. I know I could make a system that - using a monospaced font - every so-many characters went down a line, but, a) What if I don’t happen to be using a monospaced font and, b) I’m too lazy.
Let me explain a bit further - I’m making a system wherein once the player passes a certain point, a text box shows up, saying something.
The way i’m doing this is to make invisible ‘activator’ objects. These objects have two game properties, one that’s the exact same for all of them - called ‘activator’ and set to ‘0’, used for collision detection with the character - and one that’s called “message”. Essentially, when the player touches one of these, it gets the value of ‘message’ (using .hitObject) and displays it.
It seems as if whenever I get a value from a game prop, as opposed to a normal variable or plain string,
dosn’t work.
Yeah, I tried it, with no luck.
Also, I’m not actually sending a message, there’s no ‘.body’. “message” is just the name of the game prop on the invisible activator object thingy that is assigned to a string of whatever I want the text-box to say.
Is there any other way of storing strings, than, you know, strings? because then maybe I could change it to that, then back…
The "
" notation is a Python notation (also used in Java and other languages). When you enter strings into the GUI "
" will be interpreted as two character as it does not use this notation.
If you really want to use this character combination as <cr> you need to convert the string with Python. I do not have the exact code here, but a simple string replacement should do the trick.
EDIT: I did some tests. It seems the GUI uses the
notation. But when entered as property value the
interpretation does not take place.
The best bet is to copy the property value with Python. I guess it can even be the same container.