Pikifen/Text files

From Pikmin Fanon
Jump to: navigation, search

The following article explains how text files work on Pikifen.

The engine reads a text file one line at a time. The most basic type of line is a simple variable and its value. The variable's name comes first, followed by an equals sign, and then the value. Text files may also contain blocks, which in turn can contain variables or blocks. A block starts with its name, followed by an opening curly brace, and ends on a line that contains solely the closing brace.

Example:

variable = value 1
block {
    variable_inside_block = value 2
    sub_block {
        variable_inside_sub_block = another_value
    }
}

It is good practice to indent the lines inside a block. The deeper the block, the deeper the indentation. The engine ignores any spaces or tabs before the first word in the line, so add as many as you want. The engine will also not read empty lines.

As a final note, the engine will not read lines that have two slashes before the first word. Meaning that something like //This is a comment. will not be read. You can use these comments to explain or label parts of the file to make it easier to understand.

Warning: it is preferred that you edit text files with an editor other than Window's "Notepad" program. Try something like Notepad++, otherwise you might see everything in a single line.