Skip to content
Gabriel edited this page Sep 26, 2023 · 1 revision

Getting started

Table of contents

Setting up a development environment

Hedge Mod Manager supports two methods of storing codes;

  • Creating a work folder in your mods directory at ./.hedgemm/work/Codes/ (recommended).
  • Creating a file in your mods directory called ExtraCodes.hmm.

If you're using the work folder, you should create a file for each code you want to write with a *.hmm file extension.

Do not write new codes in Codes.hmm, any new additions to this file will be erased when your codes are updated within Hedge Mod Manager.

No IDE is required to write HMM codes, but it is highly recommended you use Visual Studio Code, as it can provide syntax highlighting.

Writing codes

Codes start with an identifier to determine how they should behave when executed by the mod loader.

The identifiers are the following;

  • Code - execute this code every frame.
  • Patch - execute this code only once before any game code is executed.

The identifier must be followed by a string literal for the code name.

Your code should be written in C#, within the limitations of .NET Standard 2.0.

Examples

Code "Example Code"
// Write your code here.

Patch "Example Patch"
// Write your code here.

Optional attributes

  • by - used by Hedge Mod Manager to display the author of the code.

    Example

    Code "Example Code" by "Sajid"
    
  • in - used by Hedge Mod Manager to display the category of the code.

    Example

    Code "Example Code" in "General" by "Hyper"
    
  • does - used by Hedge Mod Manager to display the description of the code.

    Single Line Example

    Code "Example Code" in "General" by "Hyper" does "A code to show examples with."
    

    Multiple Line Example

    Code "Example Code" in "General" by "Hyper" does
    /*
    A code to show examples with, but also with multiple lines.
    
    Anything past the first line will be displayed fully in the
    about window when double-clicking a code.
    
    You can also resize the description box in the UI to fit the
    whole description, or double-click the splitter to resize it
    automatically to fit all the text.
    */
    
Clone this wiki locally