mirror of
https://github.com/t-affeldt/climate_api.git
synced 2025-07-03 00:40:36 +02:00
Tweak world cycle, add documentation
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
--[[
|
||||
# HUD Overlay Effect
|
||||
Use this effect to display a fullscreen image as part of a player's HUD.
|
||||
Expects a table as the parameter containing the following values:
|
||||
- ``file <string>``: The name (including file ending) if the image to be displayed
|
||||
- ``z_index <number>`` (optional): The z_index to forward to player.hud_add. Defaults to 1
|
||||
- ``color_correction <bool>`` (optional): Whether the image should automatically darken based on current light. Defaults to false.
|
||||
]]
|
||||
|
||||
if not climate_mod.settings.hud_overlay then return end
|
||||
|
||||
local EFFECT_NAME = "climate_api:hud_overlay"
|
||||
|
@ -1,3 +1,21 @@
|
||||
--[[
|
||||
# Particle Effect
|
||||
Use this effect to render downfall using particles.
|
||||
Expects a table as the parameter containing the following values:
|
||||
- amount <number>: The quantity of spawned particles per cycle
|
||||
- EITHER texture <string>: The image file name
|
||||
- OR textures <table>: A list of possible texture variants
|
||||
- falling_speed <number>: The downwards speed
|
||||
- min_pos <number>: Bottom-left corner of spawn position (automatically adjusted by wind)
|
||||
- max_pos <number>: Top-right corner of spawn position (automatically adjusted by wind)
|
||||
- acceleration <vector> (optional): Particle acceleration in any direction
|
||||
- exptime <number>: Time of life of particles
|
||||
- time <number> (optional): The time of life of particle spawners (defaults to 0.5)
|
||||
- EITHER size <number>: Size of the particles
|
||||
- OR min_size <number> and max_size <number>: Minimum and maximum size
|
||||
- vertical <bool> (optional): Whether particles should rotate in 2D space only (default depends on falling vector)
|
||||
]]
|
||||
|
||||
if not climate_mod.settings.particles then return end
|
||||
|
||||
local EFFECT_NAME = "climate_api:particles"
|
||||
@ -10,7 +28,7 @@ local function get_particle_texture(particles)
|
||||
end
|
||||
|
||||
local function spawn_particles(player, particles)
|
||||
local ppos = player:getpos()
|
||||
local ppos = player:get_pos()
|
||||
local wind = climate_api.environment.get_wind()
|
||||
|
||||
local amount = particles.amount * climate_mod.settings.particle_count
|
||||
|
@ -1,3 +1,15 @@
|
||||
--[[
|
||||
# Skybox Effect
|
||||
Use this effect to modify a player's sky, clouds, sun, moon, or stars
|
||||
Expects a table as the parameter containing the following values:
|
||||
- ``sky_data <table>`` (optional): Sky paramaters to be applied using player.set_sky
|
||||
- ``cloud_data <table>`` (optional): Cloud paramaters to be applied using player.set_clouds
|
||||
- ``sun_data <table>`` (optional): Sun paramaters to be applied using player.set_sun
|
||||
- ``moon_data <table>`` (optional): Sky paramaters to be applied using player.set_moon
|
||||
- ``star_data <table>`` (optional): Sky paramaters to be applied using player.set_stars
|
||||
- ``priority <number>`` (optional): A skybox with higher priority will override lower rated ones (defaults to 1)
|
||||
]]
|
||||
|
||||
if not climate_mod.settings.skybox then return end
|
||||
|
||||
local EFFECT_NAME = "climate_api:skybox"
|
||||
|
@ -1,3 +1,12 @@
|
||||
--[[
|
||||
# Sound Loop Effect
|
||||
Use this effect to loop an ambient sound effect
|
||||
Expects a table as the parameter containing the following values:
|
||||
- ``name <string>``: Name of the played sound effect (without .ogg file ending)
|
||||
- ``gain <number>`` (optional): Volume of the sound (defaults to 1.0)
|
||||
- ``pitch <number>`` (optional): Pitch of the sound (defaults to 1.0)
|
||||
]]
|
||||
|
||||
if not climate_mod.settings.sound then return end
|
||||
|
||||
local EFFECT_NAME = "climate_api:sound"
|
||||
|
Reference in New Issue
Block a user