Class TuningPythonDraft
- Namespace
- LlamaLogic.TuningArchive
- Assembly
- LlamaLogic.TuningArchive.dll
Drafts a Python script mod that makes changes to tuning as the game loads it, without overriding any tuning
public static class TuningPythonDraft
- Inheritance
-
TuningPythonDraft
- Inherited Members
Remarks
The script changes each tunable of instance tuning on the tuning's class after the game loads the tuning's data and before the game invokes any tuning callback, so callbacks and everything that reads tuning see the changes. The game loads module tuning when it imports the module, before script mods, so the script changes tunables of module tuning once the game has finished loading tuning (after it resolves the references module tuning defers), and leaves out tunables with a tuning callback, which has already run with the old value. It is defensive: each change is made only when the tunable still holds what it held in the archive (so a game update or another mod that changed it is never clobbered), list items are matched by their content rather than their position, a change that is already in effect is not made again, and each change fails on its own without affecting the rest. It writes what happened to each change to a log beside the mod. Changes to tunables the game also exports to SimData are left out, because the engine and the UI read SimData, which Python cannot change.
Methods
Generate(IReadOnlyList<TuningDraftTarget>, string, string, TuningCommenter?)
Drafts a script that makes the changes in the specified targets, for the specified gameVersion, logging to a file with the specified logName beside the mod, with the tuning in it commented by the specified commenter, if any
public static TuningDraftResult Generate(IReadOnlyList<TuningDraftTarget> targets, string gameVersion, string logName, TuningCommenter? commenter = null)
Parameters
targetsIReadOnlyList<TuningDraftTarget>gameVersionstringlogNamestringcommenterTuningCommenter