Latest version | 1.3 |
---|---|
Minimum Core | |
Compatible Core | |
Last updated | 1 year ago |
Created | 1 year 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.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Advertisement cookies are used to deliver visitors with customized advertisements based on the pages they visited before and analyze the effectiveness of the ad campaign.