hanna-greaves / Token-Says

Tokens speak dialog or play audio based on in game actions.
GNU General Public License v3.0
6 stars 3 forks source link

all versions Latest Release Download Count Forge Installs Foundry Hub Endorsements

Token Says

Bring some penache into your world. With Token Says, make tokens speak dialog and play audio based on in game actions. Use rolltables and playlists to randomize what tokens say.

Animation

Pesky goblins harrass an Azer as they attack. Uses 'Insults For A Lawful Good Character Using Vicious Mockery' rolltable from FVTT Community Tables module in order to randomize through 100 insults.

Video Overview (somewhat dated, does not include recent features)

https://youtu.be/_CRPy2LVicY

Why Use?

A halfling archer that says little quips whenever they score a hit with their shortbow. A samurai warrior that expresses various teachings with each katana strike. A lion that roars on occasional bites. All of these things are possible with Token Says.

Token Says sayings are fully customizable by the GM and are designed to be flexible to your needs. Alleviate some of the burden of being a GM and give your players access to edit their own character's phrases by linking a saying to a rollable table that they have permission to edit. Or, make it simple and link to an existing compendium's rollable table! Don't think that halfling archer would come up with a quip every time? No sweat! Set a likelihood for how often a token will say a particular saying and Token Says will only trigger that percent of the time.

How it Works

The Token Says feature uses a set of Token Says sayings that you create for your world in order to auto generate chat messages, chat bubbles and audio sounds when specific tokens or actors do something. The token may say the same thing every time or it can be randomized using a playlist or rollable table. Other features include:

Token Says Sayings

image

Token Says sayings can be configured within the "Open Sayings" area of the Token Says game module settings. Here you can:

Configure a Saying

tsmove

A Haregon speaks on arrival and his friend responds to their arrival - these are two sayings, one is an action type of Token Movement End and the other is an action type of Reponds To with the responding to action type of Token Movement End.

Each saying is configured on a specific token or actor, based on name, for a given action and the saying is only hit when that token or actor performs the action.

Game Module Settings

See wiki https://github.com/napolitanod/Token-Says/wiki/Game-Module-Settings

Token Form Access

Token Says sayings can be accessed from the header of either the token form or the prototype token form. This gives the GM immediate access from the token form to add, edit, or make other saying changes. image

Export Your Token Sayings

Your sayings can be easily exported from the Token Says sayings configuration window using the export button to the right of the search bar.

Import Token Saying and Share Between Worlds

Your sayings, or sayings from others, can be imported into your world. Imports add new sayings and do not delete existing sayings. Any saying in the import file that shares an id with a saying in your world will be skipped. Note that some sayings may need further configuration after import if compendiums or modules differ between your worlds.

API / Macro Use

tokenSays.says() - ASYNC - call a specific saying from macro/script

tokenSays.says(tokenId, actorId, sayingName);

The tokenSays.says(tokenId, actorId, actionName) function is made available for use within you macros and scripts. The function generates a Token Says message if a saying is found that matches the parameters that you pass in. The return from this function is the Token Says saying data for the saying identified by this function.

To use this function you must have Token Says installed as a module and active and must have a saying with action type = "Macro (API)" with an Token Name that matches the alias of the token or name of the actor that you pass into the function as well as an Action Name that matches the actionName passed into the function.

klhkg

An example saying set up to trigger an audio saying via macro. Note that the macro code is 2 lines. In the first line it grabs a token id by using the current token controlled by the user triggering the macro.

tokenSays.saysDirect() - ASYNC - use Token Says functionality without a saying in place

tokenSays.saysDirect(tokenId, actorId, sceneId, options)

The tokenSays.saysDirect(tokenId, actorId, sceneId, options) function is available to module developers and Foundry users. The function generates a Token Says message based on the parameters. No existing sayings are referenced. This allows module developers and macro writers to dynamically have a token speak, giving them full control over the trigger. The return from this function is the Token Says workflow class that generated the saying.

To use this function you must have Token Says installed

//Example options block
const options = {
    audio: {
        compendium: '',
        source: '',
        quote: ''
    },
    chat: {
        compendium: '',
        source: '',
        quote: 'Hello World!'
    },
    delay: 0,
    lang: '',
    likelihood: 100,
    suppress: {
        bubble: false,
        message: false,
        quotes: false
    },
    volume: 0.50
}

System Compatibility

Though my intent is to have it be system agnostic in terms of the basic features, there may be some incompatible systems that I am not aware of. The list of known compatible systems are:

Module Compatibility

Note To Developers

Enhancements

See a list of upcoming enhancements on the project board https://github.com/napolitanod/Token-Says/projects/1

Acknowledgements

This was my first module: