BernhardPosselt / foundryvtt-special-dice-roller

A FoundryVTT module that supports rolling L5R, VtM 5e, Genesys and SWTTRP dice in chat
GNU Affero General Public License v3.0
13 stars 17 forks source link

[Question] How do you call the special dices in macros? #44

Closed Tranhultarn closed 2 years ago

Tranhultarn commented 2 years ago

I'm trying to create some macros that uses the special dices but can't figure out how to call for the special dice.

I'm using the following code for regular dice but I'm trying to utilise it for the vampire version instead, const myValue = await Dialog.prompt({ content: <input type="text">, callback: (html) => { return html[0].querySelector("input").value; } }); await new Roll(${myValue}d10s).toMessage();

BernhardPosselt commented 2 years ago

Check https://github.com/BernhardPosselt/foundryvtt-special-dice-roller#rolling-dice-programmatically

which should be roughly game.specialDiceRoller.v5.rollFormula("hh", "you start raging")

Tranhultarn commented 2 years ago

Thanks for a very fast answer.

I've tried to implement that code but I'm simply too incompetent at programming. How do I get game.specialDiceRoller.v5.rollFormula("hh", "you start raging") to be rolled and shown in the chat. I've tried to implement it with the old code without success :/

BernhardPosselt commented 2 years ago

You're getting back the html code and then need to post it to chat using a ChatMessage, see https://www.reddit.com/r/FoundryVTT/comments/ivmlb6/macro_help/

Tranhultarn commented 2 years ago

Aha, now I get it! Everything works now! Thanks!!