After installing the necessary tools, you'll want to set up your working environment and get ready to work on the code.
This document provides:
- A recommended method to set up your development environment for FoundryVTT.
- Examples to set up your environment
- Examples of specific tasks such as: Unpacking a compendium to a set of JSON files so you can update them.
Before Getting Started
Please note:
- You will need at least some prior knowledge of software development;
- FoundryVTT development involves HTML, CSS, JavaSCript, Git version control concepts and commands, GitHub, and the Linux command-line (or equivalent on Windows). Not all are needed in every case;
- We cannot provide detailed procedures for every step;
- Some steps are summarized but require several actions on your part (e.g. "Set up your local git environment");
- These instructions assume you're running on Linux, either on a desktop install or a virtual environment like VirtualBox.
- An equivalent on Windows is possible using the Windows GitHub tools and the Node,js environment for Windows. You'll need to research this on your own and adapt the instructions as needed.
- The examples here are from
Ubuntu 24.04.1 LTSrunning in VirtualBox on Windows 10.
Table of Contents
This procedure will focus on the actual steps needed to prepare for ACKS development.
- Set up your local git environment (author email etc) on your workstation.
- Set up the connection between your local git environment, and GitHub. There are tutorials and videos on the GitHub site if you need help.
- You may have already done some or all of the nextsteps, and if so, skip to the next major section.
- Sign up for a GitHub account.
- Install Git if needed. If running Linux, you probably already have it.
- Create a public/private SSH key pair that will later be used in the connection between you and GitHub.
- Load your public SSH key into your GitHub user profile.
- Make a development working area under your home directory. I named mine dev.
- Clone the ACKS repository into your working area.
- Following the guidelines in this subsection, install FoundryVTT (one or more versions), but don't run it yet.
- Prepare a separate directory for each FoundryVTT major version you intend to install (e.g. 11 vs 12 vs 13).
For example, I used something like this to install under my home directory:$HOME/foundry/-- A location under your home directory to contain all Foundry installs$HOME/foundry/11data-- Data directory for version 11$HOME/foundry/11program-- Program installation directory for version 11$HOME/foundry/12data-- Data directory for version 12$HOME/foundry/12program-- Program installation directory for version 12
- Download the version(s) of FoundryVTT you want.
- Install each FoundryVTT major version into the directory you created earlier.
3.
$HOME/foundry/11program-- Program installation directory for version 11 5.$HOME/foundry/12program-- Program installation directory for version 12 - Create a shell script containing the command line needed to run each of the FoundryVTT versions.
Create one script per installed version, for example:$HOME/f11.sh-- Shell script to run Foundry11 using data directory foundry/11data$HOME/f12.sh-- Shell script to run Foundry12 using data directory foundry/12data
- Prepare a separate directory for each FoundryVTT major version you intend to install (e.g. 11 vs 12 vs 13).
- Prepare data directory and ACKS game system link
- Launch Foundry VTT so that it creates the desired data directory contents.
- Perform the "Chrome Sandbox" workaround if you have that error and can't run Foundry.
- Shut down Foundry.
- Create a symbolic link inside Foundry's Game Systems directory that points to the ACKS Git repository's src subdirectory.
- Use shell script to start FoundryVTT again.
- Confirm that the ACKS Core Game System is listed as an available game system.
I first installed Foundry version 9, then 11, then 12.
Copy-and-paste commands:
mkdir $HOME/dev/
mkdir $HOME/foundry/
mkdir -p $HOME/foundry/11data
mkdir -p $HOME/foundry/12data
mkdir -p $HOME/foundry/11program
mkdir -p $HOME/foundry/11program
# do the foundry install(s)
mkdir $HOME/dev/
Directory structure example:
* /home/arcanistwill - user home directory
* /home/arcanistwill/dev - all development projects here. Create or clone all Git repos inside here.
* foundryvtt-acks-core - Git clone of the ACKS II VTT
* parser - A parsing project I made
* foundryvtt-acks-calendar - Git clone of a work in progress
* /home/arcanistwill/11foundry/ - location where FoundryVTT version 11 is installed.
* /home/arcanistwill/12foundry/ - location where FoundryVTT version 12 is installed.
* /home/arcanistwill/11foundrydata/ - location of data files used by FoundryVTT v11.
* /home/arcanistwill/12foundrydata/ - location of data files used by FoundryVTT v12.
* /home/arcanistwill/f11.sh - shell script used to launch FoundryVTT v11. You need to create this yourself.
* /home/arcanistwill/f12.sh - shell script used to launch FoundryVTT v12. You need to create this yourself.
Create text files for scripts then chmod to 755 or 775 so that they're executable.
arcanistwill@developer:~$ ls -l f*.sh
-rwxrwxr-x 1 arcanistwill arcanistwill 109 Mar 23 2024 f9.sh
-rwxrwxr-x 1 arcanistwill arcanistwill 113 Mar 23 2024 f11.sh
-rwxrwxr-x 1 arcanistwill arcanistwill 110 Feb 8 09:35 f12.sharcanistwill@developer:~$ cat f9.sh
#!/bin/bash
/home/arcanistwill/foundryvtt/foundryvtt --port=30000 --dataPath=/home/arcanistwill/foundrydata
arcanistwill@developer:~$ cat f12.sh
#!/bin/bash
/home/arcanistwill/12foundry/foundryvtt --port=30000 --dataPath=/home/arcanistwill/12foundrydata
arcanistwill@developer:~$ cat f11.sh
#!/bin/bash
/home/arcanistwill/11foundryvtt/foundryvtt --port=30000 --dataPath=/home/arcanistwill/11foundrydata
I think when I was running version 9, that was on an earlier Ubuntu befire upgrading, then when running 11 and 12 I had this problem.
The workaround was needed for version 11, and then again later for version 12.
sudo chown root /home/arcanistwill/11foundryvtt/chrome-sandbox
sudo chmod 4755 /home/arcanistwill/11foundryvtt/chrome-sandbox
sudo chown root:$(whoami) /home/arcanistwill/12foundry/chrome-sandbox
sudo chmod 4755 /home/arcanistwill/12foundry/chrome-sandbox