explosions interface - Outerra/anteworld GitHub Wiki
this.explosions = this.$query_interface('ot::js::explosions.get');
self.explosions = query_interface("lua.ot.explosions.get")
uint launch_combo(const double3& pos, const float3& speed, float size, const float3& color, const float3& smoke_color, float emitter_radius, float emitter_speed, float particle_size, float smoke_timeout, bool crater, bool solids, bool smoke, bool shadows = false); |
||
Parameter Description | Returns | Description |
---|---|---|
pos: Launch position speed: Launch speed vector size: Size color: Color smoke_color: Smoke color emitter_radius: Emitter radius emitter_speed: Emitter speed particle_size: Particle size smoke_timeout: Smoke timeout crater: Flag for crater creation solids: Flag for solids smoke: Flag for smoke shadows: Flag for shadows |
return: Combo ID | Launch projectile with a combination of effects |
uint launch_tracer(const double3& pos, const float3& speed, float size, const float3& color, float fadeout = 0.5f, float trail = 0.2f, float timeout = 0.0f, float age = 0, uint tracer_id = UMAX32, entity_handle entid = entity_handle(), uint uservalue = 0); |
||
Parameter Description | Returns | Description |
---|---|---|
pos: Launch position speed: Launch speed vector size: Tracer size color: Tracer color fadeout: Emission reduction parameter trail: Length of the trail timeout: Tracer existence time age: Age of the tracer tracer_id: Tracer ID to reuse entid: Object ID to be dragged by tracer uservalue: Custom value |
return: Tracer ID | Launch a ballistic tracer with an explosion on impact |
void flash(const double3& pos, float intensity, const float4& color, float range, float timeout); |
||
Parameter Description | Returns | Description |
---|---|---|
pos: Position intensity: Flash intensity color: Flash color range: Flash range timeout: Flash duration |
Create a flash effect | |
const coid::dynarray<ot::impact_info>& landed_tracers() const; |
||
Parameter Description | Returns | Description |
return: Array of impact_info | Get array of landed tracers | |
void destroy_tracer(uint tracer); |
||
Parameter Description | Returns | Description |
tracer: Tracer ID | Destroy a tracer object before its lifetime ends | |
void make_crater(const double3& pos, float radius); |
||
Parameter Description | Returns | Description |
pos: ECEF world position radius: Approximate crater radius |
Create a crater directly | |
uint create_smoke(const double3& pos, const float3& norm, float radius, float speed, float density, float fade_time, float timeout, const float3& color, float age = 0, uint id = UMAX32); |
||
Parameter Description | Returns | Description |
---|---|---|
pos: ECEF world position norm: Smoke ejection direction radius: Emitter radius speed: Ejection speed density: Smoke density fade_time: Smoke effect duration timeout: Effect timeout color: Smoke color age: Age in seconds id: Emitter ID |
return: Emitter ID | Create a smoke emitter |
void destroy_smoke(uint id); |
||
Parameter Description | Returns | Description |
---|---|---|
id: Smoke emitter ID | Destroy a smoke emitter | |
uint create_solid_particles(const double3& pos, const float3& norm, float emitter_radius, float particle_radius, float speed, float spread = 0.4f, float highlight = 0.0f, float age = 0, const float3& bcolor = float3(0.03, 0.02, 0.01), const float4& hcolor = float4(40, 6, 0, 10), uint id = UMAX32); |
||
Parameter Description | Returns | Description |
---|---|---|
pos: ECEF world position norm: Ejection direction emitter_radius: Emitter radius particle_radius: Max particle radius speed: Ejection speed spread: Direction dissipation highlight: Highlight factor age: Age in seconds bcolor: Base particle color hcolor: Highlight color id: Emitter ID |
return: Emitter ID | Create an explosion of solid particles |
void destroy_solid_particles(uint id); |
||
Parameter Description | Returns | Description |
---|---|---|
id: Particle emitter ID | Destroy solid particles emitter | |
void reset(bool smoke, bool craters); |
||
Parameter Description | Returns | Description |
smoke: Flag for resetting smoke effects craters: Flag for resetting craters |
Reset effects for smoke and craters | |
uint create_beam(float brightness = 100.0f, float half_distance = 7000.0f); |
||
Parameter Description | Returns | Description |
brightness: Beam light power half_distance: Distance at which beam loses half its power |
return: Device ID | Create an infra beam device |
void destroy_beam(uint id); |
||
Parameter Description | Returns | Description |
id: Beam ID | Destroy an infra beam device | |
void beam_on(uint beam, const double3& from, const double3& to, float brightness = 0); |
||
Parameter Description | Returns | Description |
beam: Beam ID from: Start position to: End position brightness: Beam brightness |
Turn the beam on | |
void beam_off(uint beam); |
||
Parameter Description | Returns | Description |
beam: Beam ID | Turn the beam off | |