DiceSetManagerPlugin
Dependency plugin for creating, moving, rolling and clearing dice sets. Includes dice cam options.
模組介紹 作者原文
Dice Set Manager Plugin
This unofficial TaleSpire plugin for creating, rolling and clearing dice sets. This dice set intercepts the core
TS dice functionality and instead of visualizing the results allows the user to subscribe to the results of the
rolls so that they can be used and/or visualized using a custom manner. Dice created with this plugin can be rolled
both manually (by the player) like core TS dice or automatically from code (such as a ruleset implementation).
Change Log
1.1.1: Added roll Formula to Dice Set object
1.1.1: Removed testing code and testing subscription.
1.1.0: Reworked namespace to allow using Coroutines eliminating need for any Update loop code.
1.1.0: Added dice cam functionality.
1.0.1: Fixed documentation formatting.
1.0.0: Initial release.
Install
Use R2ModMan or similar installer to install this plugin.
Usage
This is a dependency plugin which does not do anything on its own. Instead, it is used by other plugins to take care
of the dice set functionality. The plugin has both basic and advanced features.
This plugin is ideal when the results of the rolls are not to be automatically displayed such as when implementing
the game mechanics for a ruleset. If you want to retain the original core TS dice result display then consider
using Hollo's DiceCallbackPlugin instead.
DiceSet Features
Most methods are accessed through a Instance variable of the DiceSetManagerPlugin as can be seen in the example code.
CreateDiceSet(string dicesetName, string formula)
This method creates dice set (consisting of one or more dice and one or more modifiers) with the given name.
The dice will be created in the TS dice tray, automatically moved to the board, and registed so that other
methods can act on the dice set using the provided name. Example:.Instance.CreateDiceSet("Longbow Damage", "1D8+3+2D6")
MoveDiceSet(string dicesetName, Vector3 pos)
This method takes all the dice associated with the indicated dice set, and moves them to the specified location.
Examples:.Instance.MoveDiceSet("Longbow Damage", new Vector3(2f,2.5f,3.0f));
ThrowDiceSet(string dicesetName, float lift)
This method takes all the dice associated with the indicated dice set, gathers them, lifts them, and rolls them.
The second parameter, lift, is optional. It determines how far the dice are lifted before they are rolled.
Examples:.Instance.ThrowDiceSet("Longbow Damage").Instance.ThrowDiceSet("Longbow Damage", 7.0f)
ClearDiceSet(string dicesetName)
This method unregisters the indicated dice set and removes all dice associated with that dice set. Use this method,
instead of the core TS methods, to remove dice so that the dice set is properly unregistered. Example:.Instance.ClearDiceSet("Longbow Damage")
ClearAllDiceSets()
This method unregisters and all the registered dice sets and removes all the dice associated with the dice sets.
Use this functionality to remove dice sets, instead of using the core TS methods, in order to ensure that the
dice sets are properly unregistered. Example:.Instance.ClearAllDiceSets()
Subscribe(SubscriptionEvent action, string identity, Action callback)
This method provides a way to subscribe to dice set events. The most common dice set event to subscribe to is the
dice roll result event but it is also possible to subscribe to the dice set added and dice set cleared events.
The SubscriptionEvent indicates which event is to be subscribed to. To subscrive to multiple events, either call
the Subscrive method multiple times or separate the different subscription events by a pipe (or operator). The
identity is any unique string that can be used in the Unsubscribe method to remove subscriptions for the indicated
identity. This allows different plugins to subscribe to events without affecting each other. The callback parameter
indicates the function that should be called when the event occurs. The callback function takes single string as
a parameter which passes to it the event arguments as a JSON strin
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。
下面這些內容需要先安裝,否則該模組不會生效: