Inserting newline into a string

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
TechSY730
Posts: 115
Joined: Tue, 26. Jul 16, 02:51
x3ap

Inserting newline into a string

Post by TechSY730 » Fri, 12. May 17, 03:50

Is there any way to insert a newline into a string using scripts alone?

I know you can do it using XML language files, but I would like to do this using nothing but scripts. I am trying to reproduce a crash bug, and letting the reproduction be all in one file would be very helpful.

User avatar
Jack08
Posts: 2993
Joined: Sun, 25. Dec 05, 10:42
x3tc

Post by Jack08 » Fri, 12. May 17, 08:06

Short answer: You cant, you have to read the newline character from a tfile first and then format it in.

Complicated answer: its possible to force non-standard characters into a string if you manaully edit the xml, if you find where that string is defined in your script xml and replace it with \012 (the octal code for newline), it may work as intended, i havent tried this for newline, but i have done it for a parser that used \001 & \002 - side effects unknown, do this at your own risk.

probably best not to use the complicated answer in a crash test :D
[ external image ]
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”