Coding tips

From Cosmoteer Wiki
Modding/Coding tips
Jump to navigation Jump to search


Various tips and tricks to help with coding mods.

Basic tips

The .rules files are written in a custom language.

Halfing is the in-house game engine, written in C#. You should be familiar with it after a few crashes.

The game's C# code is accessible for reading with tools such as ILspy and dotPeek. This helps you understand what can and cannot be done with mods.

Syntax Highlighting

Syntax Highlighters make life much easier by highlighting parts of code differently, making it far more legible. For example, it makes .rules paths yellow.

Syntax Highlighters
Name Description IDE Version Publisher Details Notes
Cosmoteer-Rules Language support for the Cosmoteer .rules file. Visual Studio Code 0.0.2 Ataxica Id: Ataxica.cosmoteer-rules Example

Language Server

Language Servers parses your .rules files and give you diagnostics to warn you about syntax failures. Later on as the extension evolves, it will also validate your code, like paths, keys/identifier to make sure, you don't get crashes on startup and many other functions are planned! The current state only provides basic syntax validation for function and paths in the same file.

Language Servers
Name Description IDE Version Publisher
Cosmoteer-Language-Server Language Server support for the Cosmoteer .rules file. Visual Studio Code 0.3.0 TrustNoOneElse

Visual studio code

Tips specific to VSCode.

  • Reopen files from the last time you closed VSCode : set window.restoreWindows to preserve in the settings.
  • Multiple header rows : set workbench.editor.wrapTabs to true in the settings.