| Latest version | 3.1.10 |
|---|---|
| Minimum Core | |
| Compatible Core | |
| Last updated | 1 month ago |
| Created | 2 years ago |
| Authors | |
| Languages |
|
| Systems | All systems |
| Project source | Project URL |
Have you ever wanted your players to shake and tremble as the ground rocks and shifts below them? Is a castle crumbling and they need to escape before its too late? Is the very mountain itself exploding with magma as an active volcano erupts?
Well, before now - your players might have no idea... but now - the whole map is SHAKING!!!
EARTHQUAKE is my first release, it allows you to configure an earthquake effect across all players - client side (as well as GM)
The module is configurable, and can be modified at the macro level to change it up!
INSTRUCTIONS:
// Configure the EarthQuake!
const wiggleData = {
action: 'triggerEarthquake',
wiggleAmount: 200, // increase for more shake
wiggleDuration: 5000, // increase for longer duration
};
// Toggle for DM screen shake
const dmShake = true; // Set to false to disable DM screen shake
// Define the sound to play during the quake
const soundToPlay = 'path-to-your-file-here'; // Your sound file
function playSound() {
const sound = new Audio(soundToPlay);
sound.volume = 0.5; // Adjust the volume as needed
sound.play();
}
// Broadcast Earthquake to Players and play sound
game.socket.emit('module.earthquake', wiggleData);
playSound();
// Screen wiggle logic for the GM's screen (if enabled)
if (dmShake) {
const originalPosition = canvas.stage.pivot.clone();
const startTime = Date.now();
function animateGMWiggle() {
const currentTime = Date.now();
const elapsedTime = currentTime - startTime;
if (elapsedTime >= wiggleData.wiggleDuration) {
canvas.animatePan({ x: originalPosition.x, y: originalPosition.y });
return;
}
const xOffset = (Math.random() * wiggleData.wiggleAmount - wiggleData.wiggleAmount / 2) | 0;
const yOffset = (Math.random() * wiggleData.wiggleAmount - wiggleData.wiggleAmount / 2) | 0;
canvas.animatePan({ x: originalPosition.x + xOffset, y: originalPosition.y + yOffset });
requestAnimationFrame(animateGMWiggle);
}
animateGMWiggle();
}
To install this package, open your Foundry Setup screen and navigate to your Module tab and click the Install Module button.
From there, you can either search for the package unique name: earthquake or copy its manifest URL:
And paste it to the input box at the bottom of your window.

You can install this package directly to your Forge account.