From a2ff487267c7dff61553e3ede8e9df3a21a4c58b Mon Sep 17 00:00:00 2001 From: dazedanon <96628874+dazedanon@users.noreply.github.com> Date: Sat, 23 Sep 2023 08:36:11 -0500 Subject: [PATCH] Update README.md --- README.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ba175d..a3fd741 100644 --- a/README.md +++ b/README.md @@ -46,4 +46,79 @@ Now you are all setup, all you need to do is play the game and look for any chan 8. Click Sync to push your changes to your fork. Now all that's left is to put in a pull request. 9. Go to Pull Requests > New Pull Requests. Look at the arrow, your fork should be pointing to the original repo (mine). Add in details on what you fixed and Submit. If everything looks good I'll merge it in and you would have successfully contributed. -Got questions? Just shoot me a message, more than happy to walk you through any of the tools. +Got questions? Just shoot me a message, more than happy to walk you through any of the tools.' + +Editing .ain files +------------------ + +There are two common usage patterns: one for editing text, and one for editing +code. In either case, you will have to enter commands at a command prompt +(e.g. cmd.exe) and edit some (rather large) text files. + +In the following examples, I assume you have a file named "Rance10.ain" in the +current directory which you intend to edit. + +### Editing Text + +First, dump the text using the following command: + + alice ain dump -t -o out.txt Rance10.ain + +This will create a file named "out.txt" containing all of the strings/messages +in the .ain file, sorted by function. + +The syntax of this file is relatively simple. Anything following a ";" +character up until the end of a line is considered a comment and ignored when +the file is read back in. Initially all lines are commented out, meaning that +this file will cause no change to the output .ain file when given to ainedit. +To change a line of text, you must first remove the leading ";" character from +that line. + +An uncommented line should contain one of the following forms: + + s[] = "" + m[] = "" + +The first form represents a string (text used by the game code) while the +second represents a message (text displayed to the player). Simply edit +`` to change the text. + +`` is the ID of the string/message. You should not change this. It may +happen that the same string appears multiple times in the section of text you +are editing. It is only necessary to change the string once. If you set +different values for multiple instances of the same string, only the last +instance will be reflected in the output .ain file. + +Once you've finished editing the text, you can reinsert it back into the ain +file by issuing the following command: + + alice ain edit -t out.txt -o out.ain Rance10.ain + +This will create a file called "out.ain", which is a modified version of +"Rance10.ain" containing the modified text from the file "out.txt". You can +then replace the .ain file in your game directory with this file. + +### Editing Code + +First, dump the code with the following command: + + alice ain dump -c -o out.jam Rance10.ain + +This will create a file named "out.jam" containing the disassembled bytecode +from the file "Rance10.ain". + +A full tutorial on System 4 bytecode is outside the scope of this README. +Suffice to say, it's very low level and you probably don't want to make any +advanced mods using this method (but you're welcome to try). The syntax is +very close to what you'll see in the "Disassembled" and "Combined" views in +SomeLoliCatgirl's "AinDecompiler" tool. + +Once you've finished editing out.jam, you can reinsert the code back into the +.ain file using the following command: + + alice ain edit -c out.jam -o out.ain Rance10.ain + +This will create a file called "out.ain", which is a modified version of +"Rance10.ain" containing the modified code from the file "out.jam". You can +then replace the .ain file in your game directory with this file. +