JB2A & FoundryVTT
Advanced notions and guidelines using our content on FoundryVTT
Best Practices
Console
When something goes wrong, opening the console should be your first impulse.
- Windows: Press
F12
- MacOS: Press
Option + CMD + J
You can safely ignore the yellow deprecation warnings. They’re not breaking anything, just letting the developers know that they’ll have to modify some of their code eventually. The red error messages are what we’re looking for. Most of the time, they’ll give you information about which module is implicated in the error.
If you’re overwhelmed with the huge amount of logs, you can clear the console by pressing a button like this one. Here it’s on Chrome but there will be a similar one on other browsers:
Then recreate the issue and check if a red message appears.
How to Troubleshoot
Here are a few best practices for things to check or try when you’re having an issue:
If you are new to this, make sure to read our “Prerequisites” and “Understanding Automation” sections first.
-
Non-Chromium browsers (such as Firefox, Opera, Safari) are known to cause issues. Use a Chromium based browser like Chrome or Edge.
-
Sometimes, refreshing the page, re-starting the server or re-installing the module with the issue can be enough. It’s worth a try.
- Windows:
F5
to refresh orCTRL + F5
to refresh and clear the cache. - MacOS:
CMD + R
to refresh orSHIFT + CTRL + R
to refresh and clear the cache.
- Windows:
-
Check for any updates that might be available for the module you are having issues with and all of its dependencies. It’s usually safe to update your modules.
-
Have you forgotten to enable the module in the world?
-
Is there an error in the console when you trigger the macro or item? Errors are red, yellow ones are deprecation warnings and are safe for you to ignore.
To open the console in FoundryVTT:
- Windows: Press
F12
- MacOS: Press
Option + CMD + J
If you do have an error, please include a screenshot when reporting it.
- Windows: Press
-
Make sure you try with only the required modules activated. It’s often easier to do so in a fresh new world.
You would need at least these modules activated:
- JB2A module, Free or Patreon
- Sequencer
- Socketlib (Sequencer dependency)
- Any other module required for your automation
-
The Github page for each module is, almost always, the best source of information about the module. That’s where the information is most up to date and you can see when the last update to the module occured.
If you use Automated-Animations:
-
Have you targeted a token?
-
Is the Sequencer module up to date?
-
Is your game system supported by Automated-Animations (AA)?
List of compatible game systems -
Is the Diagnostic all green?
-
Open the Autorecognition Menu.
-
Click “Diagnostics” button to open the Diagnotics Window. It should look something lile this.
-
-
Is the item/spell/feature in the global recognition menu?
- Open the Autorecognition Menu and select the apprioprate tab for your effect.
- Use the search bar to find it quickly.
-
Is the item/spell/feature disabled in its AA configuration menu?
- Open the details of an item/spell/feature.
- Check if the animation is enabled and activate “Customize Item” if you want this item to have its own animation.
-
Have you rolled for attack or damage? Check in AA’s settings.
-
??? (about joining the troubleshooting channel)
Advanced
Macros
You need at least a basic understanding of Javascript, knowing what variables are, how to create and manipulate arrays, objects…etc. There are plenty of different beginner courses online for free, here’s an example below.
Javascript Codecademy CourseThen, there are some key concepts for FoundryVTT to understand. Looking through the #macro-polo
channel on the main FoundryVTT discord server is really helpful and there’s almost always someone around to answer any questions you may have.
Hooks and Worldscripts
Now that you know a bit more about Javascript, macros and FoundryVTT’s API, you may want to look into hooks.
What is a hook and why would you need it?
In simple words, everytime something happens in your game, a hook is triggered. It can be from you hovering your mouse on a Token, using a skill, opening a character sheet, the list goes on and on. FoundryVTT provides hooks by default and every system and module can implement its own hooks. To interact with these hooks, retrieving the data and doing something with it, it’s usually better to use a world script. If you use a macro, you’d have to execute it every time you load or refresh your game.
It’s a vast subject and behond the scope of this website. However, here is some documentation on World scripts
Modules
The next step is to create a module. A common way to share your compendia and world scripts across different worlds for example is by creating a small module that you can activate in different worlds!
Module Development Article