Say I have a mod that checks to see if you have enough items for a recipe in your inventory, and want to report
"{You-are-missing} X (localized-string)" to the player....
or like this....
player.print( (ingred.amount*n).."x ".. ingred.name );
How to concat to localized string?
Re: How to concat to localized string?
Thanks. It's important that the first item in the list be a string, and not a localization sub-string...
*shrug* something like that... can actually have lots of levels of nested concatenations.
How to insert a line-break ?
Code: Select all
-- levels is recursive levels of a routine for instance....
local leader = { "" };
for i = 1,levels do
leader[#leader+1] = "--+";
end
leader[#leader+1] = {"item-name."..item}, {"times_x"},
player.print( { "", leader, {"item-name."..item}, {"times_x"}, " and ", } );
How to insert a line-break ?
Re: How to concat to localized string?
If wherever you are using it supports line breaks, "\n"
Re: How to concat to localized string?
player.print didn't ... it just left it as one long line; I ended up just doing multiple prints and building a array of lines instead of one line with linebreaks.Nexela wrote:If wherever you are using it supports line breaks, "\n"