robotized Posted March 20, 2023 Share Posted March 20, 2023 I was trying to switch a global value between 0 and 1 with the mod Configurable Hotkeys. When I type the following in the console if GetGlobalValue X == 0; set X to 1; else; set X to 0; endifit works.Note: X is the Editor ID of the global value, just for this example.When I put the same line in a batch file, it doesn't work, in the console returns error message: Mismatched if/else/endif block starting on line 1. Mismatched if/then/else block.I'm curious, am I doing it the wrong way? Or is it not possible to use conditions in the batch file? Also would like to use this opportunity to ask about one more thing. Is there a condition, which checks if the pipboy light is turned on/off? Link to comment Share on other sites More sharing options...
robotized Posted March 26, 2023 Author Share Posted March 26, 2023 I think that it's not possible to use conditions in batch files. On other hand, I managed to solve my problem. The line if GetGlobalValue X == 0; set X to 1; else; set X to 0; endifcan be used exactly as it is with MCM. That's how I toggle the lights for the Excavator PA pauldron lamps. I created MCM menu for my patch and added hotkey option to run console command. For more information, visit the MCM wiki and look at other mods for examples. Edit: The best thing about using Global value is, you can type the Editor ID and it works. For example if I name the Global value TogglePauldronLights, I can use that in place of the X in the example above. While if you want to use commands like AddItem, EquipItem, AddSpell and so on, you'll have to type the Form ID, which makes it impractical to use with hotkey, because the command will then be tied to the load order. Link to comment Share on other sites More sharing options...
Recommended Posts