Changes

→‎String event IDs: add documentation
Line 570: Line 570:     
==String event IDs==
 
==String event IDs==
<span style="color: red;">'''TODO'''</span>
+
[[Modding:Event data|Events]] now use string IDs, so mods can use a unique key like <samp>Example.ModId_EventName</samp> (instead of hoping no other mod uses the same number). Prefixing the mod ID to event keys is recommended to simplify troubleshooting and avoid conflicts. For best compatibility, custom IDs should only contain alphanumeric/underscore/dot characters.
 +
 
 +
If an event has no preconditions, you must keep the trailing slash (i.e. have an empty preconditions field) to distinguish it from an event fork:
 +
<syntaxhighlight lang="js">
 +
"Example.ModId_EventName/": "...", // event: loaded automatically by the game
 +
"SomeFork": "..."                  // event fork: ignored unless it's loaded through an event script
 +
</syntaxhighlight>
    
==New C# utility methods==
 
==New C# utility methods==
translators
8,447

edits