Effects
constEffects:object
Defined in: client/api.d.ts:835
Effects only the local player sees and feels: screen and controller effects, and explosions, shaders, visual effects and impacts in this game alone. Fades are on Hud.fade; the server’s Explosion and Effect play for everyone.
Type Declaration
Section titled “Type Declaration”applyImageSpace()
Section titled “applyImageSpace()”applyImageSpace(
modifier,strength?):boolean
Applies an image space modifier, as ImageSpaceModifier.Apply does; it runs its own length, and is removed once this resource stops. False when there is no such modifier or no world to run it in.
Parameters
Section titled “Parameters”modifier
Section titled “modifier”string | number
An image space modifier (IMAD): its editor ID, or its form ID (a number, or a string starting 0x).
strength?
Section titled “strength?”number
0 to 1, 1 by default.
Returns
Section titled “Returns”boolean
explode()
Section titled “explode()”explode(
explosion,position,options?):boolean
Sets off an explosion in this game alone. Its blast hurts what this game simulates.
Parameters
Section titled “Parameters”explosion
Section titled “explosion”string | number
A BGSExplosion (EXPL) form ID.
position
Section titled “position”Where it goes off, in the player’s space.
options?
Section titled “options?”scale of its radii, damage a multiplier of its damage (0 for a harmless one); 1 by default.
damage?
Section titled “damage?”number
scale?
Section titled “scale?”number
Returns
Section titled “Returns”boolean
False when there is no such explosion, or the spot is not loaded here.
playImpact()
Section titled “playImpact()”playImpact(
ref,impactSet,options?):boolean
Plays an impact where a ray from the reference lands, in this game alone, as ObjectReference.PlayImpactEffect does.
Parameters
Section titled “Parameters”string | number
A reference or actor of this game by form ID: 0x14 for the player, References.getEntityBody for another player or an NPC.
impactSet
Section titled “impactSet”string | number
A BGSImpactDataSet (IPDS) form ID.
options?
Section titled “options?”The ray: from the named node (the 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”boolean
False when the reference is not loaded here or the ray hit nothing.
playShader()
Section titled “playShader()”playShader(
ref,shader,seconds?):boolean
Plays an effect shader on a reference in this game alone, as EffectShader.Play does.
Parameters
Section titled “Parameters”string | number
A reference or actor of this game by form ID: 0x14 for the player, References.getEntityBody for another player or an NPC.
shader
Section titled “shader”string | number
A TESEffectShader (EFSH) form ID.
seconds?
Section titled “seconds?”number
How long; until stopShader when left out.
Returns
Section titled “Returns”boolean
False when the reference is not loaded here or the form is no shader.
playVisual()
Section titled “playVisual()”playVisual(
ref,effect,seconds?):boolean
Attaches a visual effect to a reference in this game alone, as VisualEffect.Play does.
Parameters
Section titled “Parameters”string | number
A reference or actor of this game by form ID: 0x14 for the player, References.getEntityBody for another player or an NPC.
effect
Section titled “effect”string | number
A BGSReferenceEffect (RFCT) form ID.
seconds?
Section titled “seconds?”number
How long; until stopVisual when left out.
Returns
Section titled “Returns”boolean
False when the reference is not loaded here or the form is no visual effect.
removeImageSpace()
Section titled “removeImageSpace()”removeImageSpace(
modifier):boolean
Stops as many instances of a modifier as this resource applied and are still running. The game stops the oldest instances of the record, which may be ones it started itself. False when none of this resource’s are running.
Parameters
Section titled “Parameters”modifier
Section titled “modifier”string | number
The modifier’s editor ID, or its form ID (a number, or a string starting 0x).
Returns
Section titled “Returns”boolean
shakeCamera()
Section titled “shakeCamera()”shakeCamera(
strength,seconds):boolean
Shakes the camera, as Game.ShakeCamera does from the player. False while there is no player in the world.
Parameters
Section titled “Parameters”strength
Section titled “strength”number
0 to 1.
seconds
Section titled “seconds”number
How long; 0 for the game’s default.
Returns
Section titled “Returns”boolean
shakeController()
Section titled “shakeController()”shakeController(
left,right,seconds):void
Rumbles the gamepad, as Game.ShakeController does.
Parameters
Section titled “Parameters”number
Left motor, 0 to 1.
number
Right motor, 0 to 1.
seconds
Section titled “seconds”number
How long.
Returns
Section titled “Returns”void
stopShader()
Section titled “stopShader()”stopShader(
ref,shader):void
Stops an effect shader on a reference.
Parameters
Section titled “Parameters”string | number
A reference or actor of this game by form ID: 0x14 for the player, References.getEntityBody for another player or an NPC.
shader
Section titled “shader”string | number
The shader played.
Returns
Section titled “Returns”void
stopVisual()
Section titled “stopVisual()”stopVisual(
ref,effect):void
Takes a visual effect off a reference.
Parameters
Section titled “Parameters”string | number
A reference or actor of this game by form ID: 0x14 for the player, References.getEntityBody for another player or an NPC.
effect
Section titled “effect”string | number
The visual effect played.
Returns
Section titled “Returns”void