Ludeon Forums

RimWorld => Ideas => Topic started by: Elevator on April 28, 2018, 05:43:07 PM

Title: Add more text file references to Global RulePack
Post by: Elevator on April 28, 2018, 05:43:07 PM
In-game story generators take some words from textfiles. References to these text files are given in Defs\RulePackDefs\RulePacks_Global.xml.
The rules look like this:
  <RulePackDef>
    <defName>GlobalUtility</defName>
    <rulePack>
      <rulesStrings>
      ...
      </rulesStrings>
      <rulesRaw>
        ...
        <li Class="Rule_File">
          <keyword>color</keyword>
          <path>Words/Nouns/Colors</path>
        </li>
        <li Class="Rule_File">
          <keyword>animal</keyword>
          <path>Words/Nouns/Animals</path>
        </li>
        <li Class="Rule_File">
          <keyword>animalgroup</keyword>
          <path>Words/Nouns/AnimalGroups</path>
        </li>
        <li Class="Rule_File">
          <keyword>weapon</keyword>
          <path>Words/Nouns/Weapons</path>
        </li>
        ...
    </rulesRaw>
  </rulePack>
</RulePackDef>


However, some languages require more than one form of such words. E.g. animal words are used in different contexts in several cases (nominative, genitive, accusative) in both plural and singular forms.
Luckily, these text file references are allowed to be overriden in localizations (via DefInjections):


<GlobalUtility.rulePack.rulesRaw.7.keyword>animal</GlobalUtility.rulePack.rulesRaw.7.keyword>
<GlobalUtility.rulePack.rulesRaw.7.path>Words/Nouns/Animals</GlobalUtility.rulePack.rulesRaw.7.path>

<GlobalUtility.rulePack.rulesRaw.8.keyword>animal_accusative</GlobalUtility.rulePack.rulesRaw.8.keyword>
<GlobalUtility.rulePack.rulesRaw.8.path>Words/Nouns/Animals_accusative</GlobalUtility.rulePack.rulesRaw.8.path>

<GlobalUtility.rulePack.rulesRaw.9.keyword>animal_plural</GlobalUtility.rulePack.rulesRaw.9.keyword>
<GlobalUtility.rulePack.rulesRaw.9.path>Words/Nouns/Animals_plural</GlobalUtility.rulePack.rulesRaw.9.path>


We use this technique widely! It gives a lot of flexibility and make generated stories expressive and rich! Without it generated text were poor, incoherent and unreadable.
Unfotunately this technique has a major drawback: the number of overridable keywords is very limited and insufficient. I work on the Russian localization and we really need more file-ref-rules to override.

I believe that's easy to implement by just adding to RulePacks_Global.xml lines like:
 
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
        <li Class="Rule_File">
          <keyword>dummy</keyword>
          <path>Words/Empty_file</path>
        </li>
 

It will be a convenient and easy way to improve quality of translations for all languages! Thank you in advance!