ultrakorne / better-rolltables

Module for FoundryVTT to improve rolltables
MIT License
32 stars 28 forks source link

Update Wiki with recent updates #147

Open DanielBoettner opened 2 years ago

DanielBoettner commented 2 years ago

Options argument

With #142

Developers can now use an optional options argument on several methods.

generateLoot(tableEntity, options);
generateChatLoot(tableEntity, options)
betterTableRoll(tableEntity, options)
addLootToSelectedToken (tableEntity, token, options)

options is expected to be a simple object like {key: value}.

As of version 1.8.4 the only option checked for is the rollMode option.

rollMode option

When calling a betterRolltables method you can set the rollMode to be one of the values. mode Description
blindroll roll blind and only visble to gm
gmroll roll visible to self and gm
selfroll roll visible to self

Example:

const mode = 'blindroll',
     options = {
         rollMode: mode,
     };

Populate loot to a token via API

With #141 support for a token argument was added to addLootToSelectedToken (). This allows macros or other modules to give a single token or an array of tokens to the method to be used.

As a fallback the there still is a check for currently controlled tokens.

The options argument currently has no effect on the method.

Example

Where token is either a token or an array of tokens (like canvas.tokens.controlled).

const name = 'myLootRolltable',
          rolltable = game.tables.getName(name);

game.betterTables.addLootToSelectedToken(rolltable, token);
DanielBoettner commented 2 years ago

array of tokens

Will be possible after #145

DanielBoettner commented 2 years ago

/bump @ultrakorne I think this could be added to the wiki