Displaying Text and Attributes
Hello!
I am having trouble displaying text that contains 2 attribute values.
Any help would be greatly appreciated!
What I am trying to get Actor 1 to do:
-Display Text similar to the following:
And the
answer is...
10:20 (example numbers)
(Yes, on separate lines. I might change up the phrase at some point, but I really need the numbers and the colon to be in place since the numbers in both spots will change with various circumstances.)
My current set-up:
Game Attributes:
game.SpotA text
game.SpotB text
(Originally I did them as integers. I wasn't sure which to use in this case.)
Actor 1:
Rule: When pressed, display text:
Displayed Text:
And the answer is.... game.SpotA : game.SpotB
(I tried separating the lines in the code so that game.SpotA : game.SpotB had its own line. Sometimes I was able to do separate lines, but it didn't always work.)
My problem:
Getting game.SpotA : game.SpotB displaying its number values with the colon in between them. When it's just either game.SpotA or just game.SpotB in the Display Text, it does display the values by themselves, but not when both are in the Display Box together.
For example:
Display Text: game.SpotA (This works)
Display Text: game.SpotB (This works)
Display Text: game.SpotA : game.SpotB (doesn't work at all)
Main Question:
How do I make it so that I can have game.SpotA : game.SpotB be in the Display Text along with my other text?
I am having trouble displaying text that contains 2 attribute values.
Any help would be greatly appreciated!
What I am trying to get Actor 1 to do:
-Display Text similar to the following:
And the
answer is...
10:20 (example numbers)
(Yes, on separate lines. I might change up the phrase at some point, but I really need the numbers and the colon to be in place since the numbers in both spots will change with various circumstances.)
My current set-up:
Game Attributes:
game.SpotA text
game.SpotB text
(Originally I did them as integers. I wasn't sure which to use in this case.)
Actor 1:
Rule: When pressed, display text:
Displayed Text:
And the answer is.... game.SpotA : game.SpotB
(I tried separating the lines in the code so that game.SpotA : game.SpotB had its own line. Sometimes I was able to do separate lines, but it didn't always work.)
My problem:
Getting game.SpotA : game.SpotB displaying its number values with the colon in between them. When it's just either game.SpotA or just game.SpotB in the Display Text, it does display the values by themselves, but not when both are in the Display Box together.
For example:
Display Text: game.SpotA (This works)
Display Text: game.SpotB (This works)
Display Text: game.SpotA : game.SpotB (doesn't work at all)
Main Question:
How do I make it so that I can have game.SpotA : game.SpotB be in the Display Text along with my other text?
Comments
I would write it like this:
gamespota..":"..gamespotb
(like with the dot dot in there, which is used to join strings like that)
To do sep lines, are you doing this?
gamespota..":".."\n"..gamespotb
So anything that a string, put it in the quotes. and variables are just chilling wihtout quotes.
Display Text:
And the.."\n"answer is:.."\n"..game.SpotA..":".."\n".."game.SpotB"
What did I do wrong?
edit:..ohh.. nvm... you are putting the quotes in the wrong place. ... it would be more like "\nsomething"..game.something.."\nsomething else"
the reason hot magic puts "\n"..gamespotb... is because game.spotB is a attribute... and you don't put quotes outside of attributes..
Should work
should work... or according to micksolo
"\nanswer is:"..game.SpotA..":"game.SpotB
And the"\nanswer is".. game.SpotA ..":".. game.SpotB .."
It didn't work. I wrote it in the Expression Editor.
@micksolo: I tried what you said and I wrote it like this without the accompanying text (And the answer is...):
game.SpotA ..":"game.SpotB
This didn't work either.
And the "\nanswer is:".. game.SpotA ..":".. game.SpotB
I'll try it again though.
And the "\nanswer is:".. game.SpotA ..":".. game.SpotB
\answeris:
what i mean is you need to click on the "e" symbol and type in exactly as above, and when it comes to attribute, you click them from the drop down menu.
there are some who's more qualified to answer this question ^^
Andthe"\nansweris"..game.SpotA..":"game.SpotB
"\nAnd the answer is:".. game.SpotA ..":".. game.SpotB
"\nAnd the answer is:".. game.SpotA ..":".. game.SpotB
I apologize for all the trouble.