Open IamVelcroboy opened 4 months ago
I did some further investigating into this and it appears to only be broken in mapping mode. 😪
It functions normally under other scenarios. But after entering mapping, it breaks.
(edited title, repro steps)
I have looked into this, and while I have information to add I do not have a solution to the issue.
The reason the Solution Editor can not see any of the reagents is because of the following behavior:
SolutionContainerManagerComponent
's Containers
property. This is mapped to the dictionary Solutions
in the same component, where the string name of the container is the key to the solution value.Containers
property filled. Instead they only have the Solutions
dictionary with all the relevant data. Containers
property gets filled via serverside SolutionContainerSystem.cs
, but this happens on MapInit, not ComponentInit. Can we solve this? Sorta. But it comes with its own issues.
-SolutionContainerSystem
can be initialized by running the methods from MapInit in ComponentInit. This creates containers that can be put in the SolutionContainerManagerComponent
's Containers
property, which in turn makes the Solution Editor work (and also makes puddles/containers visualize its reagents).
ContainerManagerComponent
(serialized as ContainerContainer
in the map file). This is problematic because it causes issues with map saving serialization:SolutionContainerManagerComponent
property in the map file, it instead gets listed in a ContainerContainer
, which links to a separate entity containing the reagent data. Problem is, this happens for solution entities that are not edited. So you can no longer have a simple reference to, say, a proto DrinkBeerglass
. Now that beer reagent gets explicitly saved on the map, taking up a bunch of pointless space in the map file.This is an example of a mop, which has been edited to include water in the dev_test.yml map.
- proto: MopItem
entities:
- uid: 328
components:
- type: Transform
pos: 7.6382103,16.08618
parent: 179
- type: SolutionContainerManager
solutions:
absorbed:
temperature: 293.15
canMix: False
canReact: True
maxVol: 50
name: null
reagents:
- ReagentId: Water
Quantity: 25
Compare this to this empty mop, which I put in a test map after having SolutionContainerSystem initialized. Entity 19 is completely pointless as all that data is already in the MopItem prototype, and were I to edit the mop to start with water, that data would end up in entity 19.
- proto: MopItem
entities:
- uid: 4
components:
- type: Transform
pos: -1.049206,1.8034062
parent: 2
- type: SolutionContainerManager
solutions: null
containers:
- absorbed
- type: ContainerContainer
containers:
solution@absorbed: !type:ContainerSlot
ent: 19
- proto: ""
entities:
- uid: 19
components:
- type: MetaData
- type: Transform
parent: 4
- type: Solution
solution:
maxVol: 100
name: absorbed
reagents: []
- type: ContainedSolution
containerName: absorbed
container: 4
I do not know how to solve this. Without the containers, Solution Editor won't work. But with the containers, the serialization won't work.
There is an additional issue where initializing the containers on a map with puddles makes the Puddle
component want to get serialized, which it can't due to its Entity<SolutionComponent> Solutions
property not being serializable.
It's probably best to make a separate editor for mapping. That way we don't bloat the map files with unnecessary entities.
Description
Debug command for editing reagent containers has broken input fields.
Reproduction Enter into mapping setup right click on container->Debug->Edit Solutions->get this
Screenshots
Additional context