SolomonSTB1973 Posted September 10, 2021 Posted September 10, 2021 Hi, I have a journeyman's question today. I've made a mod with one variable that cycles through 3 states. How do I make it so that the game remembers which variable I used last time instead of resetting to 0 each time I load the game? I've noticed that mods that save their variables tend to have $id and swimsuit1 and swimsuit2 in their code, so I assume it has something to do with that. Thanks for your help.
xenodoax Posted September 10, 2021 Posted September 10, 2021 I'm just now getting into outfit swapping with 3dmigoto.. but noticed my mod works as you've described. Shout out to TEDDY for his code... as I learned from his mods. Make sure you have the [Constants] and [Present] block in your mod like this: [Constants] global persist $var1 = 0 global persist $var2 = 0 global persist $var3 = 0 global $active = 0 [Present] post $active = 0
xenodoax Posted September 10, 2021 Posted September 10, 2021 1 minute ago, minh12345 said: pretty sure its F10 F10 will reload the mod to the game as it was last saved... but his issue is that his mod is reverting back to its original state regardless of his toggled choices. At least that's how I read his post.
SolomonSTB1973 Posted September 10, 2021 Author Posted September 10, 2021 "global persist $var1 = 0 " That's what I needed to hear. Thanks so much!
Yorom Posted September 10, 2021 Posted September 10, 2021 5 hours ago, xenofactor07 said: F10 will reload the mod to the game as it was last saved... but his issue is that his mod is reverting back to its original state regardless of his toggled choices. At least that's how I read his post. If the mod support it, and when you select desire variables F10 will save it (not just reload)
Yorom Posted September 10, 2021 Posted September 10, 2021 5 hours ago, xenofactor07 said: I'm just now getting into outfit swapping with 3dmigoto.. but noticed my mod works as you've described. Shout out to TEDDY for his code... as I learned from his mods. Make sure you have the [Constants] and [Present] block in your mod like this: [Constants] global persist $var1 = 0 global persist $var2 = 0 global persist $var3 = 0 global $active = 0 [Present] post $active = 0 and if you want to lock your mod so as not to change the selected variant by accidentally pressing the key responsible for it (because, for example, another mod also uses it), then add this: [Constants] global persist $var1 = 0 global persist $var2 = 0 global persist $var3 = 0 global $mod_active = 0 global $slot_active = 0 global $id = 0000000 - your uniqe number [Present] post $mod_active = 0 [KeySwitchSlot1] condition = $\mods\_id\id.ini\swimsuit1 == $id && $mod_active == 1 key = ctrl no_shift no_alt 1 type = cycle $slot_active = 1, 0 run = CommandListSlot1, CommandListSlot0 [KeySwitchSlot2] condition = $\mods\_id\id.ini\swimsuit2 == $id && $mod_active == 1 key = ctrl no_shift no_alt 2 type = cycle $slot_active = 1, 0 run = CommandListSlot1, CommandListSlot0 [CommandListSlot1] Resource\ShaderFixes\help.ini\Notification = ref ResourceSlot1 run = CustomShader\ShaderFixes\help.ini\FormatText $\ShaderFixes\help.ini\notification_timeout = time + 2.0 [CommandListSlot0] Resource\ShaderFixes\help.ini\Notification = ref ResourceSlot0 run = CustomShader\ShaderFixes\help.ini\FormatText $\ShaderFixes\help.ini\notification_timeout = time + 2.0 [ResourceSlot0] type = Buffer data = "NAME OF MOD: OFF" [ResourceSlot1] type = Buffer data = "NAME OF MOD: On" [CommandListID] $\mods\_id\id.ini\swimsuit2 = $\mods\_id\id.ini\swimsuit1 $\mods\_id\id.ini\swimsuit1 = $id and for each TextureOverride this: [TextureOverrideBody] if $\mods\_id\id.ini\swimsuit1 != $id && $\mods\_id\id.ini\swimsuit2 != $id run = CommandListID endif match_priority = 0 hash = 98fbb3d5 ......... drawindexed = auto $mod_active = 1 now whenever you want to change something in a mod first you have to open it with CTRL + 1/2 and you will need that ID.ini to work
Recommended Posts
Archived
This topic is now archived and is closed to further replies.