Jump to content

Photo

[MOD HELP] Unable to save a game after editing a faction's troops

mods modhelp help modding save failed troops

8 replies to this topic

#1
kloude9

kloude9

    Journeyman

  • Members
  • Pip
  • 37 posts

Hello,

 

This is my first time making any sort of mod for any game so any advice may be helpful. The other day I started working on an overhaul for Sturgia's troops. I made a copy of spnpccharacters, opened it in notepad++ and got started. After finishing I replaced the vanilla file with mine in the game folders and started up the game. I started a new game and was immediately hit by an inability to save my game at all. Autosaves, quicksaves, manual saves all gave me an error message: Save Failed! Cannot create save data. I looked at the troop tree for Sturgia in the encyclopedia and everything looked right at least. So to test what could be causing the save failure I started importing small chunks of changes to the vanilla file one at a time and loading up a new game to test it out. This was last night, I was doing a few characters at a time and after a couple tries I noticed that I couldn't quicksave with the f5 key and the game didn't seem to be autosaving either from what I could tell. I could still manual save however. So today I decided to try again but this time make changes one troop at a time. Everything seemed to be going fine after the first 2-3 changes, except that autosaving seemed to not happen very often but I usually don't pay attention to autosaves so I don't know. After one change though I could play for a few minutes but then all of a sudden save started failing again. I took a look at that troop and I can't find anything wrong with the syntax or any items its using that aren't used by other troops in the vanilla file. I found it odd that with all the changes I can't save from the get go, but after only a few changes it takes five or so minutes to start. I don't know if that implies something goes wrong once certain units spawn in or what. 

 

I'm pretty much at a loss as to what to do next to troubleshoot this. I see other people making unit overhauls with no problem but I'm sitting here unable to save. I don't and have never had this issue in my normal games without these troop changes. Any help would be appreciated.



#2
DeckardKain

DeckardKain

    Regular

  • Supporter
  • PipPip
  • 88 posts

just a wild guess that it is because you are modifying the vanilla files directly (volatile modding) instead of making a submodule.
pretty sure the save system needs to keep a consistent base structure of the xml tables.
 



#3
kloude9

kloude9

    Journeyman

  • Members
  • Pip
  • 37 posts

just a wild guess that it is because you are modifying the vanilla files directly (volatile modding) instead of making a submodule.
pretty sure the save system needs to keep a consistent base structure of the xml tables.
 

 

Ok, I've been thinking about doing that to test if it fixes it so I guess I will. I read a tutorial yesterday but it was pretty barebones so I think I'll have to use some of the mods I have installed as a reference for how to actually get it to replace the vanilla code with my mine. Do you have experience with creating submodules? If so would you mind if I asked you a question or two on the topic later if I'm having difficulties?



#4
DeckardKain

DeckardKain

    Regular

  • Supporter
  • PipPip
  • 88 posts

sure thing, I love to help if i can.

its not very hard to make a submodule.

you can use this as a base, its a SubModule.xml I made to inject into partytemplates.

<?xml version="1.0" encoding="UTF-8"?>

-<Module>

<Name value="My party templates"/>

<Id value="zzzMyPartyTemplates"/>

<Version value="v1.0.6"/>

<SingleplayerModule value="true"/>

<MultiplayerModule value="false"/>


-<DependedModules>

<DependedModule Id="Native"/>

<DependedModule Id="SandBoxCore"/>

<DependedModule Id="Sandbox"/>

<DependedModule Id="CustomBattle"/>

<DependedModule Id="StoryMode"/>

</DependedModules>

<Official value="false"/>

<DependedModules/>

<SubModules/>


-<Xmls>


-<XmlNode>

<XmlName path="zzzMyPartyTemplates" id="partyTemplates"/>


-<IncludedGameTypes>

<GameType value="Campaign"/>

<GameType value="CampaignStoryMode"/>

</IncludedGameTypes>

</XmlNode>

</Xmls>

</Module>

the important part is this 

<XmlName path="zzzMyPartyTemplates" id="partyTemplates"/>

where xmlname path is the name of your edited xlm, and the ID the name of the xlm where you want your submodule to inject into.
you can setup multiple paths in the same submodule.


btw another thing i was thinking off since you said you edited with notpad++
If you are new to xml editing its kind of easy to mess up when editing with just a text editor.
you got to make sure you keep table structure intact and line breaks,spaces and tabs can mess it up.
copy paste is your best friend and also make sure you set notpad++ to xml so you easier can see the xml tree structure.



 



#5
kloude9

kloude9

    Journeyman

  • Members
  • Pip
  • 37 posts

sure thing, I love to help if i can.

its not very hard to make a submodule.

you can use this as a base, its a SubModule.xml I made to inject into partytemplates.

<?xml version="1.0" encoding="UTF-8"?>

-<Module>

<Name value="My party templates"/>

<Id value="zzzMyPartyTemplates"/>

<Version value="v1.0.6"/>

<SingleplayerModule value="true"/>

<MultiplayerModule value="false"/>


-<DependedModules>

<DependedModule Id="Native"/>

<DependedModule Id="SandBoxCore"/>

<DependedModule Id="Sandbox"/>

<DependedModule Id="CustomBattle"/>

<DependedModule Id="StoryMode"/>

</DependedModules>

<Official value="false"/>

<DependedModules/>

<SubModules/>


-<Xmls>


-<XmlNode>

<XmlName path="zzzMyPartyTemplates" id="partyTemplates"/>


-<IncludedGameTypes>

<GameType value="Campaign"/>

<GameType value="CampaignStoryMode"/>

</IncludedGameTypes>

</XmlNode>

</Xmls>

</Module>

the important part is this 

<XmlName path="zzzMyPartyTemplates" id="partyTemplates"/>

where xmlname path is the name of your edited xlm, and the ID the name of the xlm where you want your submodule to inject into.
you can setup multiple paths in the same submodule.


btw another thing i was thinking off since you said you edited with notpad++
If you are new to xml editing its kind of easy to mess up when editing with just a text editor.
you got to make sure you keep table structure intact and line breaks,spaces and tabs can mess it up.
copy paste is your best friend and also make sure you set notpad++ to xml so you easier can see the xml tree structure.



 

 

So, I downloaded another sturgian overhaul mod to use as a reference for creating my submodule and I'm pretty sure I have it all set up correctly, but my game crashes whenever I try to launch with my mod enabled. I tried the other mod I downloaded and the game launches fine. I have the submodule xml and my xml file set up exactly the same way the other mod is (with the necessary changes to filenames/etc). So I guess this means there is something wrong with the changes I made to the troops that the game does not like.



#6
kloude9

kloude9

    Journeyman

  • Members
  • Pip
  • 37 posts

okay, disregard my last post about the game crashing. it was just a silly mistake with the name of the submodule folder. game launches now, hopefully the save problem will be fixed...



#7
kloude9

kloude9

    Journeyman

  • Members
  • Pip
  • 37 posts

sure thing, I love to help if i can.

its not very hard to make a submodule.

you can use this as a base, its a SubModule.xml I made to inject into partytemplates.

<?xml version="1.0" encoding="UTF-8"?>

-<Module>

<Name value="My party templates"/>

<Id value="zzzMyPartyTemplates"/>

<Version value="v1.0.6"/>

<SingleplayerModule value="true"/>

<MultiplayerModule value="false"/>


-<DependedModules>

<DependedModule Id="Native"/>

<DependedModule Id="SandBoxCore"/>

<DependedModule Id="Sandbox"/>

<DependedModule Id="CustomBattle"/>

<DependedModule Id="StoryMode"/>

</DependedModules>

<Official value="false"/>

<DependedModules/>

<SubModules/>


-<Xmls>


-<XmlNode>

<XmlName path="zzzMyPartyTemplates" id="partyTemplates"/>


-<IncludedGameTypes>

<GameType value="Campaign"/>

<GameType value="CampaignStoryMode"/>

</IncludedGameTypes>

</XmlNode>

</Xmls>

</Module>

the important part is this 

<XmlName path="zzzMyPartyTemplates" id="partyTemplates"/>

where xmlname path is the name of your edited xlm, and the ID the name of the xlm where you want your submodule to inject into.
you can setup multiple paths in the same submodule.


btw another thing i was thinking off since you said you edited with notpad++
If you are new to xml editing its kind of easy to mess up when editing with just a text editor.
you got to make sure you keep table structure intact and line breaks,spaces and tabs can mess it up.
copy paste is your best friend and also make sure you set notpad++ to xml so you easier can see the xml tree structure.



 

 

ok so I got the submodule working kinda. I'm having trouble getting it to actually replace sturgia's troops with mine though. when I start a new game and look at the troop tree there are two. mine and the default one. of course the default one is the one that shows up in lord's parties and stuff like that in-game. any idea where I'm going wrong?



#8
kloude9

kloude9

    Journeyman

  • Members
  • Pip
  • 37 posts

could it be that I changed the unit id for each unit? I didn't originally and some troops were not updated so I gave each unit their own id. seems like I'm damned if I do and damned if I don't...



#9
kloude9

kloude9

    Journeyman

  • Members
  • Pip
  • 37 posts

i tested it again to be sure and if i use the default ids for each unit half of them dont use their updated gear. seems like my issue is that when i use the version with updated ids my whole troop tree is there, but as a duplicate. the original troop data does not get replaced, mine is just added on. 





Reply to this topic



  



Also tagged with one or more of these keywords: mods, modhelp, help, modding, save, failed, troops

Page loaded in: 1.073 seconds