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
  • HarmonyTranspiler
  • Listener-Handler(Developing)
  1. Make Mod

Others Common

PreviousCommon Features of NMLNextBepInEx

Last updated 1 year ago

If you want to modifies functions in game or do something before or after a function, you need HarmonyPatch

Using HarmonyPrefix to overwrite vanilla function is easy to do, but it may causes incompatible with other mods.

Here are two approaches to anesis it:

HarmonyTranspiler

Insert IL code into methods to implement what you want. It has a learning cost, but is quite flexible and has a much more efficient runtime than HarmonyPrefix.

Listener-Handler(Developing)

It is a feature provided by NML. Simply speaking, NML uses HarmonyTranspiler to implement Listeners listening to vanilla functions and call all registered and related Handler to handle the event.

NML also catches exceptions when Handler excuting. When the number of exceptions is greater than a certain value, the Handler will be deactivated to ensure the normal operation of the game.

😅
🤔
Documentation