Namespace in reactor_3d_effects.js

Reactor3D

46 public functions in 6 groups · show internal (_) functions

Effekseer effects bursting on the map.

Quick Reference

Setup & Creation 1

registerPluginCommands() Register plugin commands.

Getting Information 1

currentFrame() The current frame.

Checks (True / False) 1

hasLiveEffectLights() Whether any placed model has a light effect burning right now.

Actions 9

playModelEffect() Queue a named effect on a character's model, played on its next frame.
takeModelEffects() Take model effects.
setEffectLight() Switch a light effect on (for until frames, or open-ended) or off.
setModelEffectLight() Script access: a named light effect on a character's model, on or off.
spawnVideoEffect() Spawn video effect.
stopVideoEffect() Stops the video effect.
spawnAnchoredAnimation() Play a database animation at an effect's anchor on a placed model.
placeStandIn() Put a stand-in on its anchor's screen position, at the scale the world is drawn there.
stopAnchoredAnimation() End an anchored animation now: its sprite and stand-in leave the scene.

Updating & Drawing 2

updateTriggeredEffects() Effects that play on their own: while the character is in the state their trigger names, they loop at their a…
updateAnchoredAnimations() Keep every anchored animation on its anchor; drop the ones that finished and start their loops over.

Other 32

readModelEffects() Read model effects.
readEffectLight() The light a light-type effect carries: the map-light fields, bounded the way readMapLights bounds them, plus…
effectLight() A light-type effect resolved into the compositor's shape, at its anchor: the anchor's world position becomes…
videoEffectFraction() Video effect fraction.
videoEffectSize() A video effect's plane in the model's own units, from its fractions.
modelEffectByName() Model effect by name.
effectAnchorNode() The node a part name means on a carved model.
effectAnchorQuaternion() How far an effect's anchor part is currently turned from its rest: identity for an unanchored effect or a sti…
effectAnchorTransform() Resolve one fresh attachment frame for position, scale and rotation together.
effectAnchorWorld() Where an effect plays, in world space: the anchor part's (or bone's) frame plus the offset, or the model's fr…
readModelLandmarks() Optional semantic points, authored in the same bone/part frame as effects.
landmarkNode() Resolve named nodes once when the instance is built, never scan meshes per frame.
bindModelLandmarks() Bind model landmarks.
modelLandmarkWorld() Model landmark world.
modelAnimationsBusy() Whether any model animation is still playing or queued: for one character, or — with no character — anywhere…
holdWaitCharacter() Give a wait its character.
waitCharacter() The character a wait watches: the one it was given, or after a load the one its id names.
scopedWaitHolding() Whether a scoped wait still holds, whatever it watches.
scopedActionsBusy() What a scoped wait watches: the animation queue, and for one character a forced route too.
modelAnimationWaiting() Whether a Play Model Animation wait is still holding.
fireNamedEffect() Fire one named effect: sound and flash at once, the animation at its anchor.
fireEffectLight() Firing a light effect: with a duration it burns that long and a refire restarts the clock; without one it is…
expireEffectLights() Drop the timed lights whose frame has come.
modelInstances() The scene's model instances, when a 3D map is up.
modelEffectLights() This frame's lights from every placed model's live light effects, in the compositor's shape, at their anchors…
modelHolderFor() The 3D scene's instance for a character, when the map draws one.
videoEffectId() Video effect id.
adoptVideoEffect() A model made again with its scene (after the menu or a battle) has a new holder, which knows of no video, whi…
modelSpanTiles() The longest side of a model instance, in tiles.
effectModelScale() An effect's scale is relative to its model: at 1, the animation's frame (the screen it was authored on, scree…
effectFacesCamera() Whether an anchored effect's face is toward the camera.
flatModelAnchor() Project a model anchor into its flat sprite's bitmap, without a readback.

Setup & Creation

registerPluginCommands

static source
Reactor3D.registerPluginCommands()

Register plugin commands.

Getting Information

currentFrame

static source
Reactor3D.currentFrame()

The current frame.

Checks (True / False)

hasLiveEffectLights

static source
Reactor3D.hasLiveEffectLights()

Whether any placed model has a light effect burning right now.

Details

Whether any placed model has a light effect burning right now. Allocation-free.

Actions

playModelEffect

static source
Reactor3D.playModelEffect(character, name)

Queue a named effect on a character's model, played on its next frame.

takeModelEffects

static source
Reactor3D.takeModelEffects(character)

Take model effects.

setEffectLight

static source
Reactor3D.setEffectLight(holder, effect, on, until)

Switch a light effect on (for until frames, or open-ended) or off.

setModelEffectLight

static source
Reactor3D.setModelEffectLight(character, name, on)

Script access: a named light effect on a character's model, on or off.

spawnVideoEffect

static source
Reactor3D.spawnVideoEffect(effect, character, holder)

Spawn video effect.

stopVideoEffect

static source
Reactor3D.stopVideoEffect(effect, character, holder)

Stops the video effect.

spawnAnchoredAnimation

static source
Reactor3D.spawnAnchoredAnimation(effect, character, holder)

Play a database animation at an effect's anchor on a placed model.

Details

Play a database animation at an effect's anchor on a placed model.

The stock pipeline positions an animation on its target sprite, so the target here is a stand-in sprite that updateAnchoredAnimations moves to the anchor's screen position every frame. Without a scene to project through (a flat map) the animation plays on the character as before.

placeStandIn

static source
Reactor3D.placeStandIn(holder, effect, standIn)

Put a stand-in on its anchor's screen position, at the scale the world is drawn there.

Details

Put a stand-in on its anchor's screen position, at the scale the world is drawn there. The animation sprite asks its target for reactor3DScale, the way it asks a character, so the effect shrinks into the distance and grows up close with the model rather than playing at flat pixel size — which is what drew a reactor's core as a beam the size of the screen.

stopAnchoredAnimation

static source
Reactor3D.stopAnchoredAnimation(entry)

End an anchored animation now: its sprite and stand-in leave the scene.

Updating & Drawing

updateTriggeredEffects

static source
Reactor3D.updateTriggeredEffects(holder, character, state)

Effects that play on their own: while the character is in the state their trigger names, they loop at their anchor; when it leaves the state they stop.

Details

Effects that play on their own: while the character is in the state their trigger names, they loop at their anchor; when it leaves the state they stop. The same conditions the animation rules use.

updateAnchoredAnimations

static source
Reactor3D.updateAnchoredAnimations(holder)

Keep every anchored animation on its anchor; drop the ones that finished and start their loops over.

Details

Keep every anchored animation on its anchor; drop the ones that finished and start their loops over. The spriteset is the judge of "finished": it removes an animation sprite from the scene when it stops playing, so a sprite still attached is still running (or waiting for its effect file). Loops restart after the pass, never inside it — a restart inside the walk re-entered this function and recursed until the stack gave out.

Other

readModelEffects

static source
Reactor3D.readModelEffects(json, spec)

Read model effects.

readEffectLight

static source
Reactor3D.readEffectLight(raw)

The light a light-type effect carries: the map-light fields, bounded the way readMapLights bounds them, plus duration — how many frames a fired light stays on (0: until it is fired again, which switches it off).

Details

The light a light-type effect carries: the map-light fields, bounded the way readMapLights bounds them, plus duration — how many frames a fired light stays on (0: until it is fired again, which switches it off). Yaw and pitch are in the anchor's frame: yaw 0 aims along the anchor node's own +Z, so a light on a turret turns with the turret.

effectLight

static source
Reactor3D.effectLight(object, effect, key)

A light-type effect resolved into the compositor's shape, at its anchor: the anchor's world position becomes the light's tile position and an absolute height (groundY: 0), and the authored aim is turned by the anchor node's world pose, so a light on a part aims where the part does and a light on the model aims where the model faces.

Details

A light-type effect resolved into the compositor's shape, at its anchor: the anchor's world position becomes the light's tile position and an absolute height (groundY: 0), and the authored aim is turned by the anchor node's world pose, so a light on a part aims where the part does and a light on the model aims where the model faces. Yaw comes out in the scene's frame, ready for the packer.

videoEffectFraction

static source
Reactor3D.videoEffectFraction(value, fallback)

Video effect fraction.

videoEffectSize

static source
Reactor3D.videoEffectSize(effect, extent)

A video effect's plane in the model's own units, from its fractions.

modelEffectByName

static source
Reactor3D.modelEffectByName(effects, name)

Model effect by name.

effectAnchorNode

static source
Reactor3D.effectAnchorNode(object, name)

The node a part name means on a carved model.

Details

The node a part name means on a carved model. A piece cut where several authored parts overlap is NAMED after only one of them (the most specific), but it carries every owner in userData.parts — so a lookup by node name alone misses a perfectly good binding.

effectAnchorQuaternion

static source
Reactor3D.effectAnchorQuaternion(object, effect, out)

How far an effect's anchor part is currently turned from its rest: identity for an unanchored effect or a still part, the pose's own turn while an animation holds it — so a screen's video turns WITH the screen as the arm carrying it swings, instead of only sliding after its point.

effectAnchorTransform

static source
Reactor3D.effectAnchorTransform(object, effect, out, wantPose = true)

Resolve one fresh attachment frame for position, scale and rotation together.

effectAnchorWorld

static source
Reactor3D.effectAnchorWorld(object, effect, out)

Where an effect plays, in world space: the anchor part's (or bone's) frame plus the offset, or the model's frame when no part is named.

Details

Where an effect plays, in world space: the anchor part's (or bone's) frame plus the offset, or the model's frame when no part is named. The offset is in model units, so it scales and turns with the model.

readModelLandmarks

static source
Reactor3D.readModelLandmarks(json)

Optional semantic points, authored in the same bone/part frame as effects.

landmarkNode

static source
Reactor3D.landmarkNode(object, name)

Resolve named nodes once when the instance is built, never scan meshes per frame.

bindModelLandmarks

static source
Reactor3D.bindModelLandmarks(object, points)

Bind model landmarks.

modelLandmarkWorld

static source
Reactor3D.modelLandmarkWorld(object, name, out)

Model landmark world.

modelAnimationsBusy

static source
Reactor3D.modelAnimationsBusy(character)

Whether any model animation is still playing or queued: for one character, or — with no character — anywhere on the map.

Details

Whether any model animation is still playing or queued: for one character, or — with no character — anywhere on the map. The scoped Wait for 3D command holds on this.

holdWaitCharacter

static source
Reactor3D.holdWaitCharacter(wait, character)

Give a wait its character.

Details

Give a wait its character. The interpreter holding the wait is saved, so the character rides along unsaved (an event's own parallel interpreter holding that event made the save circular, "Object too deep") and is found again by id after a load.

waitCharacter

static source
Reactor3D.waitCharacter(wait)

The character a wait watches: the one it was given, or after a load the one its id names.

scopedWaitHolding

static source
Reactor3D.scopedWaitHolding(wait)

Whether a scoped wait still holds, whatever it watches.

scopedActionsBusy

static source
Reactor3D.scopedActionsBusy(character)

What a scoped wait watches: the animation queue, and for one character a forced route too.

modelAnimationWaiting

static source
Reactor3D.modelAnimationWaiting(wait)

Whether a Play Model Animation wait is still holding.

fireNamedEffect

static source
Reactor3D.fireNamedEffect(effect, character, holder)

Fire one named effect: sound and flash at once, the animation at its anchor.

fireEffectLight

static source
Reactor3D.fireEffectLight(effect, holder)

Firing a light effect: with a duration it burns that long and a refire restarts the clock; without one it is a switch, and firing again turns it off.

expireEffectLights

static source
Reactor3D.expireEffectLights(holder, frame)

Drop the timed lights whose frame has come.

modelInstances

static source
Reactor3D.modelInstances()

The scene's model instances, when a 3D map is up.

modelEffectLights

static source
Reactor3D.modelEffectLights()

This frame's lights from every placed model's live light effects, in the compositor's shape, at their anchors, breathing like the map's own.

modelHolderFor

static source
Reactor3D.modelHolderFor(character)

The 3D scene's instance for a character, when the map draws one.

videoEffectId

static source
Reactor3D.videoEffectId(character, effect)

Video effect id.

adoptVideoEffect

static source
Reactor3D.adoptVideoEffect(effect, character, holder)

A model made again with its scene (after the menu or a battle) has a new holder, which knows of no video, while the surface itself came back with the map's store: asked once for each effect, it is this holder's again.

Details

A model made again with its scene (after the menu or a battle) has a new holder, which knows of no video, while the surface itself came back with the map's store: asked once for each effect, it is this holder's again. Not found so, one whose character had stopped moving by then was never stopped, and played until the character moved and stopped again.

modelSpanTiles

static source
Reactor3D.modelSpanTiles(object)

The longest side of a model instance, in tiles.

effectModelScale

static source
Reactor3D.effectModelScale(object)

An effect's scale is relative to its model: at 1, the animation's frame (the screen it was authored on, screenHeight tall) is as big as the model's longest side.

Details

An effect's scale is relative to its model: at 1, the animation's frame (the screen it was authored on, screenHeight tall) is as big as the model's longest side. The factor that turns "one screen" into that many tiles, at this instance's size, against the animation's own screen-sized drawing rule.

effectFacesCamera

static source
Reactor3D.effectFacesCamera(holder, effect, entry)

Whether an anchored effect's face is toward the camera.

Details

Whether an anchored effect's face is toward the camera.

A 2D animation is drawn over the whole scene, so one placed on the front of a console showed through the console from behind. The model's box says which face an anchor sits on (an anchor deep inside belongs to none and always shows; the underside is never a face, ground rings live there); the effect shows while that face is toward the eye, with a little hysteresis so a grazing view does not flicker. Cheap: one matrix inverse per effect per frame, no geometry.

flatModelAnchor

static source
Reactor3D.flatModelAnchor(holder, effect, out)

Project a model anchor into its flat sprite's bitmap, without a readback.