Changes

Jump to navigation Jump to search
→‎String formats: + asset name and translation key
Line 16: Line 16:  
* Use namespaced IDs prefixed with your [[Modding:Modder Guide/APIs/Manifest#Basic fields|mod's unique ID]]. For example, if your mod ID is <code>Example.PufferchickMod</code> and you're adding a pufferchick plushy, your item ID would look like <code>Example.PufferchickMod_PufferchickPlushy</code> (or optionally <code><nowiki>{{ModId}}_PufferchickPlushy</nowiki></code> in a [[Modding:Content Patcher|Content Patcher pack]]). Although the game doesn't validate the ID format, you're '''strongly encouraged''' to use this exact format to maintain good mod compatibility, avoid ID conflicts, and allow automatically determining which mod added custom content.  
 
* Use namespaced IDs prefixed with your [[Modding:Modder Guide/APIs/Manifest#Basic fields|mod's unique ID]]. For example, if your mod ID is <code>Example.PufferchickMod</code> and you're adding a pufferchick plushy, your item ID would look like <code>Example.PufferchickMod_PufferchickPlushy</code> (or optionally <code><nowiki>{{ModId}}_PufferchickPlushy</nowiki></code> in a [[Modding:Content Patcher|Content Patcher pack]]). Although the game doesn't validate the ID format, you're '''strongly encouraged''' to use this exact format to maintain good mod compatibility, avoid ID conflicts, and allow automatically determining which mod added custom content.  
 
* Only use alphanumeric (a–z, A–Z, 0–9), underscore (<code>_</code>), and dot (<code>.</code>) characters in string IDs. This is important because they're often used in places where some characters have special meaning (like file names or [[#Game state query|game state queries]]).
 
* Only use alphanumeric (a–z, A–Z, 0–9), underscore (<code>_</code>), and dot (<code>.</code>) characters in string IDs. This is important because they're often used in places where some characters have special meaning (like file names or [[#Game state query|game state queries]]).
 +
 +
===Asset name===
 +
An ''asset name'' uniquely identifies a [[Modding:Editing XNB files|game asset]]. These usually match files in the game's <samp>Content</samp> folder, but mods can add custom assets using [[Modding:Content Patcher|Content Patcher]] or the [[Modding:Modder Guide/APIs/Content|C# content API]].
 +
 +
For example, <samp>Portraits/Abigail</samp> contains [[Abigail]]'s portraits.
 +
 +
Asset names '''do not''' include the <code>Content/</code> prefix, file extension, or locale code. For example, the <samp>Content/Data/Achievements.de-DE.xnb</samp> file has asset name <samp>Data/Achievements</samp>.
    
===Color===
 
===Color===
Line 225: Line 232:     
See [[Modding:Tokenizable strings]] for more info.
 
See [[Modding:Tokenizable strings]] for more info.
 +
 +
===Translation key===
 +
A ''translation key'' uniquely identifies where to find translatable text, in the form <samp>{{t|asset name}}:{{t|key}}</samp>. For example, <code>Strings\\StringsFromCSFiles:spring</code> will look for a <samp>spring</samp> key in the <samp>Strings\StringsFromCSFiles</samp> asset file in the content folder.
 +
 +
This is often used in game code (''e.g.'' via <code>Game1.content.LoadString</code>) and in data assets (''e.g.'' via the <samp>LocalizedText</samp> [[#Tokenizable string|tokenizable string]] token).
    
===Trigger action===
 
===Trigger action===
translators
8,445

edits

Navigation menu