Making a Re-Patch

'''I would like to start this page off by saying if you plan to make a short side story I do not recommend reading this page and instead would wish to re-direct you to this page for [http://monstergirlquest.wikia.com/wiki/Making_a_Side_Story making side-stories. ]'''

I tried my best making this guide as user-friendly as possible for those who have no knowledge at all on how to program.

Is this the best option best for you?
Before you delve deeper into this page it is best if you ask yourself these questions, with the first one being one having a different answer from the rest. If you can then you may want to try to make your mod as a side story instead unless there you feel one of the conditions below is also true. If you answered yes to any of these 3 questions you may indeed want to look at this page so continue reading.
 * Is my story something I can finish under 10 thousand lines and if not is it something I can finish in a second installment?
 * Is my story going to be a long one that would require saving and loading in between plays like the normal game or is it something you can play and finish in 1 or 2 sittings?
 * Do I plan to add stuff that might be too hard or even impossible in a side story?
 * Am I willing to look at how the game works or at least learn through trial and error?

The tools for the job
Note some of these that you download you do not exactly install so read on before you believe you have encountered a problem.

Before you can start working on your re-patch mod you will need to download the following programs : Alright now I will explain each tool with screenshots (or a video later on....)
 * The tools for onscripter (Onscripter is the language in which the game runs.)
 * Click here for the Onscripter Tools
 * The tools to unpackage the NSA files (optional but it lets you see the character, background, and voice files used by the game)
 * Here is Crass / Crage. Use this to open the NSA files.
 * Optional -- A good programmer-oriented text editor (unless you are fine with working on wordpad or notepad...)
 * Microsoft Visual Studio works fine also Notepad++ if you do not happen to have MVS (or prefer NP++)

the Onscripter tools will be a bunch of executable files that must be opened via the command line if you plan to use them. You can read the readme file for more instructions in how to handle them but I will tell you how to use the two main ones you will need (unpackaging the script [mainly for the first time] into a text-file and re-packaging the script [for actual game usage] )

I would first suggest moving all those executable and everything included to a folder and move it to your desktop (or whever you feel comfortable.)In my case I have a folder called Onscripter and inside are all those files.

Now then, open up the command prompt. You can do this by hitting the windows key or going to Start then on the search bar type in (without quotes) "cmd" then hit enter. This will give you a black box.

You may see the windows version and what not (I cleared it out of mine before showing the screenshot with "cls")

Next you are most likely gonna need to change the directory (where the command prompt is looking). So type in "cd" and type in the entire directory of where you have your folder with all those executables. In my case I said I have it in my desktop under a folder called Onscripter so I will type that in....



When you hit enter (and you did it correctly), you will notice that the command prompt is now looking inside that place you specified. Make sure you have a copy of the script you are going to unpackage inside the same folder with those executable and type in (without quotes again) "nscdec nscript.dat" this will create a text file called "result" where the script is now readable as a text file. Open it with whatever program you want (like I said I suggest something more orientated for programming like Notepad++) and congratuation now you can see the script in all its Rated R glory. You are free to jump to the next section if you already have (or don't care) opened the NSA files.

Good now you can see what the script file says but now you have to be able to see all the files. Inside the arc files as well no?

Extract the crazz download somewhere (I made a folder for this copy since I changed mine a little bit). After extracting it go inside and look for and open the CrageGUI executeable.

Click the checkmark on Source Path (this way it grabs all the NSA files) then go browse and look for the folder that has all the NSA files (obviously I suggest going to the folder for Chapter 2 of the game since it has the files of both Chapter 1 and 2) Click OK then Execute

Let the program run as it works on extracting  all the files which will be quite alot of resources.



Once its done with all the files unless you went to advanced and change the destination you should find folder inside called output_dir and all the goodies will be inside and you can browse them for reference when you are programming.

Programming Vocabulary
Now I understand not everyone that wishes to make a re-patch has programming knowledge so I will give a quick breakdown on some of the common terms and commands used by the game.

However for a full list of everything that is possible please look at the Reference book found here. Before you go asking around as to what does print mean cause you won't get an answer from me...

Please not all these screenshots are done while using Notepad++ so I cannot help you if you are using anything else.

Ok when you first open up the script you will see some code and will probably be lost already unless you know how to swim already (err...program. I can't swim either...)



first let me explain the simple some of the little nits and bits.

; -- whenever you see this that means everything to the right of it on that line is a comment. A comment is simply that. A comment the program (the game in this case) will not read it and is simply there for the programmer to be able to read it while he is working here. Most comments won't make sense considering they were originally written in Japanese and thus when the character encoding was switched they turned to weird jibberish. If you wish to know check the screenshot below.

Then you are free to either read it yourself if you got the knowledge of use any translator you know. Just be sure to set the character encoding back to "Encode in ANSI" before packaging it back as a script data file.

* - A * is a label. Almost like a flag or a landmark it lets the game know where to go when a certain commands tells it to be.

mov - mov is a command that loads a number or string into a variable.

string - a string is a set of characters (letters, numbers, symbols,etc.) usually an entire string is in between quotations. "This is a string. " this is not a string. "All of this no matter how long or if it has 30 numbers of different #s is a string from quotation to quotation. "

variable - If you have taken Algebra you should know what a variable is. basically a variable (can be a letter or a word) holds a number or a string depending on the type of variable it is.

Most of this will be self explanatory so I'll move onward. You start the game through new-game and it takes you to game_start

and you see the following: *sean0000a mov %manuoff,1 bg black,1 wait 500 lsp 700,":s/24,24,1;#FFFFFFDifficulty? (Changeable On@Loss) ",172,143 csel "Normal",*sean0000b,"Hard",*sean0000b csel"",*sean0000b you goto label *sean000a

and you are moving a number variable (if you see a % then a word it is a number variable. If you see a $ then a word it is a character variable) and we are storing a 1 into that variable.

we are getting our background to black and we are doing it instantly

we then wait 500 milisecconds (half a second)

lsp is loading a sprite (a text sprite at that) I'll ignore the first section of it and jump to the #FFFFFF

those 7 characters is a hexadecimal code color for white meaning the text after it will be white) and they are placing it at the X and Y coordinates of 172, 143 from the upper left corner.

then you are given an option between choosing hard or normal and they both take you to sean000b

so we'll jump to that next *sean0000b if %sentaku=1 mov %nanido,1 if %sentaku=2 mov %nanido,2 cspl 700,701:print 10,500 wait 500 lsp 700,":s/24,24,1;#FFFFFFVore@ScenesH (Changeable in@Special Config) ",172,143 csel "Watch.",*sean0001,"Skip",*sean0001 if you went with the first option (normal) it is going to set a variable called nanido (which basically means difficulty level) to 1

otherwise it will be #2

then it will clear up the sprites and do basically the same thing it did earlier but ask a different thing and go to the next sean simple choices and serves as a simple tutorial if you ask me

Lets jump a few lines now and so we get some more examples

bg "bg\bg001.bmp",99,5000,"system\lngtwave.dll/vwi" wait 1000 >Where am I...? \ >A soft light fills the area, giving the atmosphere a solemn feel. \ >...Is this a dream? \ name "??? " >Luka...@ >Oh brave Luka...\ name "" >I hear a beautiful voice begin to call out to me. @ bgm"bgm\irias.ogg" lsp 700,":a;chara\iriasu_st01.bmp",0,0:print 10,3000 >The goddess Ilias suddenly appears before me! \

now instead of a simple background (black) we are using a string to specify the background.

The game automatically knows to search all the NSA files as you see and thus doesn't specificy with BG folder (whether it be arc or arc1) and then checking all the BG folders does it check for "bg001.bmp" it then uses a special effect (special effects are marked as 99), the effect lasts for 5000 milliseconds (5 seconds) and the special effect is the lngtwave.dll/vwi inside the system folder.

wait causes a pause for 1 second

> - > basically is a line of text.

These lines of text are either cut off by a " \ " or an " @ ". So whats the difference? If you are playing the game on the side while looking at teh code (or you aren't looking carefully enough) they do similar but different things.

\ cuts off the line of text and thus forces you to click (or the spacebar or however else you progress through text) before continuing the rest of the text and it also clears all the text.

@ on the other hand also cuts off the line of text and forces you to click to continue BUT it does not clear the text.

There are times you might wish to continue the text of one line to show up while you are displaying another and thus the @ is avaiable however beware if your lines of text are longer the text box the game will crash so be sure to clear out your text often with \

name - name is actually a command that loads (or removes) a sprite that goes in the name-box for dialogue

if you have "" with no space in between you don't have a name nor a sprite which is very different from " " where you do have a sprite but obviously no name. while they may not seem very important with dialogue be aware of this when using it with skillname which works in the same form of way since leaving the a space between the quotation marks will leaves a black bar that normally displays a skill name but all it is displaying is a space.

Single word names do not require a space and thus putting for example

name "Ilias"

while it MAY not give you an error (a graphic character error not a fatal crash) out of good practice I suggest leaving a space after names and skillnames whether they are only a word long or several.

further down the line you see bgm"bgm\irias.ogg" it is going to loop endlessly (thus act as a background music) the sound file called irias.ogg that is inside the bgm folder. This sound file will not stop until you quit the game. use bgmstop or have it play a new sound file as the bgm