DiceSetManagerPlugin
Dependency plugin for creating, moving, rolling and clearing dice sets. Includes dice cam options.
About this mod Author’s original text
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
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.
Install these first, or the mod will not work: