Help me! The Game crashes on my mod but i can find no Errors?

Users who are viewing this thread

The mod crashes when trying to create lords. This is because the template names have changed. Update all the battleTemplate="NPCCharacter.templateName" civilianTemplate="NPCCharacter.templateName" in AlantosianMinor_Lords.xml to the new template names and it should work.

Then the mod crashes due to alantos_lord_party_template not existing. This is set as the default for the culture in AlantosianMinor_Cultures.xml default_party_template="PartyTemplate.alantos_lord_party_template" but is not in AlantosianMinor_Templates.xml nor anywhere else. I changed it to the 1 template present and this no longer crashes.

The kingdom empire_p then crashes due to not having a leader set. This kingdom does not exist but is referenced in AlantosianMinor_Kingdoms.xml. I simply removed the relationship and the game can now enter character creation.

Sanove and Cindace appeared on the map and the game can be played. When inspecting Delilah's party the game crashed due to the culture having a typo: basic_troop="NPCCharacter.alantosiann_recruit", removed one of the n, the save is corrupted so started a new save.

Everything seems to be working. (note, 1.5.1 has added a barber npc which now needs to be set for the culture and so on 1.5.1 it crashes when opening town scene. I simply copied the empire barber to avoid this crash)

Nice mod! I tested this on 1.5.1 using dnSpy to find the issues. With the above changes the mod should work again.
 
Upvote 0
Thanks for the Help i will have a look and see if i can find the stuff. some of the things are simple renaming (i.e the party template is incorrectly named it was the original name for it but as i said it was working correctly for quite a while so that one puzzles me) and as for Empire_p thats a whole different complimentary mod i am creating to go alongside it
 
Last edited:
Upvote 0
In that case you should make sure that this mod depends on the other mod by adding <DependedModule Id="OtherMod"/> to the SubModule.xml or people might try to use it by itself which will cause a crash if the kingdom is not present.

If you want this mod to be usable as a standalone you would need to remove the relationship with empire_p.
 
Upvote 0
Sry to be a pain i tried creating my own templates and once again its crashing. Any Help
<NPCCharacters>
<NPCCharacter id="ala_bat_template"
default_group="Infantry"
is_hero="false"
level="16"
name="{=!}alantosian_lord_bat"
culture="Culture.battania"
skill_template="NPCCharacter.infantry_heavyinfantry_level16_template_skills"
is_template="true">
<face>
<face_key_template value="NPCCharacter.villager_battania" />
</face>
<Traits>
<Trait id="IsEquipmentTemplate" value="1" />
</Traits>
<equipmentSet>
<equipment slot="Item0" id="Item.battania_sword_3_t3" />
<equipment slot="Item1" id="Item.noble_long_bow" />
<equipment slot="Item2" id="Item.battania_large_shield_c" />
<equipment slot="Item3" id="Item.heavy_steppe_arrows" />
<equipment slot="Head" id="Item.helmet_with_faceguard" />
<equipment slot="Cape" id="Item.imperial_lamellar_shoulders" />
<equipment slot="Body" id="Item.battania_mercenary_armor" />
<equipment slot="Legs" id="Item.wrapped_leather_boots" />
<equipment slot="Gloves" id="Item.plated_strip_gauntlets" />
</equipmentSet>
</NPCCharacter>
<NPCCharacter id="ala_civ_template"
default_group="Infantry"
is_hero="false"
level="16"
name="{=!}alantosian_lord_civ"
culture="Culture.battania"
skill_template="NPCCharacter.infantry_heavyinfantry_level16_template_skills"
is_template="true">
<face>
<face_key_template value="NPCCharacter.villager_battania" />
</face>
<Traits>
<Trait id="IsEquipmentTemplate" value="1" />
<Trait id="IsCombatantCivilianEquipmentDefaultTemplate" value="1" />
</Traits>
<equipmentSet civilian="true">
<equipment slot="Item0" id="Item.battania_sword_3_t3" />
<equipment slot="Body" id="Item.imperial_robes" />
<equipment slot="Leg" id="Item.fine_town_boots" />
</equipmentSet>
</NPCCharacter>
<NPCCharacter id="ala_bat_template_lady"
default_group="Infantry"
is_hero="false"
level="16"
name="{=!}alantosian_lady_bat"
skill_template="NPCCharacter.infantry_heavyinfantry_level16_template_skills"
is_template="true">
<face>
<face_key_template value="NPCCharacter.villager_battania" />
</face>
<Traits>
<Trait id="IsEquipmentTemplate" value="1" />
<Trait id="IsLadyNobleEquipmentTemplate" value="1" />
</Traits>
<equipmentSet>
<equipment slot="Item0" id="Item.battania_sword_3_t3" />
<equipment slot="Item1" id="Item.noble_long_bow" />
<equipment slot="Item2" id="Item.battania_large_shield_c" />
<equipment slot="Item3" id="Item.heavy_steppe_arrows" />
<equipment slot="Head" id="Item.helmet_with_faceguard" />
<equipment slot="Cape" id="Item.imperial_lamellar_shoulders" />
<equipment slot="Body" id="Item.battania_mercenary_armor" />
<equipment slot="Legs" id="Item.wrapped_leather_boots" />
<equipment slot="Gloves" id="Item.plated_strip_gauntlets" />
</equipmentSet>
</NPCCharacter>
</NPCCharacters>
The Code doesnt represent how it appears in the XML
 
Upvote 0
Sry to be a pain i tried creating my own templates and once again its crashing. Any Help
<NPCCharacters>
<NPCCharacter id="ala_bat_template"
default_group="Infantry"
is_hero="false"
level="16"
name="{=!}alantosian_lord_bat"
culture="Culture.battania"
skill_template="NPCCharacter.infantry_heavyinfantry_level16_template_skills"
is_template="true">
<face>
<face_key_template value="NPCCharacter.villager_battania" />
</face>
<Traits>
<Trait id="IsEquipmentTemplate" value="1" />
</Traits>
<equipmentSet>
<equipment slot="Item0" id="Item.battania_sword_3_t3" />
<equipment slot="Item1" id="Item.noble_long_bow" />
<equipment slot="Item2" id="Item.battania_large_shield_c" />
<equipment slot="Item3" id="Item.heavy_steppe_arrows" />
<equipment slot="Head" id="Item.helmet_with_faceguard" />
<equipment slot="Cape" id="Item.imperial_lamellar_shoulders" />
<equipment slot="Body" id="Item.battania_mercenary_armor" />
<equipment slot="Legs" id="Item.wrapped_leather_boots" />
<equipment slot="Gloves" id="Item.plated_strip_gauntlets" />
</equipmentSet>
</NPCCharacter>
<NPCCharacter id="ala_civ_template"
default_group="Infantry"
is_hero="false"
level="16"
name="{=!}alantosian_lord_civ"
culture="Culture.battania"
skill_template="NPCCharacter.infantry_heavyinfantry_level16_template_skills"
is_template="true">
<face>
<face_key_template value="NPCCharacter.villager_battania" />
</face>
<Traits>
<Trait id="IsEquipmentTemplate" value="1" />
<Trait id="IsCombatantCivilianEquipmentDefaultTemplate" value="1" />
</Traits>
<equipmentSet civilian="true">
<equipment slot="Item0" id="Item.battania_sword_3_t3" />
<equipment slot="Body" id="Item.imperial_robes" />
<equipment slot="Leg" id="Item.fine_town_boots" />
</equipmentSet>
</NPCCharacter>
<NPCCharacter id="ala_bat_template_lady"
default_group="Infantry"
is_hero="false"
level="16"
name="{=!}alantosian_lady_bat"
skill_template="NPCCharacter.infantry_heavyinfantry_level16_template_skills"
is_template="true">
<face>
<face_key_template value="NPCCharacter.villager_battania" />
</face>
<Traits>
<Trait id="IsEquipmentTemplate" value="1" />
<Trait id="IsLadyNobleEquipmentTemplate" value="1" />
</Traits>
<equipmentSet>
<equipment slot="Item0" id="Item.battania_sword_3_t3" />
<equipment slot="Item1" id="Item.noble_long_bow" />
<equipment slot="Item2" id="Item.battania_large_shield_c" />
<equipment slot="Item3" id="Item.heavy_steppe_arrows" />
<equipment slot="Head" id="Item.helmet_with_faceguard" />
<equipment slot="Cape" id="Item.imperial_lamellar_shoulders" />
<equipment slot="Body" id="Item.battania_mercenary_armor" />
<equipment slot="Legs" id="Item.wrapped_leather_boots" />
<equipment slot="Gloves" id="Item.plated_strip_gauntlets" />
</equipmentSet>
</NPCCharacter>
</NPCCharacters>
The Code doesnt represent how it appears in the XML
Yeah I haven't really done xml mods (only gui xmls) and the exception (crash) doesn't tell me anything useful. If someone with experience in creating and using new templates for lords could help out they might figure out what's wrong.

I can tell there is a typo, slot="Legs" should be slot="Leg" and the name might crash unless you define it in another xml, otherwise adding those NPCCharacter to AlantosianMinor_Npcs.xml seems to work.

The problem is when setting a lord to use the templates, then for some reason it crashes and I have no idea how to fix it.

You should be able to use the default templates, like battleTemplate="NPCCharacter.bat_bat_template_medium" and civilianTemplate="NPCCharacter.bat_civ_template_default", until someone figures out how to make your templates work.
 
Upvote 0
Yeah it's the same error, same fix/work around solves it until someone else can figure it out:
The problem is when setting a lord to use the templates, then for some reason it crashes and I have no idea how to fix it.

You should be able to use the default templates, like battleTemplate="NPCCharacter.bat_bat_template_medium" and civilianTemplate="NPCCharacter.bat_civ_template_default", until someone figures out how to make your templates work.
 
Upvote 0
Back
Top Bottom