(Bug report) SOS2 Compability Digital storage and archival storage
Describe the bug
A clear and concise description of what the bug is.
To Reproduce Reproducibility: ? Steps to reproduce the behavior:
- Create an ship on the planet.
- build an archival storage on it
- Put inside of that archival storage 500 stacks of items.
- Launch ship into orbit
Expected behavior All the items stay in the container
Actual Behavior If you have 500 Item stacks it will drop 150. 350 are kept in the archival storage, 150 are dropped from where you launched. The same issue happens if you move the ship mid orbit
Screenshots If applicable, add screenshots to help explain your problem.
Rimworld (please complete the following information):
- RimWorld Version: 1.5 (newest)
- PRF Version: 2
- Type: compability
- Severity: low
Modlist (please complete the following information):
- Does this problem exist if only prf is installed: yes (since its related to a block of it)
- Do you know what mod conflicts?: sos2
Additional context
Relates to / Duplicate of #776
I Still can't reproduce that report
After the launch everything is fine.
Save file before Launch TestShip.zip
And you had +500 items and an archival storage? @Sn1p3rr3c0n | it only happens if you have +150 +200 item stacks in an archival storage unit (cannot check with your ship atm)
1358 Items in the Archival Storage Unit 767 Items in the Digital Storage Unit
@Sn1p3rr3c0n just to confirm (sorry if I am annoying) meaning different item stacks, as in => my stack limit for steel is 750 and I had 400 stacks of it in my archival storage unit, and it dropped 150 * 750. (I use orgestack as well)
yes of course i'm referring to Stacks.
Please feel free to load the save and verify yourself.
Will do so, this means then this is a three way incompability with another mod, and I run 750 mods sigh I dont think I will find out what the hell causes it
More details on these storage buildings compatibility:
- there is a confirmed issue when Haute meals form Vanilla Cooking Expanded - Haute module are stored in Archival Storage unit, then dropped on ship takeoff: https://github.com/KentHaeger/SaveOurShip2/issues/102
I've found custom Despawn handlers: this https://github.com/zymex22/Project-RimFactory-Revived/blob/385ba704f387c31fa05fe11a9505bb3ce6f15e4c/Source/ProjectRimFactory/Storage/Building_ColdStorage.cs#L191 and this https://github.com/zymex22/Project-RimFactory-Revived/blob/385ba704f387c31fa05fe11a9505bb3ce6f15e4c/Source/ProjectRimFactory/Storage/Building_ColdStoragePowerd.cs#L92
For compatibility, looks like they should have just default base behavior in relation to stored items when despawning during ship move. That can be achieved by checking ShipInteriorMod2.MoveShipFlag field, which can be reasonable easy done with reflection and without adding mod dependency.
I've looked at the possibility of changing thing at Save Our Ship 2 side, but that looked more complicated.
So what do you think of supporting move ship flag in DeStawn methods?
I'm most certainly not opposed, adding a flag check sounds very reasonable.
What I'm missing atm is how we arrived at the conclusion that such a flag check would fix anything. Both overrides just handel extra Logic before running the base.
https://github.com/zymex22/Project-RimFactory-Revived/blob/385ba704f387c31fa05fe11a9505bb3ce6f15e4c/Source/ProjectRimFactory/Storage/Building_ColdStoragePowerd.cs#L92-L102
just destroys stored things on deconstruct. I'd assume you don't despawn stuff in the deconstruct mode.
https://github.com/zymex22/Project-RimFactory-Revived/blob/385ba704f387c31fa05fe11a9505bb3ce6f15e4c/Source/ProjectRimFactory/Storage/Building_ColdStorage.cs#L191-L201 This is more plausible to require a flag as it spawns stored items. but i am unsure why it would spawn one thing instead of all (unless those are despawned first?)
As for VCE-Haute I'm uncertain how this relates. is this connected to the things above? is this handled by the VE Team or should we look at it
@Bqr1s hmm from what I can see those functions don't get called at all?
Dll + Changes for refrence ProjectRimFactory.zip
VCe - Haute is connected in a way that Archival storage dropping it's contents results in stuff left at the original ship position on ship move/takeoff, but with VCE-haute meals there are log errors mentioned in the issue, in addition to stuff dropped. So it looks like if stuff dropped is fixed, VCE - Haute issue should be fixed too.
As for despwan calls, when ship takes of or moves around on the map, buildings at old ship location are despawned as part of the process. I guess, that required extra explanation.
Thank you very much for the build, looks like the change that should hopefully fix things, I'll have a look at that soon.
@Sn1p3rr3c0n I've got your patch working with a slight change from get field to property getter method call.
Attached the changed patch. I've tested it, and mod compatibility support worked, ship took off without dropping Archival Storage contents.
a slight change from get field
uff that's where i messed up.
I think i will leave https://github.com/zymex22/Project-RimFactory-Revived/blob/385ba704f387c31fa05fe11a9505bb3ce6f15e4c/Source/ProjectRimFactory/Storage/Building_ColdStoragePowerd.cs#L92-L102 as is. Since you DeSpawn with the default of Vanish nothing will change there. no point in adding dead code
Nice, I am taking a break atm of this game, but I am happy to see y'all working on this and fixing issues <3