MDHansen Posted August 2, 2024 Posted August 2, 2024 frack. forgot i cant edit my post... lol it works. population and army and crew
MDHansen Posted August 2, 2024 Posted August 2, 2024 and hitting enter posts my post... sigh I quit the game, added the 1 in the taf_override_map, booted the game and loaded the save that ran the taf_override_map 0, and it works
MDHansen Posted August 2, 2024 Posted August 2, 2024 so to summarize, for clarity started a new game with flags and all my edits to a new nation, and taf_override_map,0 as expected no home population, no crew, no army. Flags work quit the game, added taf_override_map,1 and rebooted the game and save I now have a home population and army consistent of the percentage of the home population. Crew is still -2billions BUT increasing Crew training and crew goes in to +xxx quit to main menu, opened save file, set crew to 5000 and reloaded the save win 1
MDHansen Posted August 2, 2024 Posted August 2, 2024 6 hours ago, MDHansen said: Ok. So i added this to "params" like any of the other parameters taf_override_map,1,,,,,,,, and my personal "new nation" resources file, including flags, and norwegian provinces set to "1, Home" when creating a new game I immidiately get the message "[13:24:55.332] [UnityExplorer] [Unity] KeyNotFoundException: The given key was not present in the dictionary." However, if I create a new game with taf_override_map,,,,,,,,, (without the 1) it creates a new game fine; [13:26:49.163] [UnityExplorer] [Unity] missing param 'taf_override_map' (using default '0') so regards to this. Doing it this way messes up the ports. Once I redo the taf_override_map to 1 and load the savegame, all ports are showing 0/0t and wont increase. Unsure if its just a visual bug, since an invasion was still taking 6 turns for a large port invasion. Though putting a single DD in my port would show them being over dock limit. So back to the KeyNotFoundExcept, is it a typo in your coding? it creates a new game if I have taf_override_map,0 or taf_override_map, , but once I replace it with the 1, it fails This is way out of my league for now, so hopefull you have an swer to this 1
NathanKell Posted August 2, 2024 Author Posted August 2, 2024 30 minutes ago, MDHansen said: so regards to this. Doing it this way messes up the ports. Once I redo the taf_override_map to 1 and load the savegame, all ports are showing 0/0t and wont increase. Unsure if its just a visual bug, since an invasion was still taking 6 turns for a large port invasion. Though putting a single DD in my port would show them being over dock limit. So back to the KeyNotFoundExcept, is it a typo in your coding? it creates a new game if I have taf_override_map,0 or taf_override_map, , but once I replace it with the 1, it fails This is way out of my league for now, so hopefull you have an swer to this I'll take a look this evening. I didn't get to do anything more than smoke testing last night. My guess is there's something different in the load order when starting a new game. If I instrument enough stock methods I'm sure I'll figure it out. 1
MDHansen Posted August 2, 2024 Posted August 2, 2024 👍 A little addon, curious thing. All minor ports increase tonnage per turn, some majors doesn't (Britain, France, Germany, Spain and Russia), and my own (Norway) increases per turn. I also can't set my new nations overlay colour. The nation colour (<nation> in events and such) is fine. As you say, there is probably more pies to hook up Thanks for all your efforts in this 1
MDHansen Posted August 2, 2024 Posted August 2, 2024 why cant I edit my own post... goddammit. Anyhoo, I had a look at the savefile. All the ports belonging to nations where the port doesn't increase tonnage has a negative IncomeGrowth and PopulationGrowth per turn. Opposite, ports where tonnage does increase, has an increase per turn on both. 1
MDHansen Posted August 2, 2024 Posted August 2, 2024 not sure if this helps you in any way, but this is the message I get when I start a new game with "taf_override_map,1" KeyNotFoundException: The given key was not present in the dictionary. at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x00000] in <00000000000000000000000000000000>:0 at CampaignController.PrepareProvinces (System.Int32 year) [0x00000] in <00000000000000000000000000000000>:0 at CampaignController+<>c__DisplayClass196_0.<Init>b__0 () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Font+FontTextureRebuildCallback.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at GameManager+<UpdateLoadingWorld>d__109.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0 1
NathanKell Posted August 2, 2024 Author Posted August 2, 2024 1 hour ago, MDHansen said: not sure if this helps you in any way, but this is the message I get when I start a new game with "taf_override_map,1" KeyNotFoundException: The given key was not present in the dictionary. at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x00000] in <00000000000000000000000000000000>:0 at CampaignController.PrepareProvinces (System.Int32 year) [0x00000] in <00000000000000000000000000000000>:0 at CampaignController+<>c__DisplayClass196_0.<Init>b__0 () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Font+FontTextureRebuildCallback.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at GameManager+<UpdateLoadingWorld>d__109.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0 It does indeed, thanks! 1
NathanKell Posted August 3, 2024 Author Posted August 3, 2024 13 hours ago, MDHansen said: why cant I edit my own post... goddammit. Anyhoo, I had a look at the savefile. All the ports belonging to nations where the port doesn't increase tonnage has a negative IncomeGrowth and PopulationGrowth per turn. Opposite, ports where tonnage does increase, has an increase per turn on both. I've pushed a new version. Give that a try please! Ran out of time to debug further. But I think part of the problem may be divergence between the TextAsset and what's in the prefab ingame, so I dumped the live data. You should base the TextAsset off that. (set taf_override_map to 2 to have it dump to the Mods folder before overriding). 1
MDHansen Posted August 3, 2024 Posted August 3, 2024 set taf_override_map to 2, got the new port and province files, did a switcharoo with the originals. Now, there is a comma error in the top line in the ports file from the newly dumped file. @name,nameUi,province,portCapacity,seaControlDistanceMultiplier,inBeingDistanceMultiplier, <--- remove it, set taf_override_map to 2, and b00m! epic win The above works when starting a new game. However, there are no tooltips with info (ports, sea/land region), and hitting next turn gives an endless load and MelonLoader says [Unity] NullReferenceException: Object reference not set to an instance of an object. im on the run here, so not excluding an error on my behalf when setting this up. I'll do a control later today
MDHansen Posted August 3, 2024 Posted August 3, 2024 I see. The dumped files don't have positions on ports and provinces (long/lat). and I cant simply copy that in, since ports/provinces are not placed the same way in the dump vs TextAssets
MDHansen Posted August 3, 2024 Posted August 3, 2024 looks like I did mess up. I fixed the extra comma in the Ports file, but didn't check the Provinces file I was now able to start a new game with taf_override_map,1,,,,,,,, So, bottom line. Ran the game with taf_override_map,2,,,,,,,, created a new game to pull the ports and provinces files quit game, did the switcharoo with said files and remove 1 comma in the top line of each file and saved the resources fil started the game and created a new save with taf_override_map,1,,,,,,,, initially if something was wrong, it would start with an endless loading game, and wouldnt continue to simulate the pregame (eg. 1887-1890)
MDHansen Posted August 3, 2024 Posted August 3, 2024 but as I suspected, we need the coordinates for ports and provinces wich the dumps doesn't have. ill try and fill them with such from the textassets. set the row to alphabetic in both should to the trick
MDHansen Posted August 3, 2024 Posted August 3, 2024 Apologize for cluttering up the thread but now, sir, I've done it Ran the game with taf_override_map,2,,,,,,,, created a new game to pull the ports and provinces files quit game, did the switcharoo with said files and remove 1 comma in the top line of each file and saved the resources fil started the game and created a new save with taf_override_map,1,,,,,,,, initially if something was wrong, it would start with an endless loading game, and wouldnt continue to simulate the pregame (eg. 1887-1890) This is the correct way as it is per now. But something to add to that I used (as you explained initially) the ports and provinces files from the dump, then added the lat and long columns from the TextAssets to both files Then; open both files as csv in your fav editor and at the end of the top line add #insertsomethinghere, like this; @name,nameUi,province,latitude,longitude,portCapacity,seaControlDistanceMultiplier,inBeingDistanceMultiplier,#end and @name,ameUi,area,controller,controller_1890,controller_1900,controller_1910,controller_1920,controller_1930,controller_1940,claim,isHome,type,latitude,longitude,development,port,population,oilDiscoveryYear,oilDiscoveryBaseChance,oilCapacity,oilReservesInTurns,revoltChance,provinceArmyPercentage,ProvinceDefenderBonus,neighbour_provinces,#end This will add a comma at the end of all rows in both files I created a new game with taf_override_map,1 and it worked. As I entered the map in the new game all position (lat/long) datas was working and UE didnt throw exceptions each time I hovered over a port/province. WIN 1
NathanKell Posted August 4, 2024 Author Posted August 4, 2024 8 hours ago, MDHansen said: Apologize for cluttering up the thread but now, sir, I've done it Ran the game with taf_override_map,2,,,,,,,, created a new game to pull the ports and provinces files quit game, did the switcharoo with said files and remove 1 comma in the top line of each file and saved the resources fil started the game and created a new save with taf_override_map,1,,,,,,,, initially if something was wrong, it would start with an endless loading game, and wouldnt continue to simulate the pregame (eg. 1887-1890) This is the correct way as it is per now. But something to add to that I used (as you explained initially) the ports and provinces files from the dump, then added the lat and long columns from the TextAssets to both files Then; open both files as csv in your fav editor and at the end of the top line add #insertsomethinghere, like this; @name,nameUi,province,latitude,longitude,portCapacity,seaControlDistanceMultiplier,inBeingDistanceMultiplier,#end and @name,ameUi,area,controller,controller_1890,controller_1900,controller_1910,controller_1920,controller_1930,controller_1940,claim,isHome,type,latitude,longitude,development,port,population,oilDiscoveryYear,oilDiscoveryBaseChance,oilCapacity,oilReservesInTurns,revoltChance,provinceArmyPercentage,ProvinceDefenderBonus,neighbour_provinces,#end This will add a comma at the end of all rows in both files I created a new game with taf_override_map,1 and it worked. As I entered the map in the new game all position (lat/long) datas was working and UE didnt throw exceptions each time I hovered over a port/province. WIN The lack of latitutde/longitude was a red herring, since my code only loads the values that you see in the dumps. Adding more columns won't result in any changes. I did have a bug where the header row had an extra comma in it, which is now fixed. When you added the extra #somevaluehere that meant the header row no longer had an empty field (which had been created by the extra comma), and thus the loader worked. Just to emphasize: the _only_ things my code loads are the columns that the dump creates*. All other variables are left at their stock values. So the stock lat/lon are preserved for all ports and provinces. That it was not working before was because the wrong data was getting read into things, because the header got messed up. Note that the ports and provinces TextAssets are _only_ read by my code (the stock game does not use them), so the workflow for editing is: If you don't already have valid dumps of ports and provinces, run with 2 so they get dumped. Save backups of those dumps Edit them as desired Paste the entirety of the ports file (including the header) into the ports TextAsset Do the same for provinces Put those TextAssets into the resource.assets file Run the game. Your edits should then be applied correctly. *the dumps are basically "run the patcher in reverse". It's completely symmetric. The patcher works by reading the assets into data transfer objects and then applying the data in those objects into the game's ports and provinces databases before the game 'compiles' them on starting or loading a campaign. So in dump mode, my code first fills the DTOs with the game's data, and then writes the DTOs to disk. 1
SpardaSon21 Posted August 4, 2024 Posted August 4, 2024 (edited) Hey, since you've already got at least some loose files loaded, any chance of you extending that deeper? There's a mod for UA: AoS that extracted equipment stats into .txt files, which would then be remotely loaded by the game, and any changes to the stats in the .txt file would override the game's stock value. Idea would be that instead of modders needing to replace the entire resources file their mod could instead be distributed in loose file format, preserving the original game files. Edited August 4, 2024 by SpardaSon21 1
MDHansen Posted August 4, 2024 Posted August 4, 2024 It works. Would've worked earlier if I hadn't forgot to fill in the RelationMatrix (regards to my new nations) got a few familiar errors in the UE logs but could not figure out what it was. It worked fine if I only used Params, Ports and Provinces. So, added files one by one until the error came. Well, I added players-resources, and got the error, but since this adds the nations (if new are added) I knew this would throw an error without the other new nation related files. So added relationmatrix and yeh, there was the error. Opened it and I saw it right away. I'd added the nations, but not the relation numbers lol Anyhooooo. This works Thanks 1
NathanKell Posted August 4, 2024 Author Posted August 4, 2024 3 hours ago, SpardaSon21 said: Hey, since you've already got at least some loose files loaded, any chance of you extending that deeper? There's a mod for UA: AoS that extracted equipment stats into .txt files, which would then be remotely loaded by the game, and any changes to the stats in the .txt file would override the game's stock value. Idea would be that instead of modders needing to replace the entire resources file their mod could instead be distributed in loose file format, preserving the original game files. Oh sure yeah that's trivial, since I already was using basically that to override some NAR stuff myself. I can hook that up. 1
NathanKell Posted August 5, 2024 Author Posted August 5, 2024 9 hours ago, NathanKell said: Oh sure yeah that's trivial, since I already was using basically that to override some NAR stuff myself. I can hook that up. Done. Also added support for >5 marks of gun. 1
MDHansen Posted August 5, 2024 Posted August 5, 2024 (edited) Would you mind checking something, if you are able without too much trouble. in the afterbattle report, my new nations flag is missing, and is using the ungov flags with a ? in it. Same flag that was used before you fixed them for us. I guess that situation uses another type of flag? or it needs to be connected to the rest in your code somehow? I'll post a screenshot in a few Edited August 5, 2024 by MDHansen
NathanKell Posted August 5, 2024 Author Posted August 5, 2024 4 hours ago, MDHansen said: Would you mind checking something, if you are able without too much trouble. in the afterbattle report, my new nations flag is missing, and is using the ungov flags with a ? in it. Same flag that was used before you fixed them for us. I guess that situation uses another type of flag? or it needs to be connected to the rest in your code somehow? I'll post a screenshot in a few Sure, can you give me an NAR save from before (or during) a battle? And also your flags.csv and the contents of your Flags folder, and the console log from melonloader around the time the popup shows (where you should see some spew about overriding flags)
SpardaSon21 Posted August 5, 2024 Posted August 5, 2024 On 8/4/2024 at 1:32 PM, NathanKell said: Oh sure yeah that's trivial, since I already was using basically that to override some NAR stuff myself. I can hook that up. I don't think I can thank you enough. 1
MDHansen Posted August 6, 2024 Posted August 6, 2024 21 hours ago, NathanKell said: Sure, can you give me an NAR save from before (or during) a battle? And also your flags.csv and the contents of your Flags folder, and the console log from melonloader around the time the popup shows (where you should see some spew about overriding flags) There is the afterbattle report. I don't use NAR. I have my own personal recipy
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now