Effect
constEffect:object
Defined in: server/api.d.ts:1668
Effects in every player’s game: placed effects that stream like any entity, effect shaders and visual effects on bodies and references, and impacts. Forms are named by form ID (a number or hex string) or by their editor ID in the official masters; an editor ID made only of hex digits reads as a form ID.
Type Declaration
Section titled “Type Declaration”exists()
Section titled “exists()”exists(
effect):boolean
Whether a placed effect is still there: its lifetime may have run out.
Parameters
Section titled “Parameters”effect
Section titled “effect”number
An ID spawn gave.
Returns
Section titled “Returns”boolean
move()
Section titled “move()”move(
effect,position,angle?):boolean
Moves a placed effect in every game, players who come near later included: a lift, a gate, a prop a script carries. Each call is one step; call it each tick for a glide.
Parameters
Section titled “Parameters”effect
Section titled “effect”number
An ID spawn gave.
position
Section titled “position”Where it stands now.
angle?
Section titled “angle?”Its rotation in radians; kept when left out.
Returns
Section titled “Returns”boolean
False when there is no such effect, or it is attached.
playImpact()
Section titled “playImpact()”playImpact(
target,impactSet,options?):void
Plays an impact where a ray from the target lands, in every game where the target is loaded, as ObjectReference.PlayImpactEffect does: the decal, particles and sound of the surface’s material.
Parameters
Section titled “Parameters”target
Section titled “target”string | number | Player | Npc
A player, an NPC, or a placed reference’s form ID.
impactSet
Section titled “impactSet”string | number
A BGSImpactDataSet (IPDS) form ID: what each material shows when hit.
options?
Section titled “options?”The ray: from the named node of the target (its root when left out), along the direction (straight down by default), for the length in game units (512).
direction?
Section titled “direction?”length?
Section titled “length?”number
string
Returns
Section titled “Returns”void
playShader()
Section titled “playShader()”playShader(
target,shader,seconds?):void
Plays an effect shader over a body or a reference in every game where it is loaded, as EffectShader.Play does.
Parameters
Section titled “Parameters”target
Section titled “target”string | number | Player | Npc
A player, an NPC, or a placed reference’s form ID.
shader
Section titled “shader”string | number
A TESEffectShader (EFSH) form ID: a glow, a burn, a membrane.
seconds?
Section titled “seconds?”number
How long; until stopShader when left out.
Returns
Section titled “Returns”void
playVisual()
Section titled “playVisual()”playVisual(
target,effect,seconds?):void
Attaches a visual effect to a body or a reference in every game where it is loaded, as VisualEffect.Play does.
Parameters
Section titled “Parameters”target
Section titled “target”string | number | Player | Npc
A player, an NPC, or a placed reference’s form ID.
effect
Section titled “effect”string | number
A BGSReferenceEffect (RFCT) form ID: an art object’s particles or model, with or without a shader.
seconds?
Section titled “seconds?”number
How long; until stopVisual when left out.
Returns
Section titled “Returns”void
remove()
Section titled “remove()”remove(
effect):boolean
Removes a placed effect from every game.
Parameters
Section titled “Parameters”effect
Section titled “effect”number
An ID spawn gave.
Returns
Section titled “Returns”boolean
False when there is no such effect.
spawn()
Section titled “spawn()”spawn(
form,position,options?):number
Places an effect every player near it sees, players who come near later included: each game places its own copy while they are in range. Attached, it is a prop: a box carried, a lantern on the back, a flame over a head.
Parameters
Section titled “Parameters”string | number
The base object to place: a fog patch, a smoke column or a fire (the game’s FX statics, movable statics and activators), a hazard (HAZD), a light (LIGH), any other placeable object.
position
Section titled “position”Vector3 | null
Where it stands; null for an attached one, which starts where its body stands.
options?
Section titled “options?”angle: its rotation in radians. space: the worldspace or interior cell; the body’s when attached, else the Commonwealth. lifetime: seconds until it is removed on its own; it stays until remove when left out. range: how near players must be to have it, 8192 units by default. attach: holds it on a body or a placed reference every frame, on the named node (“WEAPON”, “RArm_Hand”, “Head”; the root when left out), shifted by offset and turned by rotation (radians) in the node’s frame; everyone in the space has it. Give it something without collision, or it pushes what it touches.
angle?
Section titled “angle?”attach?
Section titled “attach?”{ node?: string; offset?: Vector3; rotation?: Vector3; to: Player | Npc | number | string; }
attach.node?
Section titled “attach.node?”string
attach.offset?
Section titled “attach.offset?”attach.rotation?
Section titled “attach.rotation?”attach.to
Section titled “attach.to”Player | Npc | number | string
lifetime?
Section titled “lifetime?”number
range?
Section titled “range?”number
space?
Section titled “space?”{ interiorCell?: number | string; worldSpace?: number | string; }
space.interiorCell?
Section titled “space.interiorCell?”number | string
space.worldSpace?
Section titled “space.worldSpace?”number | string
Returns
Section titled “Returns”number
The effect’s ID, for remove; 0 when it could not be made.
stopShader()
Section titled “stopShader()”stopShader(
target,shader):void
Stops an effect shader on a body or a reference.
Parameters
Section titled “Parameters”target
Section titled “target”string | number | Player | Npc
A player, an NPC, or a placed reference’s form ID.
shader
Section titled “shader”string | number
The shader played.
Returns
Section titled “Returns”void
stopVisual()
Section titled “stopVisual()”stopVisual(
target,effect):void
Takes a visual effect off a body or a reference.
Parameters
Section titled “Parameters”target
Section titled “target”string | number | Player | Npc
A player, an NPC, or a placed reference’s form ID.
effect
Section titled “effect”string | number
The visual effect played.
Returns
Section titled “Returns”void