Jump to content

Recommended Posts

Merge alignment one click OSTIM SA

View File

Hello, here I will leave the program I created to generate a consistent merge between various "alignment.json" files. It is very easy to use and installs just like a mod so that you can have it handy in your mod list. By itself, it doesn't do anything; you need to follow some steps to make it work. Here is how to do it.

 

  • To start, you need to enter the program. It's easy, just go to the mod you installed, and inside there will be an .exe file. Run it. There is also a .pyw version for enthusiasts who want to modify it or read how the code works.

 

 

image.png.1dec3e46ff95c6617cb3ecfe0b56b10b.png

 

 

 

 

The first is knowing where to place this file. It should be on your PC, specifically in "%USERPROFILE%\Documents\My Games\Skyrim Special Edition\OStim". There, you will have two .json files, but the important one is "alignment.json".

 

In my case, the location of the "alignment.json" file is "C:\Users\5652156\OneDrive\Documentos\My Games\Skyrim Special Edition\OStim".

 

Remember this: if you receive an "alignment.json" file from a friend or someone else, and you know it works and want to add the code to yours, first you need to paste it into the application's folder, overwriting what is there, and then run the program as shown in the GIF.

 

 

 

 

image.gif.239a516b6898184010f541c5f366da05.gif

 

 

  • You can use multiple programs available on the internet to do the merge. There is one called OStimSA Alignment Tool, it looks good and is created by SimonPhil, but I still don't understand how to use it. There are also different online programs that do the same, but you have to move the files yourself, such as json-merge. With that, you should be all set.

 

 

OK, this part is important. Wait... yes, wait. It seems that OStim takes some time to associate the alignments, and maybe the first time you open the game after all this, they might not be aligned. Therefore, after restarting the game, they will associate correctly. It's an OStim issue, and there's not much I can do about it. Thank you, everyone 🐈.

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

I will be more active, creating patches, translations into multiple languages, programs, conversions from LE to AE, and in the future, robotics with Skyrim "a bit ambitious." Any requests or feedback will be read in the comments, and thank you for reading so much.

 

I’m not looking for remuneration for this, I love mods and enjoy making the material available to everyone.

But if you want, buy me a coffee . God bless you. 

 

❤️ Thank you to @lmbjjj for donating 5 coffees, with that I'll be able to catch up and go faster 🔨.

 

If you'd like to support me even more across various areas such as additional animation packages not only for OStim, dialogue mods, programs, special requests, and see how I gradually expand into creating different articles related to Skyrim.

 

here is my Patreon 🐱💻 Thank you in advance. I will respond to your requests, boss  

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

For those who know some Python, this is the inside of the program. It's basically the only thing it has. It's simple and has some comments. If you can improve it, let me know. Thanks.

 

import json
import tkinter as tk
from tkinter import filedialog, messagebox
import os

def merge_json_files(default_file_path, selected_file_path):
    try:
        # Load data from the default JSON file
        with open(default_file_path, 'r') as default_file:
            default_data = json.load(default_file)

        # Load data from the selected JSON file
        with open(selected_file_path, 'r') as selected_file:
            selected_data = json.load(selected_file)

        # Merge selected_data into default_data (keep existing data in default_data)
        merge_dicts(default_data, selected_data)

        # Write the merged data back to the selected file respecting original format
        with open(selected_file_path, 'w') as selected_file:
            json.dump(default_data, selected_file, indent=2)  # Dump merged data with original format

        messagebox.showinfo("Success", "The files have been successfully merged! you can close it now 🐈")
        cubo.config(bg="green")  # Change the color of the cube to green

    except Exception as e:
        messagebox.showerror("Error", f"An error occurred: {str(e)}")

def merge_dicts(dict1, dict2):
    """ Merge two dictionaries recursively """
    for key, value in dict2.items():
        if key in dict1 and isinstance(dict1[key], dict) and isinstance(value, dict):
            merge_dicts(dict1[key], value)
        else:
            dict1[key] = value

def select_file():
    file_path = filedialog.askopenfilename(filetypes=[("JSON files", "*.json")])
    if file_path:
        file_name = os.path.basename(file_path)
        if file_name != "alignment.json":
            messagebox.showerror("Error", "The selected file must be named 'alignment.json'.")
            return
        
        default_file_path = os.path.join(os.path.dirname(__file__), "alignment.json")
        merge_json_files(default_file_path, file_path)

# Set up the main window
root = tk.Tk()
root.title("Merge JSON Files")
root.geometry("300x170")  # Set window size to 300x170 pixels
root.configure(bg="purple")  # Set window background color to purple

# Button to select the JSON file
merge_button = tk.Button(root, text="Select alignment.json in OStim directory", command=select_file, bg="silver")
merge_button.pack(pady=20)

# Create the cube
cubo = tk.Canvas(root, width=50, height=50, bg="red")
cubo.pack(pady=10)

# Run the application
root.mainloop()

 

 

 


  • Submitter
  • Submitted
    06/20/2024
  • Category
  • Requires
    Ostim.esp
  • Regular Edition Compatible
    No

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use