Closed Xardion495 closed 7 months ago
Thank you for the report!
I'm not entirely sure I understand the issue. I tested adding the tag "engcab" to a metal crate and placing it in a crate shelf, and it seems to get filled with engineering supplies as expected. Do you mean something else by "autofill tags"?
Filling work as expected but the game still spawn a support crates at the beginning of campaign which must not be happens if autofill is enabled on corresponding containers.
For example.
What do you mean by a support crate? The extra crates that spawn if there's not enough space for the supplies in cabinets or other containers?
To me it doesn't seem like there's necessarily a bug here. If there's not enough space for the initial supplies in that crate tagged as "engcab", the rest of the items should spawn in a new crate.
Well, the truth is even there is enough space in crates the game will spawns extra ones if crates placed in shelves. I'll show in the pictures.
Thus we can conclude that the game when creating initial crates considering the tags on lockers and crates but not considering tags on crates if they within the shelves.
In those screenshots, the weapon crate seems to be already full, so the game needs to spawn an extra one to have enough space for all the supplies. In the last pic, you're holding a medical crate, not a chemical crate - again, the game needs to spawn a medical crate because there's no other place to put the medical items in.
There does seem to be something off here though, I'm not sure why the extra crates aren't spawning when you leave the manually placed crates on the floor.
Hmm, I unfortunately still couldn't reproduce this. :/
I'm getting the exact same number of crates, and the contents are also identical, regardless if the manually placed crates are in a crate shelf or not. So I suspect this requires some more specific conditions to occur.
To see the difference just add 'medfabcab' tag to one of the custom crates.
I checked a code block responsible for initial crates. The bottom line is that the game does not spawn the initial crates exactly, but looks for suitable containers for "start item set" spawning. And if there is no such one or there is not enough space in container, it spawns a new container (crate) and place the item there.
Default start item set is "normal" (Barotrauma/BarotraumaShared/SharedSource/GameSession /AutoItemPlacer.cs:70) Set composition can be viewed in the file of the installed distribution ("...\SteamLibrary\steamapps\common\Barotrauma\Content\Items\StartItems.xml") When the new item list is formed (Barotrauma/BarotraumaShared/SharedSource/GameSession /AutoItemPlacer.cs:104-123) the next code block starts searching for the container for each item from that list (Barotrauma/BarotraumaShared/SharedSource/GameSession/AutoItemPlacer.cs:124-141)
Possible solution may be to modificate FindContainerFor() method in Barotrauma/BarotraumaShared/SharedSource/Map/Submarine.cs:2120 to add collection parsing for items with 'crateshelf' identifier or 'cargocontainer' tag
Disclaimers
What happened?
If crates placed inside the shelves, the game not checks autofill tags on them. Please change this behavior.
Reproduction steps
-
Bug prevalence
Happens every time I play
Single player or multiplayer?
Other
-
Submarine spawner
Version
v1.2.7.0 (Winter Update hotfix)
-
No response
Which operating system did you encounter this bug on?
Windows
Relevant error messages and crash reports
No response