Chapter 2: The ini filesCustom game
Before we can grasp the concept of the ini files, we need to clarify what is a custom game in Klooni and how Klooni looks for them. When you select custom game from the main menu, Klooni will scan the directory for all subdirectories it can find and check if they contain a certain file.
Custom game is a collection of files in a subdirectory, organized in a way that allows for plug & play mod installation. Even the main game is considered a mod for the game, crazy right. Well for this reason the end user who plays the custom games, doesn't have to do anything special, just launch the custom game from the menu, even his savegame slots will be in the scope of current custom game.
So the custom games were built into this game from the ground up and not hacked in at some point just for kicks, it is the perfect way to expand upon the game later, officially and unofficially.The parser
What is a parser you ask? Consider it like a detective who will run through the ini files with a flashlight looking for certain markings in the file. This detective is very strict guy, only way he approves your ini files, is if they are written correctly to the letter. Meaning if he expects a semicolon, he does not understand what he is reading if it's missing.
Sometimes evil notepad will try to mess with the detective and hide the evidence. So when you save your file make sure that you have selected "all files" in the save dialog, instead of the default *.txtSo the ini files...
There are basically two kinds of ini files in this game and they are as follows:
Basically there's currently only one, and it's purpose is to define the name of the custom game. This is the name that you will see in the custom game menu and main menu when it's loaded in.
Contents of main/modname.ini: (hide)
Note: Remember the detective and evil notepad.Episode specific ini files
Each episode has attributes that are defined by these files. These files control the name of the episode and the maps, as well as partimes, songs, secret levels etc.episode.ini
Remember when I said that a specific file is looked for in each subdirectory when custom game menu is opened, aaah probably not. Anyways, it doesn't make a difference how cool map you whipped up in Chaos-Edit if the detective does not know about it.
So first thing an episode is being loaded, the detective comes in and looks for this file. This file contains the name of the episode and names of all the maps. Pay attention to the following structure and follow it to the letter.
Contents of main/Ep1/episode.ini: (hide)
Note: The first line there before the opening bracket is the episode name. Then after it, we get the names of each map in ascending order ending with a semicolon. The semicolon is important, don't leave it out. Do not add any padding spaces or anything before or after each line. And don't forget the closing bracket.songs.ini is all about the groovy tunes man!
Having music in the maps is not a requirement, but it certainly makes the game more enjoyable. You can define each map it's own unique song. You can also define less songs that there are maps, but then the songs will start repeating at some point. You can also choose to have no music at all by not defining any, but that is retty boring.
Songs can be previewed in Chaos-Edit, but we'll come back to that at a later time.
To have music in your levels, we’ll create a standard ASCII file, just like in the previous step, and name it songs.ini.
Contents of main/Ep1/songs.ini: (hide)
Notice how I add a “," after each entry. The comma is used to tell the parser (mr. detective) that this is the end of the number. It is required even for the last number in the list.
The first number is the music for the first map, the second number is the music for the second map, and so on.
The song number must be in the range of 261-302. To know what song is which number. You have to get a version of Chaos-Edit that supports music chunks that are bigger than 64k.
Note: Currently the songs are defined by their actual tracknumber, the old way is for backwards compatibility only.