• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Line Break for item's descriptions

Hello, does anyone know the new method for line break when used in an item's text description?

I used to use "\n" and it would work, but now it doesn't?

Example:

<!--This is in progression.xml -->
<configs>
<set xpath="/progression/perks/perk[@name='perkArchery']/effect_group/effect_description[@level='1']/@long_desc_key">Bow Novice\n 10% More Damage, Shoot Spread, Faster Aim, and Reload with Bows.\nCrafting Quality: 2</set>
</configs>




image.png

 
I'm not sure about why its behaving this way, but if you put your "long descriptive text" in a "Localization.txt" file in your mod ( and link it to a unique short string like "myItemNameDesc", which you would likely put as the value for it in the XML you posted should work). The Localization.txt data used to not be synced to clients from servers but now it does.  Because of this, I would say its likely recommended to put things like the names and descriptions of things in Localization.txt

example (not tested):

<set xpath="/progression/perks/perk[@name='perkArchery']/effect_group/effect_description[@level='1']/@long_desc_key">myItemNameDesc</set>




Than in a Localization.txt file you add to your mod under /Config.  This is just an example of just an English localization/usage and for your specific usage you would only need the top line and the line beginning with myItemNameDesc, See the game's Localization.txt file (where the moddable XMl files are) for examples on how to use it for other items/blocks/etc as its a little confusion how to get all the first few fields correct

Code:
Key,File,Type,UsedInMainMenu,NoTranslate,english,Context / Alternate Text,german,latam,french,italian,japanese,koreana,polish,brazilian,russian,turkish,schinese,tchinese,spanish
myItemName,items,Gun,,,"Item Name",,,,,,,,,,,,,,
myItemNameDesc,items,Gun,,,"Bow Novice\n 10% More Damage, Shoot Spread, Faster Aim, and Reload with Bows.\nCrafting Quality: 2",,,,,,,,,,,,,,

 
Last edited:
Thanks for the reply!

I tested your method and it works, thanks!

Localization.txt

Key,File,Type,UsedInMainMenu,NoTranslate,english
perkArcheryRank1LongDesc_TEST,progression,perk Agi,,,"This is some \n Test Text for a national \n test of Line Break testing.\nTest 1 2 3 Testing in session."




progression.xml:

<configs>
<set xpath="/progression/perks/perk[@name='perkArchery']/effect_group/effect_description[@level='1']/@long_desc_key">perkArcheryRank1LongDesc_TEST</set>
</configs>






Here is the result:
image.png

Quick edit / note: it seems that for the changes to take place in Localization.txt, I had to start a saved game, exit the saved game, and start it again for the Description to actually show up.

 
Last edited by a moderator:
Alloc confirmed that localization gets updated when the main menu loads. So if editing it, do it while loaded into a game, then exit and reload into it to see your changes. Or do it before launching the game. But it is a bit backwards compared to how the xml is updated.

 
Last edited by a moderator:
Back
Top