/tg/ Station 13 - Modules - TypesVar Details - Proc Details

beam

Vars

anim_durationDuration of the last animation, in deciseconds (matches the time= passed to animate()).
anim_from_origin_xLast animation's "from" (where segments were seeded at draw time) — origin endpoint.
anim_from_target_xLast animation's "from" — target endpoint.
anim_start_timeworld.time at which the last animation began. Combined with anim_duration to estimate segments' current visual position mid-animation.
animateIf FALSE, redraws snap per update instead of using animate() interpolation.
beam_colorThe color of the beam we're drawing.
beam_layerthe layer of our beam
beam_typethe objects placed in the elements list
elementslist of beam objects. These have their visuals set by the visuals var which is created on starting
emissiveIf we use an emissive appearance
iconicon used by the beam.
icon_stateicon state of the main segments of the beam
last_draw_validWhether we have a cached last-drawn geometry from a previous Draw().
last_origin_xLast drawn origin tile/pixel coordinates (used as the "from" frame for animated redraws).
last_target_xLast drawn target tile/pixel coordinates.
max_distanceThe beam will qdel if it's longer than this many tiles.
originwhere the beam goes from
override_origin_pixel_xIf set will be used instead of origin's pixel_x in offset calculations
override_origin_pixel_yIf set will be used instead of origin's pixel_y in offset calculations
override_target_pixel_xIf set will be used instead of targets's pixel_x in offset calculations
override_target_pixel_yIf set will be used instead of targets's pixel_y in offset calculations
pending_animate_timeAnimate time queued for the pending redraw. We take the largest (slowest glide) of any movers that triggered the redraw.
targetwhere the beam goes to
visualsThis is used as the visual_contents of beams, so you can apply one effect to this and the whole beam will look like that. never gets deleted on redrawing.

Procs

DrawCreates the beam effects and places them in a line from the origin to the target. Sets their rotation to make the beams face the target, too.
StartProc called by the atom Beam() proc. Sets up signals, and draws the beam for the first time.
get_last_geometryReturns the last drawn endpoints for reuse by inherit_glide(), or null if undrawn.
inherit_glideSeeds the next Draw() from saved geometry so rebuilt beams glide instead of snapping.
redrawingTriggered by signals set up when the beam is set up. If it's still sane to create a beam, it removes the old beam, creates a new one. Otherwise it kills the beam.
set_subsegment_appearancesets the sprite of the segment, using the more performant viscontents by default

Var Details

anim_duration

Duration of the last animation, in deciseconds (matches the time= passed to animate()).

anim_from_origin_x

Last animation's "from" (where segments were seeded at draw time) — origin endpoint.

anim_from_target_x

Last animation's "from" — target endpoint.

anim_start_time

world.time at which the last animation began. Combined with anim_duration to estimate segments' current visual position mid-animation.

animate

If FALSE, redraws snap per update instead of using animate() interpolation.

beam_color

The color of the beam we're drawing.

beam_layer

the layer of our beam

beam_type

the objects placed in the elements list

elements

list of beam objects. These have their visuals set by the visuals var which is created on starting

emissive

If we use an emissive appearance

icon

icon used by the beam.

icon_state

icon state of the main segments of the beam

last_draw_valid

Whether we have a cached last-drawn geometry from a previous Draw().

last_origin_x

Last drawn origin tile/pixel coordinates (used as the "from" frame for animated redraws).

last_target_x

Last drawn target tile/pixel coordinates.

max_distance

The beam will qdel if it's longer than this many tiles.

origin

where the beam goes from

override_origin_pixel_x

If set will be used instead of origin's pixel_x in offset calculations

override_origin_pixel_y

If set will be used instead of origin's pixel_y in offset calculations

override_target_pixel_x

If set will be used instead of targets's pixel_x in offset calculations

override_target_pixel_y

If set will be used instead of targets's pixel_y in offset calculations

pending_animate_time

Animate time queued for the pending redraw. We take the largest (slowest glide) of any movers that triggered the redraw.

target

where the beam goes to

visuals

This is used as the visual_contents of beams, so you can apply one effect to this and the whole beam will look like that. never gets deleted on redrawing.

Proc Details

Draw

Creates the beam effects and places them in a line from the origin to the target. Sets their rotation to make the beams face the target, too.

Start

Proc called by the atom Beam() proc. Sets up signals, and draws the beam for the first time.

get_last_geometry

Returns the last drawn endpoints for reuse by inherit_glide(), or null if undrawn.

inherit_glide

Seeds the next Draw() from saved geometry so rebuilt beams glide instead of snapping.

redrawing

Triggered by signals set up when the beam is set up. If it's still sane to create a beam, it removes the old beam, creates a new one. Otherwise it kills the beam.

Arguments: mover: either the origin of the beam or the target of the beam that moved. oldloc: from where mover moved. direction: in what direction mover moved from.

set_subsegment_appearance

sets the sprite of the segment, using the more performant viscontents by default