Forum rules - please read before posting.

Line Break in Dialogue Option Label

Hi!
Is there a way to include a line break in dialogue option labels? I've tried the usual solutions (copying an actual line break from notepad, using "\n" or "\n") with no success.
Any help is appreciated. Thanks!

Comments

  • Locate Conversation.cs inside /Assets/AdventureCreator/Scripts/Logic and replace line 265:

    return AdvGame.ConvertTokens (translatedLine);
    

    with:

    return AdvGame.ConvertTokens (translatedLine).Replace ("\\n", "\n");
    

    I'll make the same change to the official release.

  • Worked like charm. :)
    Thanks again Chris!

  • I´m having a similar problem. I want to put line breaks in a long text for a pop up. I created a custom Unity menu and linked the unity text field to an Adventur Creator label element in a menu. But when I copy and paste the text in the "Label text" field the text doesn´t respect the line breaks. It´s there any solutio for this?

    Thanks!

  • Good question. Is may lie on the UI side of things, but I'll take a look.

  • Thanks! You would save my life if you solve it for me. The only alternative solution I have is to put the texts with images, but that makes everything more complicated for the translation phase.

  • I will look into a more comprehensive fix for the next update, but in the meantime you can have "\n" marks be converted into line breaks by opening MenuLabel.cs and replacing:

    newLabel = AdvGame.ConvertTokens (newLabel, languageNumber);

    with:

    newLabel = AdvGame.ConvertTokens (newLabel, languageNumber).Replace ("\n", "\n");

  • edited October 2020

    It works! Thank you so much! You are the best! :smiley:
    But I think you misspelled the code. Looking at the one above I think a "\" is missing in the first "n". It didn't work for me so I tried to put it like in the post above "\n" and it worked.

    edit: oops it seems that the forum reinterprets the \ and deletes one. In the post above it looks good because it is pasted as code.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.