Example mod · theonaris.examples.effects-lab 1.0.0
Effects Lab
A test bench for particles, sounds, music, camera shake and video. Press F6 in game to open it. It changes nothing for other players, so it works on any server.
Download Effects Lab (3.2 MB)
Install: put the .zip (or the unpacked folder) in your mods folder: in the game, Mods → Open folder. Then start the game and allow the permissions.
A test bench for everything a mod can make you see and hear: particle effects, sound effects, positioned sound, music with fades, camera shake and zoom, and video. Press F6 in game.
It is a personal mod ("network": "local"). It is never sent to other players, never required from them, and works on any server.
| You will learn | Where |
|---|---|
| Effect presets and every option: colour, size, count, rate, custom texture | effects.burst, effects.start |
| An effect that follows a moving object | Effect:follow, timer.every(0, …) |
| Plain and positioned sounds | audio.play with and without position |
| Music: loop, fade in, fade out, live volume | audio.music, Sound:fadeOut, Sound.volume |
| Camera shake and field of view | camera.shake, camera.zoom |
| Video on an interface element | video.onElement, Video:stop |
| A tabbed window that frees the mouse cursor | TabView in .uxml, cursor.free |
| Filling a dropdown from code | UiElement:set("choices", …) |
| Features that depend on an optional file | mod.exists |
| Personal mods | "side": "client", "network": "local" |
Try it
- Install and start the game, and allow the permissions.
- Load any map and press F6.
- Particles: choose a preset and colour and press Burst. Orbiting fountain starts an effect that follows a moving glowing ball.
- Sound: tick Play 25 m in front of me and turn your head to hear the direction change.
- Video: tick Play video/demo.mp4.
Notes
- Effects start from a preset (
sparks,smoke,fire,glow,dust,explosion,magic), and every value can be changed.textureuses a picture from your mod as the particle. - Sounds and music follow the player's own volume sliders and play through the game's mixer. A mod cannot be louder than the player allows.
- Camera effects respect the player's comfort settings.
- Video files are
.mp4(H.264) or.webm(VP8). To play your own clip, put any.mp4atvideo/demo.mp4.
Files
mod.json
scripts/client.lua
ui/lab.uxml, ui/lab.uss
sounds/laser.wav, explosion.wav, coin.wav, alarm.wav, powerup.wav
music/lab-loop.wav
textures/star.png custom particle
video/demo.mp4 4-second demo clip with soundtrackAll files
| File | Size |
|---|---|
mod.json | 753 B |
music/lab-loop.wav | 1.4 MB |
README.md | 3 KB |
scripts/client.lua | 6 KB |
sounds/alarm.wav | 276 KB |
sounds/coin.wav | 86 KB |
sounds/explosion.wav | 379 KB |
sounds/laser.wav | 60 KB |
sounds/powerup.wav | 155 KB |
textures/star.png | 1 KB |
ui/lab.uss | 2 KB |
ui/lab.uxml | 3 KB |
video/demo.mp4 | 860 KB |