How to create a migration script with an AI tool
BEFORE YOU START — READ THIS
This guide assumes you have
basic Python knowledge — what a .py file is, how to run a script from a terminal, and how to edit a file. If you don't know what Python is,
stop here — this is not for you.
This script
modifies your scene files. It creates a .bak backup before writing, but
back up your scenes manually, no one is responsible for your files but you.
What this script does: Migrates old
CheesyFX.HeelAdjust2 plugin references to the new
Nickon7777.HeelAdjust3 path inside VaM scene JSON files. You only need to run this
once per scene that still references the old plugin.
This script does NOT work on scenes inside .var packages. You should unpack it manually before.
BEFORE YOU PASTE THE PROMPT — MAKE YOUR CHOICES
Read through these options, decide what you want, and
edit the prompt below accordingly before sending it to the AI.
1. Version format — How should the new plugin path look?
| Option | Path | Notes |
|---|
| .latest (recommended) | Nickon7777.HeelAdjust3.latest:/Custom/Scripts/Nickon/HeelAdjust2/HeelAdjust2.cslist | VaM will automatically use the newest installed version. Simpler for my future updates. However VaM applies an exact version upon scene re-save. |
| .n (pin version) | Nickon7777.HeelAdjust3.5:/Custom/Scripts/Nickon/HeelAdjust2/HeelAdjust2.cslist | Replace 5 with the actual version number you have installed. VaM will always use exactly this version. |
Pick one and replace the NEW_PATH value in the prompt below.
3. Recursive directory scanning — optionally ask to add --recursive flag support to the script
4. Backup behavior
9. Shebang line (#!/usr/bin/env python3) — This line lets Unix/Linux/Mac users run the script directly without typing python. On Windows it does nothing useful and can cause confusion with Python version selection.
If you don't know what this is, remove it from the prompt.
THE PROMPT
Copy-paste the text below into any AI (Google Gemini, ChatGPT, Claude, Copilot, etc.).
Make sure you applied your choices from above first.
Write a Python 3 script called !update_heel_adjust.py that replaces old CheesyFX.HeelAdjust2 plugin references with Nickon7777.HeelAdjust3 in Virt-a-Mate scene JSON files.
Requirements:
- The old plugin prefix is CheesyFX.HeelAdjust2. (note the trailing dot). Any plugin value that starts with this prefix should be replaced with the new path: Nickon7777.HeelAdjust3.latest:/Custom/Scripts/Nickon/HeelAdjust2/HeelAdjust2.cslist
- Plugin references are stored inside Person atoms in the scene JSON. The structure is:
{ "atoms": [ { "type": "Person", "storables": [ { "id": "PluginManager", "plugins": { "plugin1": "CheesyFX.HeelAdjust2.1:/...", ... } } ] } ] }
Iterate over atoms, find ones with "type": "Person", then find the storable with "id": "PluginManager", then check each value in the "plugins" dictionary. If the value is a string starting with the old prefix, replace it.
- Accept command-line arguments in two modes:
- Individual files: python !update_heel_adjust.py scene1.json scene2.json
- Whole directory: python !update_heel_adjust.py --dir /path/to/scenes (processes all *.json files in that directory, non-recursively)
- Before writing changes, create a backup by renaming the original file to originalfile.json.bak. If a .bak already exists, overwrite directly without creating a second backup.
- Use json.dump(data, f, indent=2, ensure_ascii=False) to write the modified JSON back.
- Print what was replaced (which atom, which plugin key) and whether any changes were made. If no old references were found in a file, print "no changes".
- Use utf-8 encoding for all file I/O.
- Use only standard library modules (json, os, sys, glob). No external dependencies.
- Include a docstring explaining the purpose and usage. Note that it does not work on scenes inside .var packages.
AFTER YOU GET THE SCRIPT
- Save the output as !update_heel_adjust.py in your VaM/Saves/scene folder.
- Open a terminal / command prompt.
- Run it against your scene files:
python "!update_heel_adjust.py" your_scene.json
Or against a whole folder:
python "!update_heel_adjust.py" --dir "C:\Users\You\VaM\Saves\Scene"
- Check the output — it will tell you exactly what was replaced.
- Your original files are saved as .bak next to the originals.