Results 1 to 2 of 2

Thread: Finding incorrect usages of "\" with Notepad++

  1. #1
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Finding incorrect usages of "\" with Notepad++

    "\n" is used in game description files to represent a line break. e.g. In historic_events.txt: "This is the first line.\nThis is on another line."

    If you follow the "\" with any other character besides "n", including spaces, then the entire description is broken and the game shows no text at all where that description is supposed to be. It is very easy to accidentally leave out the "n", or accidentally delete it, or to do something like "this \ that" (instead of "this / that"). You won't know that your game has a problem until somebody happens to stumble across it in-game; the game does not report these errors. It happened to me once and it took a long time to figure out what the cause of this bizarre behaviour was.

    Fortunately it is easy to find them with some text searching. This is how to do it in Notepad++...

    1) Use the Find function (CTRL+F)
    2) Choose the Regular expression Search Mode option
    3) For the find text use: \\[^n]

    It can also be used with Notepad++'s Find In Files function which will search all of your files at once.

    That's all. Simple and quick to do, every now and then, just to make sure that all is okay.

    ~~~

    Related topic: Finding/fixing EOL & Encoding problems in Notepad++. It has some screenshots of the options I'm talking about above.
    Last edited by Withwnar; June 13, 2015 at 01:08 AM.

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Finding incorrect usages of "\" with Notepad++

    Pity that \n principle doesn't work with settlement names. It displays a rectangle instead, guess it's hard coded for one line only.










Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •