Skip to content

v2 Documentation Start

Daniel Grace edited this page May 9, 2016 · 3 revisions

StoryDice v2 is based on JavaScript. All macros and user-level code are written in JavaScript. Thus, I won't be documenting JavaScript itself. This document will mostly be a short guide on what special qualities StoryDice itself has and how things differ from normal JavaScript.

echo

To output something, the function is called echo. You would use it like this: !! echo("Yes");

new Character

To create a new character, this is what I'd have you run so far (though this is subject to change): !! user.character = new Character("5e", "Steve'e");. I am planning on supporting multiple types of character sheets. So far 5e is easily the most fully developed.

Altering a character

You can see what your character looks like currently with echo(user.character); You can modify the modifiable parts like this: user.character.str = 15;. Things like strMod aren't directly modifiable.

You can also set your strength, dex, etc. on character creation by doing this:

!! user.character = new Character("5e", "Steve'e", {str: 8, dex: 14, con: 16, int: 10, wis: 12, cha: 18});

Adding Armor

When you echo'd your character, you may have noticed that your AC was a mere 12. What if you wanted to put on some armor?

For armor that comes in the 5e book, you can simply do this:

!! user.character.items.push(Character.armors.Breastplate);

Now you can see that your AC is 16! What if you want a shield? Simple.

!! user.character.items.push(Character.armors.Shield);

Now we're up to 18!

There is a way to add custom armor, but that's a bit beyond this basic guide.

Adding Features

Class features are added in a similar way to armor:

`!! user.character.features.push(Character.features.DefensiveFightingStyle);``

Again, there's a way to do custom features, but that goes beyond this guide. For now, if the feature isn't in the output of !! echo(Character.features); it's not particularly easy to add.

Adding Actions

Want to be able to type !explode and have something happen that's specific to your character? Sweet.

!! user.character.actions.explode = function() { /* Insert JS code here to do things*/ };

Now you can have an explode on each of your characters (note: I haven't fully finalized how to have multiple characters yet) and they can all be different!

Clone this wiki locally