Stability Setter
Adds commands to set chunk stability using Harmony patches.
Description
<h3 style="text-align: center;"><span style="color: #e74c3c;">Tungsten users: If you are using Tungsten with this mod, please ensure you have Tungsten 1.2.1 or higher if you are experiencing null errors!</span></h3> <p> </p> <p>This mod uses a Harmony patch on <em>Vintagestory.GameContent.SystemTemporalStability.GetTemporalStability()</em> to override a chunk's stability values, alllowing the tempoaral gear on the HUD to turn in the appropriate direction for the new values. Note that this method of patching may break more often with game updates, especially if the temporal stability system gets updated. The upside to this method is that anything that grabs chunk stability will see the set value rather than the inherent value. The changes made by this mod are non-destructive and can be reversed through a command or by simply removing the mod.</p> <p> </p> <p><strong>This mod is required on both the client and server!</strong></p> <p> </p> <p>This mod is inspired by <a href="https://mods.vintagestory.at/chunkstaboverride">Chunk Stability Override</a>!</p> <p> </p> <h2>Stability Modes</h2> <ul> <li>"Vanilla Behavior" - Chunks will return their normal stability value, or their set value if it has been set.</li> <li>Global Stability - Chunks will all have the same stability value set to whatever the current global stability value is.</li> <li>Global Stability Offset - Every chunk will have an offset applied to its final value, based on the current global offset value. For example, if the global offset is 2 then a chunk with 0.87658 stability will have 2.87658 stability or -1.12342 stability if the value is <strong>-</strong>2. Stability override values will also still be applied before the offset, so if you set a chunk to -3 stability and turn on a -2 offset the final stability will be -5.</li> </ul> <h2>Interaction with vanilla mechanics</h2> <ul> <li>During temporal storms, the stability value of chunks which have had their values set will be offset by the storm, as if the set value was already the chunk's inherent value.</li> <li>Temporal rifts will still drain your stability rapidly if you approach them even if you are in a high-stability chunk.</li> </ul> <h2>Seralization</h2> <p>Most data from this mod is saved within the global savegame data.</p> <p>The following data values are serialized:</p> <ul> <li>setChunks - A list of chunks stored as strings containing their coordinates and their set stability values.</li> <li>StabilityMode - The current stability mode, stored as a number [0,2].</li> <li>GlobalStability - Current global stability value stored as a float.</li> <li>GlobalStabilityOffset - Current global stability offset stored as a float.</li> </ul> <h2>Commands</h2> <p><strong>/setStability <stability> - </strong>Sets the stability of the chunk you are in to a specific value <em><strong>(Not an offset!)</strong></em>. A value of <strong>1 is neutral stability</strong>, less is unstable and more is positive stability. Note that chunks are cubic, so higher or lower chunks in your column will have different values. <strong>Value range:</strong><em> -10000 to 10000</em>. (The limits are in place to stop the HUD gear from glitching out, these values are enough to almost instantly fill/drain stability.)</p> <p><strong>/resetStability - </strong>Resets the stability of the chunk you are in to its default value.</p> <p><strong>/resetStability all <confirmCode> - </strong>Resets stability for all chunks back to default. <em><strong>Run this without inputting any confirm code first to get a confirmation code</strong></em>, then run it again with that confirmation code to reset all chunk stability. <strong><span style="color: #e74c3c;">This is not reversible!!!</span></strong></p> <p><strong>/getStability -</strong> Shows the stability value for the position you are standing in.</p> <p><strong>/getStability global - </strong>Shows the current global value (Which is used only when global mode is set).</p> <p><strong>/getStability offset - </strong>Gets the current offset value (Which is used only when global offset mode is set)!</p> <p><strong>/getStability mode - </strong>Shows the current stability override mode. Could be the vanilla behavior, global offset, or global mode.</p> <p><strong>/setStabilityMode - </strong>Sets the current stability mode. Default is "Vanilla Behavior". The possible values are: <em>0 - Vanilla Behavior, 1 - Global stability, 2 - Global stability offset.</em> <strong>Value range:</strong><em> 0 to 2</em></p> <p><strong>/setGlobalStability <stability> - </strong>Sets the stability value for all chunks to a specific value, when Global Stability mode is active. <strong>Value range:</strong><em> -10000 to 10000</em>.</p> <p><strong>/setGlobalStabilityOffset <stability> - </strong>Sets a value to apply as an offset to all chunk stability values. Final stability values will be clamped to -10000 to 10000. <strong>Value range:</strong><em> -10000 to 10000</em>.</p> <p><strong>/requestStabilityData - </strong>Requests a new data packet from the server to the client, syncing all mod data from the server to the client. You probably won't need to use this.</p> <h2>Compatibility</h2> <p><strong><a href="https://mods.vintagestory.at/temporalamulets">Temporal Amulets</a> - </strong>Confirmed Compatible</p> <p><strong><a href="https://mods.vintagestory.at/show/mod/37072">Spreading Devastation</a> - </strong>Minor issues? In devestated chunks, the stability value from /getStability reflects changes made by that mod, but not the cog. Other chunks should be unaffected. You can still override devestated chunks.</p> <p><strong><a href="https://mods.vintagestory.at/show/mod/35820">Temporality Plus</a> - </strong>Unknown. Game will load, no obvious issues. Can't yet confirm if temporal rifts will spawn in manually set unstable chunks or not or if it will spare manually set stable chunks
Ratings & reviews
Sign in to leave a rating or comment.

