[1.0] Faction Manager (4-11-2018)

Started by TGPArcher, October 08, 2018, 06:16:36 AM

Previous topic - Next topic

J.BEAR

opps i think 1.0 broke it :x


Exception from asynchronous event: System.MissingMethodException: Method not found: 'Verse.SafeSaver.Save'.
  at FactionManager.PersistenceUtility.LoadMap (System.String fileName, Boolean forced) [0x00000] in <filename unknown>:0
  at FactionManager.ColoniesManagerTabDef+<>c__DisplayClass1_0.<DrawColonyRow>b__1 () [0x00000] in <filename unknown>:0
  at Verse.LongEventHandler.RunEventFromAnotherThread (System.Action action) [0x00000] in <filename unknown>:0

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception from asynchronous event: System.MissingMethodException: Method not found: 'Verse.SafeSaver.Save'.
  at FactionManager.PersistenceUtility.LoadMap (System.String fileName, Boolean forced) [0x00000] in <filename unknown>:0
  at FactionManager_SetUpCamp.OutpostsManagerTabDef+<>c__DisplayClass1_0.<DrawOutpostRow>b__1 () [0x00000] in <filename unknown>:0
  at Verse.LongEventHandler.RunEventFromAnotherThread (System.Action action) [0x00000] in <filename unknown>:0

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

Exception from long event: System.MissingMethodException: Method not found: 'Verse.SafeSaver.Save'.
  at FactionManager.PersistenceUtility.UnloadMap (Verse.Map map, System.String fileName, Boolean forced) [0x00000] in <filename unknown>:0
  at FactionManager_SetUpCamp.OutpostsManagerTabDef+<>c__DisplayClass1_0.<DrawOutpostRow>b__2 () [0x00000] in <filename unknown>:0
  at Verse.LongEventHandler.UpdateCurrentSynchronousEvent (System.Boolean& sceneChanged) [0x00000] in <filename unknown>:0

(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

TGPArcher

Quote from: J.BEAR on October 22, 2018, 08:58:37 AM
opps i think 1.0 broke it :x

I was a bit busy and have not tried if it is still compatible. I hope you don't need it urgently cause it may take more than I expect

J.BEAR

Quote from: TGPArcher on October 22, 2018, 02:39:41 PM
I was a bit busy and have not tried if it is still compatible. I hope you don't need it urgently cause it may take more than I expect

don't worry about it bro im too busy with my new main colony ... just testing it while trying to remove other mods

TGPArcher

Updated

  • Updated to 1.0
  • Fixed the Man in Black incident triggering after unloading a map
  • Fixed the "Colonists Abandoned" letter appearing after unloading a map, thus they will no longer appear as rival pawns
  • Unloading a map with caravans or enemies present will no longer make them leave the map after loading(not 100% sure about that)

J.BEAR

Quote from: TGPArcher on October 26, 2018, 09:36:32 PM
Updated

  • Updated to 1.0
  • Fixed the Man in Black incident triggering after unloading a map
  • Fixed the "Colonists Abandoned" letter appearing after unloading a map, thus they will no longer appear as rival pawns
  • Unloading a map with caravans or enemies present will no longer make them leave the map after loading(not 100% sure about that)

woootz thanks bro,
imma go test it out load/unload, then take down my old bases for resource

J.BEAR

working nicely so far!

one quirky UI bug is that the bottom left pop-up info menu box will stay up after a map load, even if u click elsewhere to try to cancel it. reloading the save will solve it.

will report any other problems.
cheers

TGPArcher

I apologize for such a mistake, uploading files without verifying them again.

Fixed About.xml in FactionManager and FactionManager-SetUpCamp

J.BEAR

see attached img
my old empty base, was unable to reproduce it on the first map load
but on the 2nd load...

the UI pop up window at bottom left is stuck showing what I clicked on world map
if I click anything inside colony map, it'll show the proper info
but once i cancel it by clicking an empty space.... it'll revert back to that world map info box


[attachment deleted due to age]

mospidatru

#23
Thx for great mod. But there is one problem.

In MapDeiniter_Patch.cs you:
1) DeSpawn all spawned pawns
2) And then pass to world pawns. This step cause duplicated records in <pawnsMothballed> and in <things> after load unloaded maps. And game spamming red errors, pawn exist in dictionary...
And some mods work bad. For example WorkTab can't load properly priorities for duplicated pawns. BetterPawnControl too.

---------------

I'm tried w/o step 2, the above problems are not noticed:


and in console only yellow warnings. And this mods work fine)

PS: I think, is worth to remove CleanUpAndPassToWorld(pawn);
PS2: Sorry, for my English

UPDATED:
Pawns from AncientCryptosleepCasket after unload-load duplicated in to <pawnsAlive>

MisterVertigo

So, if I save a colony and then start a brand new game, how would I go about creating a new colony with the same world and same faction? Will my previous colony show up on the world map? Could I send pawns back and forth between the two to trade? Or am I missing the entire point of this?? :P
"In vertigo you will be..."

"Relax, people. It's a teeny indie game; don't kill it with love." - Bozobub

TGPArcher

Quote from: mospidatru on October 29, 2018, 05:34:53 PM
Thx for great mod. But there is one problem.

In MapDeiniter_Patch.cs you:
1) DeSpawn all spawned pawns
2) And then pass to world pawns. This step cause duplicated records in <pawnsMothballed> and in <things> after load unloaded maps. And game spamming red errors, pawn exist in dictionary...
And some mods work bad. For example WorkTab can't load properly priorities for duplicated pawns. BetterPawnControl too.

Honestly I have not looked at what pass to world pawns does, just assumed that if the games calls it during map removal its ok :)), and I see I did a big mistake here. I'll look it up and fix it, thanks a lot.

Quote from: MisterVertigo on October 29, 2018, 06:03:16 PM
So, if I save a colony and then start a brand new game, how would I go about creating a new colony with the same world and same faction? Will my previous colony show up on the world map? Could I send pawns back and forth between the two to trade? Or am I missing the entire point of this?? :P

This mod is not for making more factions controlled by you on the world map, it helps you have more colonies(bases) on the world map so you could extend more than a human can control. Ex if you want to have about 20 bases like normal factions do.
On thing to note, colonies unloaded are not bound to a save file, but to the world you are playing, so I recommend no more than one playthrough on the same seed.

mospidatru

And new issue Pawns from AncientCryptosleepCasket after unload-load duplicated in to <pawnsAlive>.

TGPArcher

#27
Quote from: mospidatru on October 29, 2018, 06:21:07 PM
And new issue Pawns from AncientCryptosleepCasket after unload-load duplicated in to <pawnsAlive>.

If you open dev log you can see that most of the things are found as duplicated, in my research I've seen that if a duplicate is found it won't be added to game dictionaries. How to remove all the duplicated errors is still a mystery to me.
But if you want to be all clear, after loading a map, save the game with the map loaded. and then load the game, there are lots of checks and saving the whole game not just a map fixes any possible duplicates.

mospidatru

Quote from: TGPArcher on October 29, 2018, 06:28:04 PM
Quote from: mospidatru on October 29, 2018, 06:21:07 PM
And new issue Pawns from AncientCryptosleepCasket after unload-load duplicated in to <pawnsAlive>.

If you open dev log you can see that most of the things are found as duplicated, in my research I've seen that if a duplicate is found it won't be added to game dictionaries. How to remove all the duplicated errors is still a mystery to me. But if you want to be all clear, after loading save the game with the map loaded and load it again, there are lots of checks and saving the whole game not just a map fixes any possible duplicates.
On maps with ancients, after save-load i have errors. Without ancients and with fix, have only yellows warnings. I will try to understand tomorrow

mospidatru

#29
This code work fine:
for (int i = 0; i < list3.Count; i++)
{
try
{
Pawn pawn = list3[i];
if (!pawn.Destroyed)
{
pawn.Destroy(DestroyMode.Vanish);
}
if (!pawn.Discarded)
{
pawn.Discard(false);
}
Find.WorldPawns.RemovePawn(pawn);
}
catch (Exception ex)
{
Log.Error("Could not despawn and pass to world " + list3[i] + ": " + ex);
}
}

PS: Destroy+Discard not fully remove pawns, he move destroyed pawns in to <pawnsDead> in save file.
And RemovePawn(pawn) fully remove from save file.


Load unloaded main map:


PS: 20 hours colony, 95 mods :D