XML Modification Not Loading

Users who are viewing this thread

I created a mod to have all kingdoms start at war with each other. It's tested in native and works upon character creation. However, I cannot get it to go into effect as a separate mod. I've tried appending a Z to the module folder name so it loads last, thus overwriting the original file but still nothing. Does anyone have ideas on what may be causing this issue? Below are the Submodule and modified spkingdoms file for your perusal.

Code:
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Module>
    <Name value="ZKingFight"/>
    <Id value="ZKingFight"/>
    <Version value="v1.0.0"/>
    <SingleplayerModule value="true"/>
    <MultiplayerModule value="false"/>
    <Official value="false"/>
    
    
    <DependedModules>
        <DependedModule Id="Native"/>
        <DependedModule Id="SandBoxCore"/>
        <DependedModule Id="Sandbox"/>
        <DependedModule Id="CustomBattle"/>
        <DependedModule Id="StoryMode" />
    </DependedModules>
    
    <SubModules/>        
    
    
    <Xmls>
        <XmlNode>
            <XmlName id="Kingdoms" path="spkingdoms"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "CampaignStoryMode"/>
            </IncludedGameTypes>
        </XmlNode>  
       
    </Xmls>
</Module>

Code:
<?xml version="1.0" encoding="utf-8"?>
<Kingdoms>
  <!--kingdom factions-->
  <!--    faction war text
        <relationship kingdom="Kingdom.khuzait" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.battania" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.aserai" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.vlandia" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_s" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_w" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.sturgia" value="-1" isAtWar="true" />
  -->
  <Kingdom id="empire" owner="Hero.lord_1_1" banner_key="11.4.4.4345.4345.768.768.1.0.0.163.0.5.512.512.769.764.1.0.0" primary_banner_color="0xff793191" secondary_banner_color="0xffFCDE90" label_color="FF850C6D" color="FF4E3A55" color2="FFDE9953" alternative_color="FFffffff" alternative_color2="FF660653" culture="Culture.empire" settlement_banner_mesh="encounter_flag_a" flag_mesh="info_screen_flags_b" name="{=NF627oiX}Northern Empire" short_name="{=nsDj8Qxl}northern Empire" title="{=NF627oiX}Northern Empire" ruler_title="{=8pjMAqOg}Senate" text="{=fE5U9ApA}The Calradian Empire is not a monarchy. The Calradians insist on this. The emperor, formerly just a military commander, may have taken on most other affairs of state as well. Rather than be elected every few years by the Senate, he may now rule for life and often be succeeded by his son. The popular assemblies that once decided key policies may have withered away, and the Senate, a gathering of landowners, may have far less power than it did in centuries pass. But it is not a monarchy, because it is absolutely forbidden for Calradians to be ruled by a king. The Empire is what happens when a league of city-states conquers a continent. A community once led by free farmers with relatively equal wealth now has vast gaps between the rich and the poor. Institutions designed to prevent one man from becoming a tyrant come into conflict with the necessities of unending warfare, which require unified command. Without any smooth means of succession, the death of an emperor has always been a potential crisis. Usually, the emperor nominated an heir, the senate ratified his choice, and the people (meaning the army) acclaimed it. But this did not always happen smoothly, and then the succession was settled on the battlefield. The current conflict, which broke out when the late Emperor Arenicos was assassinated, is the latest of these imperial civil war.">
    <relationships>
        <relationship kingdom="Kingdom.khuzait" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.battania" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.aserai" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.vlandia" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_s" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_w" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.sturgia" value="-1" isAtWar="true" />
    </relationships>
    <policies>
      <policy name="{=8pjMAqOg}Senate" />
      <policy name="{=iWyvNzBB}Property Protections" />
    </policies>
  </Kingdom>
  <Kingdom id="empire_w" owner="Hero.lord_1_7" banner_key="11.8.8.4345.4345.768.768.1.0.0.164.0.9.512.512.769.764.1.0.0" primary_banner_color="0xff591645" secondary_banner_color="0xffFFAD54" label_color="FFDB8330" color="FF9E5072" color2="FFDE9953" alternative_color="FF1F1D1F" alternative_color2="FFc28446" culture="Culture.empire" settlement_banner_mesh="encounter_flag_a" flag_mesh="info_screen_flags_a" name="{=yG3YUySN}Western Empire" short_name="{=ZEmH0MwL}western Empire" title="{=yG3YUySN}Western Empire">
    <relationships>
        <relationship kingdom="Kingdom.khuzait" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.battania" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.aserai" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.vlandia" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_s" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.sturgia" value="-1" isAtWar="true" />
    </relationships>
    <policies>
      <policy name="{=8pjMAqOg}Senate" />
      <policy name="{=IaCpmuL5}Land Reform" />
    </policies>
  </Kingdom>
  <Kingdom id="empire_s" owner="Hero.lord_1_14" banner_key="11.45.6.4345.4345.768.768.1.0.0.162.0.7.512.512.769.764.1.0.0" primary_banner_color="0xff382188" secondary_banner_color="0xffDEA940" label_color="FF6d62b5" color="FF9382D0" color2="FFDE9953" alternative_color="FFF4CA14" alternative_color2="FF6d62b5" culture="Culture.empire" settlement_banner_mesh="encounter_flag_a" flag_mesh="info_screen_flags_b" name="{=frBQ9mbP}Southern Empire" short_name="{=GbnlN6na}southern Empire" title="{=frBQ9mbP}Southern Empire">
    <relationships>
        <relationship kingdom="Kingdom.khuzait" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.battania" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.aserai" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.vlandia" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_w" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.sturgia" value="-1" isAtWar="true" />
    </relationships>
    <policies>
      <policy name="{=8pjMAqOg}Senate" />
      <policy name="{=DrnZOsjo}Dynastic Succession" />
    </policies>
  </Kingdom>
  <Kingdom id="sturgia" owner="Hero.lord_2_1" banner_key="11.45.12.4345.4345.768.768.1.0.0.462.0.13.512.512.769.764.1.0.0" primary_banner_color="0xff224277" secondary_banner_color="0xffCEDAE7" label_color="FF1856A1" color="FF1C2A50" color2="FF949CCC" alternative_color="FFFFFFFF" alternative_color2="FF2A4B78" culture="Culture.sturgia" settlement_banner_mesh="encounter_flag_b" flag_mesh="info_screen_flags_c" name="{=PjO7oY16}Sturgia" short_name="{=C4qjBqLO}Sturgians" title="{=iYCR3xuQ}Principality of Sturgia" ruler_title="{=FmbgPGBL}Grand Prince" text="{=bVihnRUu}The confederation of small kingdoms that is now the Principality of Sturgia came into being only a century ago. As boomtowns sprung up along the great rivers of the north, the local tribal leaders forged marriage pacts with Nords and other adventurers, hiring their swords to subdue their neighbors. Under pressure from the empire, they elected a prince to lead them in war, and eventually the princes became a hereditary office. But the idea of monarchy has never sat easily with the independence-minded boyars, and the potential for rebellion always lurks under the surface of Sturgian politics.">
    <relationships>
        <relationship kingdom="Kingdom.khuzait" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.battania" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.aserai" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.vlandia" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_s" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_w" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire" value="-1" isAtWar="true" />
    </relationships>
    <policies>
      <policy name="{=EBCV0LcU}Lawspeakers" />
      <policy name="{=sg4bbc7K}Deposition" />
    </policies>
  </Kingdom>
  <Kingdom id="aserai" owner="Hero.lord_3_1" banner_key="11.45.0.4345.4345.768.768.1.0.0.463.0.1.512.512.769.764.1.0.0" primary_banner_color="0xffB57A1E" secondary_banner_color="0xff4E1A13" label_color="FFebce5e" color="FF965228" color2="FF4F2212" alternative_color="FF1F1D1F" alternative_color2="FFebce5e" culture="Culture.aserai" settlement_banner_mesh="encounter_flag_c" flag_mesh="info_screen_flags_a" name="{=NaNMRPv4}Aserai" short_name="{=NaNMRPv4}Aserai" title="{=UsbwPmYb}Sultanate of the Aserai" ruler_title="{=5djtBrHj}Sultan" text="{=qggtvf8Y}The Empire always preferred not to send its legions into the army-devouring wastes of the Nahasa. Instead, it projected its power into this borderland by cultivating client rulers among the clans, who competed in an endless dance of power. Those clans that could secure a hold on the oases won an imperial subsidy to protect passing caravans and grew rich. Those who could not were pushed into the desert, left to raise goats and raid caravans until they could plot a comeback. Today, with the waning of the empire, the Aserai have agreed to form a confederacy under a sultan chosen from richest of the clans, the Banu Hulyan. But everyone knows that the dance has only temporarily been stopped, and at the right moment it will begin again.">
    <relationships>
        <relationship kingdom="Kingdom.khuzait" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.battania" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.vlandia" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_s" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_w" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.sturgia" value="-1" isAtWar="true" />
    </relationships>
    <policies>
      <policy name="{=IPrTwc28}Tribal Assembly" />
      <policy name="{=dN5JCX8n}Council of Elders" />
    </policies>
  </Kingdom>
  <Kingdom id="vlandia" owner="Hero.lord_4_1" banner_key="11.45.14.1536.1536.768.768.1.0.0.160.0.15.512.512.769.764.1.0.0" primary_banner_color="0xff8D291A" secondary_banner_color="0xffF7BF46" label_color="ffB01301" color="FF5C2017" color2="FFECBA44" alternative_color="FFDBBA27" alternative_color2="ff910101" culture="Culture.vlandia" settlement_banner_mesh="encounter_flag_d" flag_mesh="info_screen_flags_c" name="{=FjwRsf1C}Vlandia" short_name="{=8HMyTKF6}Vlandians" title="{=lAWwcO6b}Kingdom of Vlandia" ruler_title="{=hwnp9abW}King" text="{=IudGLWQZ}The Vlandian monarchy descends from Osric Iron-Arm, a warlord who seized the western coasts of the Empire and was recognized as king by the emperors as the price of peace. He in turn recognized his lieutenants as barons and counts, granting them suzerainty over their lands in exchange for rallying to his banner in war. Some Vlandian kings have sought to expand the powers of the kingship; others have allowed the barons to feud among themselves so long as the money and manpower was there when needed.">
    <relationships>
        <relationship kingdom="Kingdom.khuzait" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.battania" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.aserai" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_s" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_w" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.sturgia" value="-1" isAtWar="true" />
    </relationships>
    <policies>
      <policy name="{=DrnZOsjo}Dynastic Succession" />
      <policy name="{=GH6FLbYm}Privy Council" />
    </policies>
  </Kingdom>
  <Kingdom id="battania" owner="Hero.lord_5_1" banner_key="11.45.2.6296.6296.768.768.1.0.0.460.0.3.509.509.767.766.1.0.0" primary_banner_color="0xff284E19" secondary_banner_color="0xffB4F0F1" label_color="FF55831A" color="FF2D3F1D" color2="FFBFCBB0" alternative_color="FFD69516" alternative_color2="FF55831A" culture="Culture.battania" settlement_banner_mesh="encounter_flag_e" flag_mesh="info_screen_flags_b" name="{=0B27RrYJ}Battania" short_name="{=bgjiFSHZ}Battanians" title="{=qaDIU0XC}High Kingdom of the Battanians" ruler_title="{=afvM7XpQ}High King" text="{=ZjaaAoxd}From time immemorial there has been a High King of Battania, crowned with great ceremony on the sacred hill of Dunthanach. Ask any Battanian chieftain, however, whose ”kingdom” he lives in, and he will look around at his hall and his fields and his pastures, his flocks and his retainers, and answer ”Mine, of course.” Only lately, following the example of the Empire, have the High Kings made any effort to exert their authority. ”Such unruly cattle as my people require a strong herdsman's hand to steer them from the ravine and protect them from the wolf,” said one recent high king, just before he was betrayed by a jealous cousin and taken in chains to the nearest imperial outpost.">
    <relationships>
        <relationship kingdom="Kingdom.khuzait" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.aserai" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.vlandia" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_s" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_w" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.sturgia" value="-1" isAtWar="true" />
    </relationships>
    <policies>
      <policy name="{=EBCV0LcU}Lawspeakers" />
    </policies>
  </Kingdom>
  <Kingdom id="khuzait" owner="Hero.lord_6_1" banner_key="11.45.10.1536.1536.768.768.1.0.0.461.11.11.512.512.768.768.1.0.0" primary_banner_color="0xff429081" secondary_banner_color="0xffEFC990" label_color="FF7CC8EB" color="FF58888B" color2="FFCCBB89" alternative_color="FF787878" alternative_color2="FF6caecc" culture="Culture.khuzait" settlement_banner_mesh="encounter_flag_f" flag_mesh="info_screen_flags_b" name="{=sZLd6VHi}Khuzait" short_name="{=vJOWy1QF}Khuzaits" title="{=bF7HmNGQ}Khuzait Khanate" ruler_title="{=hwnp9abW}King" text="{=fGNdo1BK}For centuries, the tribes in the vast steppe east of the empire were content to live as nomads, venturing into the imperial lands to raid and trade, and then returning to their ancestral freedom. Two generations ago, however, something happened far away to the east - a change in the winds, perhaps, or some terrible but distant conqueror - and the horse clans were set in motion. Urkhun the Khuzait led the clans nearest the empire into its eastern provinces, overrunning its eastern province and forming a khanate. He imposed discipline on the unruly clans, forcing them to ride to war on his command instead of simply when they wished. But after his death, the spirit of unity that he inspired was lost. His descendants still rule the khanate, but some of the other clans chaff under his authority, and others dream of becoming khan themselves.">
    <relationships>
        <relationship kingdom="Kingdom.battania" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.aserai" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.vlandia" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_s" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire_w" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.empire" value="-1" isAtWar="true" />
        <relationship kingdom="Kingdom.sturgia" value="-1" isAtWar="true" />
    </relationships>
    <policies>
      <policy name="{=IPrTwc28}Tribal Assembly" />
      <policy name="{=rqHFujhr}Sacred Majesty" />
    </policies>
  </Kingdom>
</Kingdoms>
 
I ended up with a partial solution. Putting all the core modules as a dependency allowed the launcher to start without crashing. However, now the mod fails to overwrite the original spkingdoms.xml file and so it effectively does nothing.
 
Upvote 0
I am having the same problem. I made a mod with the Visual Studio template from nexus, my only change was to modify spnpccharacters to add shields to troops. the template generated harmony, etc. no joy, mod won't load.

i then stripped the mod down based on a nexus template for updated sturgian troops, just changed npcchar references, duplicated the sturgian module.

still wont work.

if i drop spnpccharacters into sandboxcore and replace it, the mod works just fine to add shields to troops.

can't for the life of me figure out whats going on. load order etc don't seem to matter.
 
Upvote 0
(Edit: The original text relied on an assumption that a particular function was meant to parse all game XML files, however I have come to the conclusion that function is strictly for NPC conversation data.)
Sadly the original spkingdoms.xml file found here:
...\Modules\SandBox\ModuleData

Is incorrectly formatted and when the game attempts to load it an error is returned. You can see this for yourself if you copy this code to your main class in a DLL module:


The parser is also very strict and will fail if there are any tag issues, which there are in your SubModule.xml file. Replace the contents of your SubModule.xml file with this:
Code:
<Module>
    <Name value="ZKingFight"/>
    <Id value="ZKingFight"/>
    <Version value="v1.0.0"/>
    <SingleplayerModule value="true"/>
    <MultiplayerModule value="false"/>
    <DependedModules>
        <DependedModule Id="Native"/>
        <DependedModule Id="SandBoxCore"/>
        <DependedModule Id="Sandbox"/>
        <DependedModule Id="CustomBattle"/>
        <DependedModule Id="StoryMode" />
    </DependedModules>
    <SubModules>
    </SubModules>
    <Xmls>
       
        <XmlNode>
            <XmlName id="Kingdoms" path="spkingdoms"/>
            <IncludedGameTypes>
                <GameType value = "Campaign"/>
                <GameType value = "Sandbox"/>
                <GameType value = "SandBoxCore"/>
                <GameType value = "CampaignStoryMode"/>
                <GameType value = "CustomGame"/>
            </IncludedGameTypes>
        </XmlNode>
   
    </Xmls>
</Module>

It won't fix the issue with the spkingdoms.xml file, but it should at least get rid of any potential problems caused by your SubModule.xml file. As for how to correctly write spkingdoms I cannot help. It's either trial and error or somebody with deeper knowledge clarifies the correct format. I suspect we will have to wait for the game to be further developed before all the XML files are properly written.
 
Last edited:
Upvote 0
Back
Top Bottom