How do you enter multiple lines of text in a text game attribute?

TrendyTrendy Member, PRO Posts: 6
Saw this video by Tshirtbooth:


Cannot figure out how he managed to enter multiple lines of text in the game attributes he created. I am using the 10.00 indows version of GameSalad. I tried Shift plus Enter, Ctrl plus Enter, Alt plus Enter... Nothing. Anyone have clue?

Comments

  • RiffelRiffel Member Posts: 1,272
    use \n "LineOne\nLineTwo"
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Make sure you enter that through the expression editor though, not just in the text box portion of the window.
  • vikingviking Member, PRO Posts: 322
    This works great if I use the expression editor, but I can not get it to work if I use a table cell value. Any idea of how I can use the \n in a table? I have all of my text in tables to make it easy to change language since I have localized the game to 11 languages.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hi @viking Maybe try making another Text attribute, LatestTEXT, say…

    Then something like Change Attribute scene.LatestTEXT to tableCellValue(your table,your row,yourcol)

    THen Display Text (or whatever else you need to d with the table cell value) should show OK with the \n included…

    Display Text scene.LatestTEXT

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • DigiChainDigiChain Member, PRO Posts: 1,288
    This worked for me:

    1. Create a new text document in TextEdit (Word would prob work too).

    2. Type your text as you want it on as many lines as you wish (using ENTER to create a new line etc. as you would normally with TextEdit).

    3. Copy and paste this into the table cell. Doing this seems to somehow copy over the 'new line' info too.

    4. Smile.
  • vikingviking Member, PRO Posts: 322
    Thanks guys :) I couldn't make the change attribute approach work as it just displays the /n in the text. Maybe I did it wrong... I tried by changing attribute scene.text.object Scene 1 Text.Text into my table cell value and then displaying the attribute. I also tried to change attribute game.next.text into the table cell value and then displaying game.next.text, but got the same result... Is the scene.LatestText key to the solution here? In other words, do I have to unlock the text actor and use the scene attributes?

    @DigiChain Nice one :) This did work, but it also created a very large gap between the lines. It is also a lot more work to copy and paste all the text for all the languages than adding \n where I would like a line break.

    Still, I will go with option 2 unless someone has a way to use the \n in the table cell value or can explain what I am doing wrong in trying the approach @gyroscope proposed.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited October 2013

    Still, I will go with option 2 unless someone has a way to use the \n in the table cell value or can explain what I am doing wrong in trying the approach @gyroscope proposed.
    Hi again, you didn't do anything wrong, I told you wrong! I thought that would work but I've just tested (on Mac) and it didn't…

    OK, take two: what does work to get multiple lines in table cells is alt return. This makes a new line every time, in the cell, and it shows fine in Display Text on a Mac, so fingers crossed it'll work fine on a PC...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • vikingviking Member, PRO Posts: 322
    Thanks @gyroscope this work the same way suggested by @DigiChain, but the small issue with the lines being too far apart is the same. The good news is that the alt return is much faster to edit my text cells, but the bad news is that the space added between the lines is so big that it looks too strange on screen. It looks like the text is disconnected with the big distance between the lines.

    Any other ideas? When I use the \n in the display text behavior the second line of text is right below the first line and it would be great if I can get this to work somehow.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited October 2013

    A shame that didn't work, although it seems OK on the Mac, as I said… maybe if this way and @DigiChain way both don't look right with too much line spacing, there's an oversight/glitch in the Windows version here… (although I'm assuming only you're using Windows GSC, like @evetteg7 who started the thread).

    So what to do… does checking Wrap inside actor help? If not, the only other thing I can think of is to have each line in its own column, so then you can change them:

    Display Text tableCellValue(your table,your row,1).."\r"..Display Text tableCellValue(your table,your row,2).."\r"..Display Text tableCellValue(your table,your row,3)

    Apart from that I can't think of anything else, I'm afraid… other than not using tables but individual Text attributes...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • vikingviking Member, PRO Posts: 322
    Hi there @gyroscope

    Thanks for your help on this, but wrapping the text in the actor did not make a difference and changing the cell values at this stage (just before submitting) is probably not worth it as it will take me a week to re-wire all the text lookups.

    But thanks anyway.

    P.S. I am using the Mac version, so this is not a PC issue. I also made an ad-hoc build to check on the device and the extra wide gap is present on the device as well.
Sign In or Register to comment.