What a script puts in front of the player: things seen rather than things the game holds.
The level fog bulbs, counted from 1. #trx.fx.fog_bulbs is the count.
pairs() walks them in order. A level shows at most twenty. The player can turn them off.
trx.fx.fog_bulbs[key] (key: integer, value: trx.fx.FogBulb or nil).#trx.fx.fog_bulbs (integer). How many there are.Example:
for _, bulb in pairs(trx.fx.fog_bulbs) do
bulb.color = trx.math.color(245, 200, 60)
end
The spark pool, counted from 1. #trx.fx.sparks.pool is
MAX_COUNT rather than how many sparks are alive: a slot holding
no live spark reads as nil.
trx.fx.sparks.pool[key] (key: integer, value: trx.fx.Spark or nil).#trx.fx.sparks.pool (integer). How many there are.Example:
for _, spark in pairs(trx.fx.sparks.pool) do
spark.color = trx.math.color(255, 0, 0)
end
trx.fx.fog_color (trx.math.Color). The color override for distance fog.
nil means no override. Write nil to restore the level fog color. A level change clears the
override. Savegames keep it. This controls distance fog only. Fog bulbs have their own colors
in trx.fx.fog_bulbs.trx.fx.sparks.wind (trx.fx.Wind). The wind that carries the sparks marked trx.fx.Spark.is_outside.
The engine works this out again every frame from the breeze setting, so a value
written here holds for that frame alone.trx.fx.MAX_LIGHTS = 64 (integer)
How many lights a script can put up in one frame.
trx.fx.MAX_FOG = 10 (integer)
How many balls of fog can be seen at once. TR4 levels carry fog of their own, which takes its slots first, so fewer than this reach the screen where a level is already using them.
trx.fx.sparks.MAX_COUNT = 400 (integer)
How many sparks the pool holds. A spark spawned after that takes the slot of the one with the least life left.
Which spark-set sprite a spark is drawn with.
trx.fx.SparkType.EXPLOSION = 0trx.fx.SparkType.SMALL_SPLASH = 4trx.fx.SparkType.BIG_SPLASH = 8trx.fx.SparkType.RIPPLE = 9trx.fx.SparkType.PARTICLE = 10trx.fx.SparkType.SHIELD = 11trx.fx.SparkType.ROPE = 19trx.fx.SparkType.DRIVE = 20trx.fx.SparkType.REVERSE = 21trx.fx.SparkType.RICOCHET = 36trx.fx.SparkType.BLOOD = 39How a sprite is laid over what is behind it.
trx.fx.DrawType.OPAQUE = 0trx.fx.DrawType.BLEND = 1trx.fx.DrawType.BLEND_ADD = 2trx.fx.DrawType.BLEND_SUB = 3trx.fx.DrawType.REFLECTIVE_OPAQUE = 8trx.fx.DrawType.REFLECTIVE_BLEND_ADD = 9A level fog bulb is a ball of fog drawn inside a room.
TR4 stores fog bulbs as room lights. A script can change their color and density. The level sets their position and radius. A bulb follows the fog color until a script gives it a color of its own.
Handles are live references: if the underlying object is destroyed, using the handle raises an error rather than silently reading an unrelated one.
Properties:
color: trx.math.Color. The color a script gave the bulb.
nil means none was given, and the bulb is drawn in the fog color in force. Write nil to hand
a bulb back to that color.density: integer. Fog density, from 0 for none to 255. A value outside this range raises an error.pos: trx.math.Vec3. Center of the fog bulb. (read-only)radius: trx.math.Distance. How far the fog reaches from that position. (read-only)Computed properties (derived, not stored on the object):
room: trx.rooms.Room. The room the bulb sits in.Methods:
A spark is one particle from the spark pool: a sprite that lives for a set number of frames, moving, resizing and fading on its own as it does.
TR3 and TR4 only. The earlier games carry no spark set, so nothing spawns one and the pool stays empty.
A spark that runs out of life leaves its slot to the next one asked for. A handle held across that becomes stale, and field access raises an error.
Handles are live references: if the underlying object is destroyed, using the handle raises an error rather than silently reading an unrelated one.
Properties:
color: trx.math.Color. The color it is drawn in now.draw_type: trx.fx.DrawType. How it is laid over what is behind it. (read-only)end_color: trx.math.Color. The color it fades to.end_height: integer. The height it grows to.end_width: integer. The width it grows to.extras: integer. How many further sparks it leaves behind as it ends.fade_speed: integer. How fast it travels from one color to the other.fade_to_black: integer. How many frames of life are left when it starts to darken toward black.friction: integer. How fast it is slowed each frame.gravity: integer. How much it is pulled down each frame.height: integer. How tall it is drawn now.is_blood: boolean. Whether it counts as blood, which the pool sheds first when it runs short of slots.is_green: boolean. Whether it is drawn in the green of the poison gas.is_outside: boolean. Whether the wind carries it.is_underwater: boolean. Whether it drifts like an underwater particle.life: integer. Frames of life left. It reaches zero and the spark ends.life_span: integer. Frames of life it started with, which the fades are measured against.max_y_vel: integer. As fast as gravity may carry it down.node_num: integer. Which of the sixteen body points it hangs off, where it is attached to one.pos: trx.math.Vec3. Where it sits, in the world, or from what it is attached to. Read world_pos for the position it is drawn at.room_num: trx.rooms.Num. The room it was spawned in. (read-only)rot_add: integer. How far it turns each frame.rot_angle: integer. How far it is turned about the view, from 0 to 4095.rotates: boolean. Whether it turns as it lives.scalar: integer. How strongly the size is scaled with distance.scales: boolean. Whether it travels from its start size to its end size.start_color: trx.math.Color. The color it fades from.start_height: integer. The height it grows from.start_width: integer. The width it grows from.uses_alt_sprite: boolean. Whether it is drawn with the second sprite of its kind.vel: trx.math.Vec3. How far it moves each frame.width: integer. How wide it is drawn now.Computed properties (derived, not stored on the object):
item: trx.items.Item. The item it is attached to, and nil where it hangs on nothing.room: trx.rooms.Room. The room it was spawned in.world_pos: trx.math.Vec3. Where it is drawn, which is where it sits unless it is attached to something that carries it.Methods:
How far the wind carries a spark each frame.
Properties:
x: trx.math.Distance. The east-west axis.z: trx.math.Distance. The north-south axis.trx.fx.sparks
The spark pool: the particles TR3 and TR4 draw their smoke, flames, sparks and
splashes with.
TR1 and TR2 carry no spark set. There the pool stays empty, and everything here returns nothing rather than raising.
trx.fx.emit_light(opts)
Lights the world around a point for this frame. Make the call every frame to
keep the light up, and at a new position each time to move it.
A frame shows only trx.fx.MAX_LIGHTS lights. A light asked for past that
takes the place of the one furthest from the camera, so the nearest are the
ones seen. No error is raised.
TR1 and TR2 light in brightness alone, so there the light is as bright as its brightest channel and comes out white.
Parameters:
opts (table). Where the light is and what it looks like.
Keys:
pos (trx.math.Vec3). World position.radius (trx.math.Distance, optional, default 3072). How far it reaches, at least an eighth of a sector. Rounded down to the eighth of a sector the engine measures a dynamic light in, and carried about a quarter further than asked for in TR4, which falls a light off more gently.color (table, optional). Its color, each channel 0 to 255. Defaults to white.Example:
trx.events.after_control(function()
trx.fx.emit_light({
pos = trx.lara.item.pos,
radius = 2048,
color = { r = 0, g = 255, b = 192 },
})
end)
trx.fx.emit_fog(opts)
Fills a ball of air with fog for this frame, which the player sees through
rather than on. Where a light brightens what it falls on, this hangs in the
space itself. Make the call every frame to keep the fog up.
A frame shows only trx.fx.MAX_FOG balls of fog. A ball asked for past that
takes the place of the one furthest from the camera, so the nearest are the
ones seen. No error is raised.
Parameters:
opts (table). Where the fog is and what it looks like.
Keys:
pos (trx.math.Vec3). World position.radius (trx.math.Distance, optional, default 2048). How far the fog reaches, at least one unit.density (integer, optional, default 128). How thick it is, from 0 for nothing to 255.color (table, optional). Its color, each channel 0 to 255. Defaults to white.Example:
trx.events.after_control(function()
trx.fx.emit_fog({
pos = { x = 32768, y = -1024, z = 45056 },
radius = 3072,
density = 64,
color = { r = 128, g = 160, b = 192 },
})
end)
trx.fx.blood(opts)
Throws a spray of blood into the world at a point, the way a blow that lands
does. The drops then fall on their own.
TR3 and TR4 throw drops that fall and darken as they go, and in TR4 a hit under water spreads as a cloud instead. TR1 and TR2 have one blood sprite that drifts up.
Unlike the rest of the module, this has a bearing on what the game decides. The engine places the drops from the control random stream, and in TR1 and TR2 the spray takes a slot from the effect pool a save holds.
Parameters:
opts (table). Where the blood is and how much of it.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.angle (trx.math.Angle, optional). The way the drops fly. Left out, TR4 throws them every way, which is what its own hits do where nothing aims them; the other games read it as straight ahead.strength (integer, optional, default 5). How heavy the hit reads, from 1 to 255. TR3 and TR4 count it in drops, TR4 measures the width of a cloud under water with it, and TR1 and TR2 have one drifting sprite whose speed it sets.Example:
trx.events.on_hit(function(item, damage)
trx.fx.blood({ pos = item.pos, angle = item.rot.y, strength = damage })
end)
trx.fx.blood_bath(opts)
Throws several sprays of blood about a point, the way a trap that kills does.
Each one lands anywhere in the half-sector box around the point, so the blood
covers a body rather than a spot.
Each spray costs what trx.fx.blood costs, in random draws and in effect
slots.
Parameters:
opts (table). Where the blood is, how much of it, and how many sprays.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.angle (trx.math.Angle, optional). The way the drops fly. Left out, TR4 throws them every way, which is what its own hits do where nothing aims them; the other games read it as straight ahead.strength (integer, optional, default 5). How heavy the hit reads, from 1 to 255. TR3 and TR4 count it in drops, TR4 measures the width of a cloud under water with it, and TR1 and TR2 have one drifting sprite whose speed it sets.count (integer, optional, default 5). How many sprays, from 1 to 255.Example:
trx.fx.blood_bath({ pos = trx.lara.item.pos, count = 10 })
trx.fx.explosion(opts)
Shows the explosion a rocket or a grenade leaves behind, without the damage.
TR1, TR2 and TR4 draw the explosion sprite the level carries. TR3 has none, and gets a fireball of sparks instead. Under water the effect uses the drowned version, which throws a burst of bubbles and lifts a splash where the water ends.
Parameters:
opts (table). Where the explosion is and whether it is heard.
Keys:
pos (trx.math.Vec3). World position.sound (boolean, optional, default true). Whether the explosion sound plays with it.Example:
trx.fx.explosion({ pos = trx.lara.item.pos })
trx.fx.fire(opts)
Burns a fire at a point for this frame. Make the call every frame to keep the
fire alight.
TR4 only. The other games have no such fire, so the call does nothing there.
Parameters:
opts (table). Where the fire is and how it burns.
Keys:
pos (trx.math.Vec3). World position.size (integer, optional, default 1). How big it burns: 0 small, 1 medium, 2 big.fade (integer, optional, default 0). How far it is dimmed, 0 being full strength.Example:
trx.events.after_control(function()
trx.fx.fire({ pos = trx.lara.item.pos, size = 2 })
end)
trx.fx.splash(item)
Breaks the water at an item, the way a body falling in does. The item says
where the splash is; the water it lands in says how big.
Parameters:
item (trx.items.Item). The item the splash rises around.Example:
trx.fx.splash(trx.lara.item)
trx.fx.wade_splash(item, depth)
Breaks the water around an item wading through it.
Parameters:
item (trx.items.Item). The item doing the wading.depth (trx.math.Distance). How deep the water stands about it.Example:
trx.fx.wade_splash(trx.lara.item, 512)
trx.fx.ripple(opts)
Spreads a ring on the water surface. The ring widens and fades on its own.
Parameters:
opts (table). Where the ring is and how it spreads.
Keys:
pos (trx.math.Vec3). World position.size (integer, optional, default 8). How wide it starts, from 1 to 255.slow (boolean, optional, default false). Whether it spreads at half speed.dark (boolean, optional, default false). Whether it is drawn dark rather than bright.blood (boolean, optional, default false). Whether it is drawn in the blood color.jitter (boolean, optional, default false). Whether the ring wavers as it spreads.Example:
trx.fx.ripple({ pos = trx.lara.item.pos, size = 16 })
trx.fx.small_splash(opts)
Throws a handful of drops off the water surface.
Parameters:
opts (table). Where the drops are and how many of them.
Keys:
pos (trx.math.Vec3). World position.count (integer, optional, default 1). How many drops, from 1 to 255.Example:
trx.fx.small_splash({ pos = trx.lara.item.pos, count = 8 })
trx.fx.underwater_blood(opts)
Spreads a cloud of blood under water, the way a hit that lands there does.
Parameters:
opts (table). Where the cloud is and how wide it spreads.
Keys:
pos (trx.math.Vec3). World position.size (integer, optional, default 8). How wide it spreads, from 1 to 255.dark (boolean, optional, default false). Whether it is drawn in the darker TR3 gold color.Example:
trx.fx.underwater_blood({ pos = trx.lara.item.pos, size = 32 })
trx.fx.footprint(item, left_foot)
Leaves a footprint under an item, on the floor the item stands on. The floor
material decides whether one is left at all.
Parameters:
item (trx.items.Item). The item the print is taken from.left_foot (boolean). Whether it is the left foot rather than the right.Example:
trx.fx.footprint(trx.lara.item, true)
trx.fx.knockback(opts)
Spreads a ring of force out from a point, as a blast does. The ring is drawn
and widens on its own.
Parameters:
opts (table). Where the ring starts and how far it may lean.
Keys:
pos (trx.math.Vec3). World position.tilt (trx.math.Angle, optional, default 0). Maximum tilt for each ring in either direction. 0 keeps them level.Example:
trx.fx.knockback({ pos = trx.lara.item.pos })
trx.fx.sparks.spawn(opts)
Puts one spark in the world and hands it back, so a script can draw with the
pool the game draws its own smoke and flames with.
The spark lives for the frames it is given, moving, resizing and fading on its own, and then frees its slot. Nothing has to be called each frame to keep it up.
Returns nil where the level carries no spark set, which is every TR1 and TR2
level.
Parameters:
opts (table). What the spark is and how it behaves.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.vel (trx.math.Vec3, optional). How far it moves each frame. Defaults to standing still.sprite_type (trx.fx.SparkType, optional, default trx.fx.SparkType.PARTICLE). Which sprite it is drawn with.life (integer, optional, default 16). How many frames it lives, from 1 to 255.color (trx.math.Color, optional). The color it starts in. Defaults to white.end_color (trx.math.Color, optional). The color it fades to. Defaults to the color it starts in, so it holds one color.fade_speed (integer, optional, default 8). How fast it travels between the two colors.fade_to_black (integer, optional, default 8). How many frames of life are left when it starts to darken toward black.width (integer, optional, default 4). How wide it starts, from 0 to 255.height (integer, optional, default 4). How tall it starts, from 0 to 255.end_width (integer, optional). The width it grows to, for a spark that scales. Defaults to the width it starts at.end_height (integer, optional). The height it grows to, for a spark that scales. Defaults to the height it starts at.scales (boolean, optional, default false). Whether it travels from its start size to its end size over its life.scalar (integer, optional, default 2). How strongly the size is scaled with distance.gravity (integer, optional, default 0). How much it is pulled down each frame.max_y_vel (integer, optional, default 0). As fast as gravity may carry it down.friction (integer, optional, default 0). How fast it is slowed each frame.rot_angle (integer, optional, default 0). How far it starts turned about the view, from 0 to 4095.rot_add (integer, optional, default 0). How far it turns each frame, for a spark that turns.rotates (boolean, optional, default false). Whether it turns as it lives.extras (integer, optional, default 0). How many further sparks it leaves behind as it ends.draw_type (trx.fx.DrawType, optional, default trx.fx.DrawType.BLEND_ADD). How it is laid over what is behind it.is_outside (boolean, optional, default false). Whether the wind carries it.is_underwater (boolean, optional, default false). Whether it drifts like an underwater particle.is_green (boolean, optional, default false). Whether it is drawn in the green of the poison gas.uses_alt_sprite (boolean, optional, default false). Whether it is drawn with the second sprite of its kind.Returns: trx.fx.Spark or nil. The spark, or nil where the level carries no spark set.
Example:
trx.fx.sparks.spawn({
pos = trx.lara.item.pos,
vel = { x = 0, y = -8, z = 0 },
sprite_type = trx.fx.SparkType.EXPLOSION,
life = 48,
color = trx.math.color(255, 200, 64),
end_color = trx.math.color(64, 0, 0),
width = 16,
end_width = 48,
scales = true,
})
trx.fx.sparks.explosion(opts)
Throws the fireball of sparks an explosion is drawn with.
Parameters:
opts (table). Where the fireball is and how strongly it bursts.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.extras (integer, optional, default 3). How many further sparks each one leaves behind as it ends, from 0 to 3.light (integer, optional, default -2). How the fireball lights the room around it: -2 bright, -1 dim, 0 not at all.underwater (boolean, optional, default false). Whether it uses the underwater burst.Example:
trx.fx.sparks.explosion({ pos = trx.lara.item.pos })
trx.fx.sparks.explosion_smoke(opts)
Lifts the smoke an explosion leaves behind.
Parameters:
opts (table). Where the smoke is and which part of the burst it is.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.underwater (boolean, optional, default false). Whether it lifts as it does under water.ending (boolean, optional, default false). Whether it is the thinner smoke that closes the burst rather than the smoke that opens it.Example:
trx.fx.sparks.explosion_smoke({ pos = trx.lara.item.pos })
trx.fx.sparks.explosion_bubble(opts)
Throws the burst of bubbles an explosion under water makes.
Parameters:
opts (table). Where the bubbles rise.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.Example:
trx.fx.sparks.explosion_bubble({ pos = trx.lara.item.pos })
trx.fx.sparks.fire_flame(opts)
Throws one tongue of flame, the way a burning body does. Make the call every
frame to keep a fire burning.
No flame is thrown more than twenty sectors from Lara.
Parameters:
opts (table). Where the flame is and what color it burns.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.variant (integer, optional, default 0). Which colors it burns in: 0 orange, 2 pale, 254 green.Example:
trx.fx.sparks.fire_flame({ pos = trx.lara.item.pos })
trx.fx.sparks.fire_smoke(opts)
Lifts one puff of the smoke a fire gives off.
Parameters:
opts (table). Where the smoke is and which flame color it follows.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.variant (integer, optional, default 0). Which colors it burns in: 0 orange, 2 pale, 254 green.Example:
trx.fx.sparks.fire_smoke({ pos = trx.lara.item.pos })
trx.fx.sparks.static_flame(opts)
Throws one tongue of the flame a standing fire burns with.
Parameters:
opts (table). Where the flame is and how big it burns.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.size (integer, optional, default 32). How big it burns.Example:
trx.fx.sparks.static_flame({ pos = trx.lara.item.pos, size = 64 })
trx.fx.sparks.side_flame(opts)
Throws a tongue of flame sideways, as a jet does.
Parameters:
opts (table). Where the jet is and which way it burns.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.angle (trx.math.Angle). The way the flame is thrown.speed (integer, optional, default 32). How hard it is thrown.pilot (boolean, optional, default false). Whether it is the small pilot flame rather than the jet itself.Example:
trx.fx.sparks.side_flame({
pos = trx.lara.item.pos,
angle = trx.lara.item.rot.y,
})
trx.fx.sparks.flamethrower_flame(opts)
Throws the flame a flamethrower leaves where its jet lands.
Parameters:
opts (table). Where the flame lands.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.Example:
trx.fx.sparks.flamethrower_flame({ pos = trx.lara.item.pos })
trx.fx.sparks.flamethrower_smoke(opts)
Lifts the smoke a flamethrower jet leaves behind.
Parameters:
opts (table). Where the smoke is.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.underwater (boolean, optional, default false). Whether it lifts as it does under water.Example:
trx.fx.sparks.flamethrower_smoke({ pos = trx.lara.item.pos })
trx.fx.sparks.gun_smoke(opts)
Lifts the smoke a fired weapon leaves at its muzzle.
Parameters:
opts (table). Where the smoke is and which weapon left it.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.weapon (trx.catalog.weapons). Which weapon it is drawn for. UNKNOWN, UNARMED, and out-of-range values raise.shade (integer, optional, default 64). How light the smoke is, from 0 to 255.initial (boolean, optional, default false). Whether it is the first puff of a shot, which is denser than the ones that follow.vel (trx.math.Vec3, optional). Which way the smoke is pushed. Left out, it lifts straight up.Example:
trx.fx.sparks.gun_smoke({
pos = trx.lara.item.pos,
weapon = trx.catalog.weapons.pistols,
initial = true,
})
trx.fx.sparks.dart_smoke(opts)
Lifts the trail of smoke a flying dart leaves.
Parameters:
opts (table). Where the smoke is and which way the dart flies.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.vel (trx.math.Vec3, optional). How far it moves each frame. Defaults to standing still.hit (boolean, optional, default false). Whether the dart has landed, which puffs the smoke out rather than trailing it.Example:
trx.fx.sparks.dart_smoke({ pos = trx.lara.item.pos, hit = true })
trx.fx.sparks.rocket_smoke(opts)
Lifts the trail of smoke a flying rocket leaves.
Parameters:
opts (table). Where the smoke is and how light it lifts.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.shade (integer, optional, default 0). How light the smoke turns as it fades, from 0 to 191.Example:
trx.fx.sparks.rocket_smoke({ pos = trx.lara.item.pos })
trx.fx.sparks.flare(opts)
Throws the sparks a burning flare gives off.
Parameters:
opts (table). Where the sparks are and which way they fly.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.vel (trx.math.Vec3, optional). How far it moves each frame. Defaults to standing still.smoke (boolean, optional, default false). Whether smoke is lifted with them.Example:
trx.fx.sparks.flare({ pos = trx.lara.item.pos, smoke = true })
trx.fx.sparks.shotgun(opts)
Throws the sparks a shotgun blast strikes off what it hits.
Parameters:
opts (table). Where the sparks are and which way they fly.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.vel (trx.math.Vec3, optional). How far it moves each frame. Defaults to standing still.Example:
trx.fx.sparks.shotgun({ pos = trx.lara.item.pos })
trx.fx.sparks.ricochet(opts)
Strikes the sparks a shot makes where it lands on a wall.
TR4 throws as many streaks as asked for and can lift smoke instead. TR3 throws one burst, and uses the count as its size.
Parameters:
opts (table). Where the shot lands and which way the sparks fly.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.angle (trx.math.Angle). The way the sparks fly.count (integer, optional, default 3). How many streaks, from 1 to 255.smoke_only (boolean, optional, default false). Whether smoke is lifted rather than sparks struck. TR4 only.Example:
trx.fx.sparks.ricochet({ pos = trx.lara.item.pos, angle = 0 })
trx.fx.sparks.bubble(opts)
Lifts one bubble through the water.
Parameters:
opts (table). Where the bubble is and how big it is.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.size (integer, optional, default 8). How big it is at its smallest.size_range (integer, optional, default 8). How much bigger than that it may be drawn.Example:
trx.fx.sparks.bubble({ pos = trx.lara.item.pos })
trx.fx.sparks.breath(opts)
Puffs the cloud of breath a body gives off in the cold.
Parameters:
opts (table). Where the breath is and which way it drifts.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.vel (trx.math.Vec3, optional). How far it moves each frame. Defaults to standing still.Example:
trx.fx.sparks.breath({ pos = trx.lara.item.pos })
trx.fx.sparks.pickup_aid(opts)
Throws the twinkle that marks a pickup worth reaching.
Parameters:
opts (table). Where the twinkle is and which way it drifts.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.vel (trx.math.Vec3, optional). How far it moves each frame. Defaults to standing still.Example:
trx.fx.sparks.pickup_aid({ pos = trx.lara.item.pos })
trx.fx.sparks.waterfall_mist(opts)
Lifts the mist that stands at the foot of a waterfall.
Parameters:
opts (table). Where the mist is and which way it faces.
Keys:
pos (trx.math.Vec3). World position. Must lie inside the level.angle (trx.math.Angle). The way the waterfall faces.Example:
trx.fx.sparks.waterfall_mist({ pos = trx.lara.item.pos, angle = 0 })