Mod Tutorial
  • 🏠Home
  • 😀Introduction
  • 😇Player Manual
    • 📕Installation
    • 📔How to use it
    • 🐴Attention
  • 😅Make Mod
    • 😅Prepare
    • 😎Create a mod
    • 😘Common Features of NML
    • 🤔Others Common
    • 🥸BepInEx
  • 🤔Basic Concepts
    • 👌Mod Declaration
    • 🎨Mod Interface
    • 🥳Mod Configuration
    • 👍Mod Dependency
    • 🤗Multiligual
  • 😶‍🌫️Resources
    • 😣Overview
    • 😮Resources
    • 😣AssetBundle
  • 😪Other techs
    • 👌Mod Reload
    • 🫥Event Handle
    • 😫Mod Upload
  • 🫨Game Contents
    • 🥳Create Equipment Asset
  • 🤩User Interface
    • 😁Button
    • 😂Tab
    • 😄Prefab
    • 😆Common Window
    • 😋Autolayout Window
  • 😘Packed
    • 😍Basic Mod
  • 🚗NML Development and OpenMods Projects
    • Introduction
    • NML Development
    • NML Documentation
    • Example Mod
    • Unity Development Toolkit
    • Game Documentation
Powered by GitBook
On this page
  • For BasicMod
  • Log
  • Mod Instance
  • Mod Info
  • Mod Configuration Window
  • Multiligual
  • Others Common Features
  • Log
  • Sprite
  1. Make Mod

Common Features of NML

For BasicMod

Log

BasicMod provides three static methods to print log with mod name as prefix: LogInfo, LogWarning, LogError.

Mod Instance

BasicMod provides static property to visit your mod instance directly: Instance.

Mod Info

You can get your mod declaration through BasicMod:GetDeclaration. Definition of mod declaration is below:

// Some fields are not shown here, see 'Basic Concept/Mod Declaration' for details
public class ModDeclare
{
    // Mod's name
    public string Name { get; private set; }
    // Mod's ID(It should be unique)
    public string UID { get; private set; }
    // Mod's author
    public string Author { get; private set; }
    // Mod's version
    public string Version { get; private set; }
    // Mod's simple description
    public string Description { get; private set; }
    // URL to repository of the mod
    public string RepoUrl { get; private set; }
    // Necessary(hard) dependencies
    public string[] Dependencies { get; private set; }
    // Optional(soft) dependencies
    public string[] OptionalDependencies { get; private set; }
    // Path to the folder of mod.json
    public string FolderPath { get; private set; };
    // Path to mod's icon file(Related to the folder of mod.json)
    public string IconPath { get; private set; }
}

Mod Configuration Window

Multiligual

Others Common Features

Log

NeoModLoader.services.LogService provides

  • Normal: LogInfo,LogWarning,LogError,

  • Print stack trace: LogStackTraceAsInfo, LogStackTraceAsWarning, LogStackTraceAsError

  • Used in multiple threads: LogInfoConcurrent, LogWarningConcurrent, LogErrorConcurrent.

Sprite

Create a folder named GameResources under your mod folder. .png, .jpg, .jpeg files will be explained by sprites.json or corresponding .meta files and loaded into game.

Then you can get them through Resources.Load, SpriteTextureLoader.getSprite or other related functions.

NeoModLoader.utils.SpriteLoadUtils provides

  • LoadSingleSprite(string) to load a single picture file as a Sprite

  • LoadSprites(string) search related .meta file(parsed into a TextureImporter, and provides a SpriteSheet) or sprites.json to load picture(s) at/under a path.

PreviousCreate a modNextOthers Common

Last updated 1 year ago

BasicMod is a mod providing configuring. You can get instance of ModConfig with GetConfig, Detailed see

Create a folder named Locales, and refers to . Only json and csv files are supported.

Detailed see

😅
😘
Mod Configuration
ModExample
Resources Overview