AmorLib
My cool library mod for plugin developers
模組介紹 作者原文
AmorLib
Adds an API for plugin developers to modify lights without conflicting with other mods. Decouples StateReplicators from FloLib and SyncedEvents from EEC for convenient host-client syncing. With safe dependency wrappers for InjectLib and PartialData reflection and JsonSerializerOptions. And various other consolidated fixes and utilities.
Basically, a common library so that I don't have to copy paste the same code for each plugin.
Documentation is still a work in progress. Please refer to the GitHub repo or ask in my plugin feedback thread for how to use.
Terminals
Contains the following vanilla bug fixes:
- FlowGeos modded reactor terminal instantiation.
- Hidden terminal commands are fully hidden (not able to be tabbed).
- Reactor terminals are appended to their zone's TerminalsSpawnedInZone.
API
Currently exposes LightAPI. Major thanks to Dinorush for the help with putting this together.
(Expand)
First, you need to pull LightWorker(s) of the lights you want to change. (LightAPI has several helper methods to get certain LightWorkers in a zone or within range of a position.) Then, to add a modifier, call AddModifier on the LightWorker. For example, if you are applying the same modifier to multiple lights:
IEnumerable workersInZone = LightAPI.GetLightWorkersInZone((0, 0, 0));
GetLightWorkersInZone lightMod = workersInZone.AddLightModifiers("red", 1.0f, true, LightPriority.Normal);
This will instantly enable all lights in the elevator zone, set intensity to 1, and change the color to red.
If you want to lerp light settings for individual lights, create a modifier with the current light settings as to not immediately apply new settings:
LightWorker worker = MyCoolWorkers[i]; // example list of LightWorkers
LG_Light light = worker.Light;
ILightModifier mod = worker.AddModifier(light.m_color, light.m_intensity, light.enabled);
// Go to MyCoolCoroutine...
while (time
Other Features
- Dependencies
- InjectLib wrapper
- PData wrapper
- Events
- Additional level-related events
- SNetEvents-related events
- Networking
- StateReplicators
- SyncedEvents
- Utils
- Json-related
- BoolBase
- ValueBase
- LocaleText
- CourseNodeUtil
- GlobalBase & GlobalIndexUtil
- JsonSerializerUtil
- RandomUtil
- ZoneGraphUtil
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。
下面這些內容需要先安裝,否則該模組不會生效: