Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.
Greatexperiment edited this page Dec 6, 2018 · 40 revisions

When coding files in the mod please refer to the following standards:

Comments

  • Use comments frequently and wherever possible. Attach them at the start of your file, for every category, and every individual item. To serve this there are three comment types:

    • #####-----> This is a comment for the top of the file <><> <><> <><> <><> <><>
    • ###---> This is a category comment for sections <><> <><> <><>
    • #-> This is a comment for individual items <><>
    • Single hash comments are fine for the lowest level of code
  • Comments should usually be attached to the code immediately beneath them so it's clear what it refers to, unless it's a file header or section comment.

Naming

  • Please see the article: naming

Formatting

  • Files must be encoded in UTF8 usually, and sometimes UTF8-Bom.
  • Indent all code blocks for maximum readability.
  • Add spaces between code sections, and double space between major elements.
  • Use 'Guide Files' for reference. These are marked as such in the header comments.
  • Be sure that the order of your elements matches the Guide Files. e.g. research_cost always comes before folder positioning in tech files.
  • Ending brackets for code blocks should always be in-line with the start of the text that initiated it.

Special File Rules

  • Localization files follow different rules than most others.
    • Local files must always have l_english ( or whatever their language is ) at the end of the file name.
    • Must be encoded in UTF8-Bom
    • Normal spacing doesn't apply. Instead indents are done in tab spaces to allow for collapsibility.
    • Insert category "placeholder" entries to collapse whole categories (like event locals)

Examples

  • Bad Formatting

    • Bad Example
  • Good Formatting

    • Good Example

*Please refer to the individual Guide Files found in the mod for further reference.

Clone this wiki locally