In part 1, I showed you where to get Kirikiri Engine and it’s modern fork.
In part 2, we’ll go over scripting, the code, and folder structure.
We’ll first begin with the project structure.
- The “bgimage” folder is where you’ll put your title screen and backgrounds.
- The “bgm” folder is where you’ll put you background music.
- The “fgimage” folder is where you’ll put your character sprites, text boxes, etc.
- The “image” folder is where you’ll put your event CGs.
- The “other” folder is for storing your font, etc.
- The “rule” folder is where you put your transition images.
- The “scenario” folder is the meat of the project. This is where you’ll be writing dialogue, commands, etc.
- The “sound” folder is where you’ll put your sound effects and voice files if your game has voice acting.
- The “system” folder is where the files for creating the main window, etc. live.
- The Video folder is where you store your movies.
- The “plugin” folder is where the plugins you can use for your game reside.
The Line “;System.title = “”;” is for the full name of your game. It’ll appear as the window title.
In “function KAGWindow_config()” is where we set the configuration for our game.
The lines “;sc.Width=640;” and “;sc.Height=480;” is where we set the resolution of our game. I do not know the maximum resolution it can handle, so experiment.
The rest of the lines in the function should be a little self explanatory.
Moving along to “function MessageLayer_config()”, this is where we set our textbox graphic, font, font size, and textbox size and location.
The line “;layerType = “”;” controls the display of our textbox. You have 2 options here: “ltAddAlpha” or “ltAlpha”. This controls the alpha or transparency of the textbox graphics either through masking or if the graphic has an alpha channel.
The line “;frameGraphic = “”;” controls the textbox display. If you wish to use a custom graphic, put the image in the folder “fgimage” and fill in with “fgimage/imagename.png”.
The lines “;ml = 15;”, “;mt = 512;”, “;mw = 640-32;”, and “;mh = 480-32;” deal with the position of the textbox from the left of the main window, top of the main window, width, and height respectively.
Next settings we’ll deal with are line breaks and page breaks. You can have custom images for these though they’ll have to be set up according to the original images. Speaking of, the images you’ll want to alter for these are “linebreak_a.png” and “pagebreak_a.png”. Nothing else needs to be changed.
The rest of files in the “system” folder deal with stopping/starting/fading the BGM, and stuff to do with the engine itself.
Moving along to the final file we’ll be looking at, “startup.tjs”, this is where the engine loads the plugins and draws the game window. It then calls the “Initialize.tjs” to actually load the game, which then reads from “first.ks” to start the game proper.
Stay tuned for Part 3, where we’ll finish up with the actual “.ks” files.