SOD CustomStateInjector Miami

版本 v1.1.0·更新於 2024-08-05

SOD.CustomStateInjector.Miami is a plugin that allows the addition of custom states and their generation processes through attributes for automatic execution.

模組介紹 作者原文

SODCustomStateInjectorMiami

CustomStateInjector.Miami (CSI Miami for short) is a plugin designed to allow the injection of custom generation steps during Shadows of Doubt map generation process. It uses attributes for ease of use.

Table of Contents

  • Installation
  • Usage
  • Creating Custom States
  • Generating Custom States
  • Contributing
  • License

Installation

  • Download and install BepInEx, if not already installed.
  • Place the SOD.CustomStateInjector.Miami.dll into the BepInEx/plugins folder of your game directory.

Usage

To use the plugin in your code, you must call it in your Plugin.Load() function like so

using SODCustomStateInjectorMiami;

using SODCustomStateInjectorMiami.Attributes;

namespace YourNamespace;

[BepInPlugin("com.yourname.yourplugin", "Your Plugin Name", "1.0.0")]

[BepInDependency("Cukeds.CustomStateInjector.Miami")] // Recommended

public class Plugin

{

public override void Load()

{

CustomStateInjector.InjectStates();

}

}

Creating Custom States

To create a custom state, define a class and annotate it with the CustomStateAttribute. The attribute requires two parameters:

  • stepName: The name of the custom state.
  • afterStepName: The name of the state after which the custom state should be executed. It can be either a regular step or a custom step

Single Step Example:

[CustomState("generateClubs", "generateCompanies")]

public static class CustomStateGenerator

{

[GenerateState("generateClubs")]

public static void GenerateClubs()

{

Plugin.Log.LogInfo("Generating clubs...");

}

}

Multiple Step Example

[CustomState("generateClubs", "generateCompanies")]

[CustomState("generateGuards", "generateClubs")]

[CustomState("generateFaces", "generateBlueprints")]

public static class CustomStateGenerator

{

[GenerateState("generateClubs")]

public static void GenerateClubs()

{

Plugin.Log.LogInfo("Generating clubs...");

}

[GenerateState("generateGuards")]

public static void GenerateGuards()

{

Plugin.Log.LogInfo("Generating guards...");

}

[GenerateState("generateFaces")]

public static void GenerateFaces()

{

Plugin.Log.LogInfo("Generating faces...");

}

}

Game's generation steps in the order they appear in the Enum

parsingFile

setupCityBoundary

generateDistricts

generateBlocks

generateDensity

generateBuildings

generatePathfinding

generateBlueprints

generateCompanies

connectRooms

generateCitizens

generateRelationships

gatherData

generateAirDucts

generateEvidence

generateInteriors

prepareCitizens

loadObjects

finalizing

savingData

loadState

preSim

loadComplete

Generating Custom States

Methods to generate the custom states must be annotated with the GenerateStateAttribute, which takes a single parameter:

  • stateName: The name of the state to be generated.

The plugin automatically registers and validates these methods upon loading.

Contributing

  • Fork the repository.
  • Create a new branch (git checkout -b feature/your-feature-name).
  • Commit your changes (git commit -am 'Add some feature').
  • Push to the branch (git push origin feature/your-feature-name).
  • Create a new Pull Request.

Needed dlls are included in the repository, but you may need to update them to the latest version.

License

This project is licensed under the MIT License - see the LICENSE file for details.

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

檔案與校驗

檔案名稱
SOD_CustomStateInjector_Miami-1.1.0.zip
檔案大小
12.8 KiB
SHA-256
ae971cba313d655a9268520ac1dfa0e4ebd04d5ec2e059d23e05170ad682fc0a
入庫時間
2026-10-12 00:58