[Lua] text modification question

Nefliqus

Prince
Joined
Sep 16, 2010
Messages
400
Location
Poland
How to make new text line in Civ5 Lua? In player notification tag "\n" dosent work? What I did wrong:

ScripSetText = ScripSetText .. " " .. CivName1 .. "<-->" .. CivName2 .. "=" .. ProximityToPlayer .. "\n";
ScripSetText = ScripSetText .. " " .. CivName3 .. "<-->" .. CivName4 .. "=" .. ProximityToPlayer2 .. "\n";
player:AddNotification(NotificationTypes.NOTIFICATION_DIPLOMACY_DECLARATION, ScripSetText , "Map setup description...", 1, 1);

the result is that "\n" is ignored and notification text is displayed in one line, wraped at notofication window end.
 
If it's anything it will be

[NEWLINE]

but I haven't checked if that works in the notification panel
 
If it's anything it will be

[NEWLINE]

but I haven't checked if that works in the notification panel

as this?
ScripSetText = ScripSetText .. " " .. CivName3 .. "<-->" .. CivName4 .. "=" .. ProximityToPlayer2 .. "[NEWLINE]";

or

ScripSetText = ScripSetText .. " " .. CivName3 .. "<-->" .. CivName4 .. "=" .. ProximityToPlayer2 .. [NEWLINE];

I cant test it now.
 
as this?
ScripSetText = ScripSetText .. " " .. CivName3 .. "<-->" .. CivName4 .. "=" .. ProximityToPlayer2 .. "[NEWLINE]";

or

ScripSetText = ScripSetText .. " " .. CivName3 .. "<-->" .. CivName4 .. "=" .. ProximityToPlayer2 .. [NEWLINE];

I cant test it now.

The first one. But unless later lines of code concatenate more text onto ScripSetText putting a new line at the end of a line of text probably won't achieve anything anyway
 
so does [NEWLINE] work only as last position in text not inside text?

EDIT
OK i have checked it and [NEWLINE] work ok, thank you

[NEWLINE] generates a new line - so "Line 1[NEWLINE]Line 2" would display as two lines.

What I'm not sure is if "Line 1[NEWLINE]" would also display as two lines with the second one blank - as most UI components will remove trailing white space
 
Back
Top Bottom