Table Effects

Functions to generate effects.

Functions

EmitLightningArc(src, dest, color, lifetime, amplitude, beamWidth, detail, smooth, endDrift) Emit a lightning arc.
EmitParticle(pos, vel, spriteID, gravity, rotVel, startColor, endColor, blendMode, startSize, endSize, life, applyDamage, applyPoison, spriteSeqID, startRot) Emit a particle.
EmitShockwave(pos, innerRadius, outerRadius, color, lifetime, speed, angle, hurtsLara) Emit a shockwave, similar to that seen when a harpy projectile hits something.
EmitLight(pos[, color][, radius][, shadows][, name]) Emit dynamic light that lasts for a single frame.
EmitSpotLight(pos, dir[, color][, radius][, falloff][, distance][, shadows][, name]) Emit dynamic directional spotlight that lasts for a single frame.
EmitBlood(pos, count) Emit blood.
EmitAirBubble(pos[, size][, amp]) Emit air bubble in a water room.
EmitFire(pos, size) Emit fire for one frame.
MakeExplosion(pos, size, shockwave) Make an explosion.
MakeEarthquake(strength) Make an earthquake
GetWind() Get the wind vector for the current game frame.


Functions

EmitLightningArc(src, dest, color, lifetime, amplitude, beamWidth, detail, smooth, endDrift)
Emit a lightning arc.

Parameters:

  • src Vec3
  • dest Vec3
  • color Color (default Color(255, 255, 255))
  • lifetime float Lifetime in seconds. Clamped to [0, 4.233] for now because of strange internal maths. (default 1.0)
  • amplitude int "strength" of the lightning - the higher the value, the "taller" the arcs. Clamped to [1, 255]. (default 20)
  • beamWidth int Clamped to [1, 127]. (default 2)
  • detail int Higher numbers equal more segments, but it's not a 1:1 correlation. Clamped to [1, 127]. (default 10)
  • smooth bool If true, the arc will have large, smooth curves; if false, it will have small, jagged spikes. (default false)
  • endDrift bool If true, the end of the arc will be able to gradually drift away from its destination in a random direction (default false)
EmitParticle(pos, vel, spriteID, gravity, rotVel, startColor, endColor, blendMode, startSize, endSize, life, applyDamage, applyPoison, spriteSeqID, startRot)
Emit a particle.

Parameters:

  • pos Vec3 World position.
  • vel Vec3 Velocity.
  • spriteID int ID of the sprite in the sprite sequence object.
  • gravity float Specifies if the particle will fall over time. Positive values ascend, negative values descend. Recommended range: [-1000 and 1000]. Default: 0
  • rotVel float Rotational velocity in degrees. Default: 0
  • startColor Color Color at start of life. Default: Color(255, 255, 255)
  • endColor Color Color to fade toward. This will finish long before the end of the particle's life due to internal math. Default: Color(255, 255, 255)
  • blendMode BlendID Render blend mode. TEN.Effects.BlendID.ALPHABLEND
  • startSize float Size at start of life. Default: 10
  • endSize float Size at end of life. The particle will linearly shrink or grow toward this size over its lifespan. Default: 0
  • life float Lifespan in seconds. Default: 2
  • applyDamage bool Specify if the particle will harm the player on collision. Default: false
  • applyPoison bool Specify if the particle will poison the player on collision. Default: false
  • spriteSeqID ObjID ID of the sprite sequence object. Default: Objects.ObjID.DEFAULT_SPRITES
  • startRot float Rotation at start of life. Default: random

Usage:

    EmitParticle(
    	pos,
    	Vec3(math.random(), math.random(), math.random()),
    	22, -- spriteID
    	0, -- gravity
    	-2, -- rotVel
    	Color(255, 0, 0), -- startColor
    	Color(0,  255, 0), -- endColor
    	TEN.Effects.BlendID.ADDITIVE, -- blendMode
    	15, -- startSize
    	50, -- endSize
    	20, -- life
    	false, -- applyDamage
    	true, -- applyPoison
     Objects.ObjID.DEFAULT_SPRITES, -- spriteSeqID
     180 -- startRot
     )
EmitShockwave(pos, innerRadius, outerRadius, color, lifetime, speed, angle, hurtsLara)
Emit a shockwave, similar to that seen when a harpy projectile hits something.

Parameters:

  • pos Vec3 Origin position
  • innerRadius int (default 0) Initial inner radius of the shockwave circle - 128 will be approx a click, 512 approx a block
  • outerRadius int (default 128) Initial outer radius of the shockwave circle
  • color Color (default Color(255, 255, 255))
  • lifetime float (default 1.0) Lifetime in seconds (max 8.5 because of inner maths weirdness)
  • speed int (default 50) Initial speed of the shockwave's expansion (the shockwave will always slow as it goes)
  • angle int (default 0) Angle about the X axis - a value of 90 will cause the shockwave to be entirely vertical
  • hurtsLara bool (default false) If true, the shockwave will hurt Lara, with the damage being relative to the shockwave's current speed
EmitLight(pos[, color][, radius][, shadows][, name])
Emit dynamic light that lasts for a single frame. If you want a light that sticks around, you must call this each frame.

Parameters:

  • pos Vec3 position of the light
  • color Color light color (default Color(255, 255, 255)) (optional)
  • radius int measured in "clicks" or 256 world units (default 20) (optional)
  • shadows bool determines whether light should generate dynamic shadows for applicable moveables (default is false) (optional)
  • name string if provided, engine will interpolate this light for high framerate mode (be careful not to use same name for different lights) (optional)
EmitSpotLight(pos, dir[, color][, radius][, falloff][, distance][, shadows][, name])
Emit dynamic directional spotlight that lasts for a single frame. If you want a light that sticks around, you must call this each frame.

Parameters:

  • pos Vec3 position of the light
  • dir Vec3 direction, or a point to which spotlight should be directed to
  • color Color (default Color(255, 255, 255)) (optional)
  • radius int overall radius at the endpoint of a light cone, measured in "clicks" or 256 world units (default 10) (optional)
  • falloff int radius, at which light starts to fade out, measured in "clicks" (default 5) (optional)
  • distance int distance, at which light cone fades out, measured in "clicks" (default 20) (optional)
  • shadows bool determines whether light should generate dynamic shadows for applicable moveables (default is false) (optional)
  • name string if provided, engine will interpolate this light for high framerate mode (be careful not to use same name for different lights) (optional)
EmitBlood(pos, count)
Emit blood.

Parameters:

  • pos Vec3
  • count int (default 1) "amount" of blood. Higher numbers won't add more blood but will make it more "flickery", with higher numbers turning it into a kind of red orb.
EmitAirBubble(pos[, size][, amp])
Emit air bubble in a water room.

Parameters:

  • pos Vec3 World position where the effect will be spawned. Must be in a water room.
  • size float Sprite size. Default: 32 (optional)
  • amp float Oscillation amplitude. Default: 32 (optional)
EmitFire(pos, size)
Emit fire for one frame. Will not hurt player. Call this each frame if you want a continuous fire.

Parameters:

  • pos Vec3
  • size float (default 1.0)
MakeExplosion(pos, size, shockwave)
Make an explosion. Does not hurt Lara

Parameters:

  • pos Vec3
  • size float (default 512.0) this will not be the size of the sprites, but rather the distance between the origin and any additional sprites
  • shockwave bool (default false) if true, create a very faint white shockwave which will not hurt Lara
MakeEarthquake(strength)
Make an earthquake

Parameters:

  • strength int (default 100) How strong should the earthquake be? Increasing this value also increases the lifespan of the earthquake.
GetWind()
Get the wind vector for the current game frame. This represents the 3D displacement applied by the engine on things like particles affected by wind.()

Returns:

    Vec3 Wind vector.
generated by TEN-LDoc (a fork of LDoc 1.4.6)