Give and Take away schematic based on session option
Is it possible to give access to and take away a possibly already unlocked schematic based on session (mod savegame setting) value? I wish to make some schematics not available when disabled in mod settings. I would prefer if the players would lose access to the unlocked schematic if the setting is toggled during play.
I registered the appropriate listeners in the world module, I just don't know how I can give and take away a schematic in the event graph, which nodes to use.
Solution:Jump to solution
taking away arbitrary schematics is troublesome because you can't guarantee that you have actually undone all of their effects, for example, changes to the player's hand slot count or inventory slot count
10 Replies
I have no idea how to do that (also learning how to write mods), but I would check in source code of other mods that work with disabling/enabling schematics.
Like this for example: https://ficsit.app/mod/NoPortableMiners
I think No Portable Miners just does some CDO edits to change the recipes
Solution
taking away arbitrary schematics is troublesome because you can't guarantee that you have actually undone all of their effects, for example, changes to the player's hand slot count or inventory slot count
you can use mod modules to do conditional content registration, that will mean next time the game is loaded that schematic will not be registered and then, since it is missing, the record of it will be removed the next time the player saves
Mod Modules :: Satisfactory Modding Documentation
Mod Modules are a system provided by SML that allows for simple hooking into the engine life-cycle at key locations important for Satisfacto...
taking away schematics with this is not much better, but it's the SML "intended" way to have schematics controlled by settings
if you want to programatically remove the unlock without reloading the save, look at MAM Enhancer, it make a best effort to rewind changes caused by schematic unlocks
Wouldn't the schematic still exist, though? Sure, the schematic would not be visible, but it wouldn't get removed from the save file
with how content registration works, I am pretty sure that it would not be around to exist (since it never gets registered)
haven't tested myself though. conditional content registration would probably be a nice thing to put in examplemod eventually™️
-# Maybe once the current PR gets merged