Skip to content

Conversation

@FominArtmind
Copy link

@FominArtmind FominArtmind commented Mar 26, 2024

Motivation: There is a big issue in world containers item generation and Item Drop Limits flag interaction (BossKillUnlocksCurrentBiomeItems, BossKillUnlocksNextBiomeItems, PlayerMustKnowRecipe, PlayerMustHaveCraftedItem values) due to the latter forcing items not available yet to gate (or break into reagents). Currently, items are added in chests the same moment the default items added by the game, that is, when Awake() method is called for the chest. That happens "too early" (since Awake() can be called for the chest being far away from the player, in other biome, in dungeon the player can't access yet etc - all cases approved by testing) resulting in player "spoiling" chests just by their accident presence.
According to the tests, Awake() is being called once for every chest and not being called again on new game session.
Thus, the proposed solution is to add a new flag that checks whether the player has ever opened the chest and use the flag to roll items again on the first chest opening or on the first destroying without opening. Default items are still being added on Awake to have a proper chest hint (that the chest is not empty) before the first opening. However, the chest is cleared every time before adding the default items to avoid double generation.

Backward compatibility: can have incorrect interaction with other mods changing chest behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant