AI Generator

AI Generator is a tool that automatically generates AI files for a character that does not have custom AI. The skill of the AI varies, ranging from being able to defeat characters with brutal AI to acting like the default AI. The tool appears to struggle with moves that rely on custom power bars or cutscenes and does not create coding for these moves, so the character will never use them.

Steps

 * 1) Make a backup of the character.
 * 2) Make sure the character does not already have custom AI. If it does, you can still remove the AI coding.
 * 3) Copy and paste AI Generator's files into the character folder. If there's already a common1.cns, don't overwrite it.
 * 4) If any .cns, .st, or .air files are in their own subfolder, create a new folder named "AI-(the name of said subfolder)". For instance, if there is a CNS file in a folder called "CNS", you will need to create a folder called "AI-CNS". It is unneccesary to copy the files into the new folder, they will only be overwritten.
 * 5) Delete any spaces from any file names and do the same for their entries in the character's DEF.
 * 6) Open a command prompt window in the character folder and run ai.exe or ai.py. It is not recommended to run it from Explorer because if it fails, the window will close immediately, not allowing you to read the error for troubleshooting.
 * 7) If there are multiple DEF files, it will ask you to specify which one to scan.
 * 8) The tool will now scan the DEF file and all .cmd, .cns, .st, and .air files it points to. If successful, there will be new files starting with "AI-". Consult the "Troubleshooting" section if it fails and make sure you've followed all previous steps.
 * 9) Open the new AI-.def file and make sure it has st entries pointing to aihelper2.cns and aisummary.txt. (For example, "st2 = aihelper2.cns" and "st3 = aisummary.txt".) They are usually there, but if not, manually add them. Without these entries, the character will still use the default AI.
 * 10) Install the character folder into MUGEN like normal and enjoy.

Troubleshooting

 * If any file has non-ASCII characters, the tool will give a charmap error. Open a file in Notepad++. Press CTRL+H to call the "Replace" window, tick "Regular Expression" under "Search Mode" in the bottom left, put [^\x00-\x7F]+ in "Find What", leave "Replace With" blank, and click "Replace All". This automatically deletes all non-ASCII characters. Repeat this process with all character files referenced by the DEF file.
 * If it gives an "UnboundLocalError" relating to local variable "m0", try running ai.py instead of ai.exe. Otherwise it is unknown how to fix this error.
 * If MUGEN crashes while trying to load a match, it is likely related to aisummary.txt. Refer to the crash message for the problematic character and the specific line in aisummary.
 * If the character seems like it's still using MUGEN's default AI, make sure that the character entry in select.def is pointing to the DEF beginning with "AI-" and not the original DEF. Also check the AI-.def and make sure it's referencing aihelper2.cns and aisummary.txt. (Refer back to step 9.)