Created
May 3, 2021 10:41
-
-
Save jegor377/df1d641f266dd513b9d03e2654bf8e6e to your computer and use it in GitHub Desktop.
Noita seed changer script made in Python. If you want to use it then just install Python 3.6 or higher and set important variables inside the script. Then just run and that's it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
import subprocess | |
LOCAL_DIR = 'SPECIFY LOCAL DIR HERE' # your local dir noita path (f.e. %userprofile%\AppData\LocalLow\Nolla_Games_Noita\save00) | |
NOITA_DIR = 'SPECIFY NOITA DIR HERE' # your noita's game directory that contains noita.exe | |
def del_file_if_exists(path): | |
if os.path.exists(path): | |
os.remove(path) | |
def del_dir_if_exists(path): | |
if os.path.exists(path): | |
shutil.rmtree(path) | |
def remove_files(): | |
del_dir_if_exists(LOCAL_DIR + '/world') | |
del_file_if_exists(LOCAL_DIR + '/mod_config.xml') | |
del_file_if_exists(LOCAL_DIR + '/mod_settings.bin') | |
del_file_if_exists(LOCAL_DIR + '/player.xml') | |
del_file_if_exists(LOCAL_DIR + '/session_numbers.salakieli') | |
del_file_if_exists(LOCAL_DIR + '/world_state.xml') | |
def make_seed_file(seed: str): | |
with open(NOITA_DIR + '/magic.txt', 'w') as f: | |
f.write( | |
f'''<MagicNumbers | |
WORLD_SEED="{seed}" | |
_DEBUG_DONT_LOAD_OTHER_MAGIC_NUMBERS="1" | |
_DEBUG_DONT_SAVE_MAGIC_NUMBERS="1" > | |
</MagicNumbers> | |
''') | |
if __name__ == "__main__": | |
print("SEED: ") | |
seed = input() | |
if seed != '' and seed.isdigit(): | |
remove_files() | |
make_seed_file(seed) | |
os.chdir(NOITA_DIR) | |
subprocess.call(['noita.exe', '-no_logo_splashes', '-magic_numbers', 'magic.txt']) | |
else: | |
print("BAD SEED!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment