@cccode/fxr - v22.0.0

    Class RootNode

    The root of the FXR tree structure.

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    nodes: Node[] = []
    termination: TerminationAction = ...
    type: NodeType
    unk10100: Unknown10100Action = ...
    unk10400: Unknown10400Action = ...
    unk10500: Unknown10500Action = ...

    Accessors

    Methods

    • Yields all unique color values in the branch, or optionally only ones in the node.

      Parameters

      • Optionalrecurse: boolean = true

        Controls whether or not to yield colors in descendant nodes. Defaults to true.

      Returns Generator<Vector4, void, unknown>

    • Gets a color property for the node based on the given options. The returned color should equal the color of the visual effect of the node in-game, if it has a visual effect, except property modifiers and other forms of randomization are not applied. Nodes without a visual effect will return null instead.

      This may be useful for generating accurate color previews for nodes.

      Parameters

      Returns Vector4Property

    • Lists all resources (textures, models, animations, sounds) used in the node. Useful for finding out what resources must exist for the effect to work correctly, which is often needed when converting from one game to another.

      Parameters

      • recurse: boolean = true

        Controls whether resources from descendant nodes should be listed or not. Defaults to true.

      Returns {
          anibnds: number[];
          models: number[];
          sounds: number[];
          textures: { resource: number; type: string }[];
      }

    • Returns true if the node has a color in the given active state, and otherwise returns false. This can be used as a fast way to check if getColor will return a color or not.

      Parameters

      • OptionalactiveState: number

        The index of a State to check.

      Returns boolean

    • Recolors the entire branch, or optionally just this node, by modifying color properties and fields using a given function.

      Parameters

      • func: RecolorFunction

        A function used to remap color values. For some easy pre-made recolor functions, see the Recolor namespace.

      • Optionalrecurse: boolean

        Controls whether or not the recoloring should be applied to all descendant nodes. Defaults to true.

      Returns this

    • Recolors the entire branch, or optionally just this node, to fit a given color palette.

      Parameters

      • palette: ColorPalette

        The color palette to apply. This can be generated from existing FXR branches using the generateColorPalette method.

      • Optionalrecurse: boolean

        Controls whether or not the recoloring should be applied to all descendant nodes. Defaults to true.

      Returns this

    • Remaps all resource IDs in the entire branch.

      Parameters

      • func: (type: ResourceType, resource: number, textureType?: string) => number

        The function that is used to map the old resource IDs to the new ones.

      • recurse: boolean = true

        Controls whether or not the remapping should be applied to all descendant nodes. Defaults to true.

      Returns void

    • Scales the entire branch by a factor. This updates all sizes, offsets, lengths, and radii of the actions in the branch, except certain multiplicative fields and properties.

      Parameters

      • factor: number

        The factor to scale the branch with.

      • options: { mode?: ScalingMode; recurse?: boolean } = {}
        • Optionalmode?: ScalingMode
        • Optionalrecurse?: boolean

          Controls whether or not the scaling should be applied to all descendant nodes. Defaults to true.

      Returns RootNode

    • Scale the rate of time for the branch, or optionally just the node.

      This method's main purpose is to serve as a fallback for changing the rate of time for Dark Souls 3 effects, which doesn't support the rateOfTime property. The rate of time is automatically scaled when writing effects for DS3, you do not need to do this yourself. As such, this method is only useful if you want to scale the rate of time for individual parts of an effect, or if you need the extra options available for this method.

      Parameters

      • factor: number

        The factor to scale the rate of time by. Setting this to 2 will make the node play twice as fast. Setting it to 0.5 will make it play half as fast.

      • Optionaloptions: { recurse?: boolean; scaleTracerDuration?: boolean } = {}

        Extra options for changing how the scaling is applied to different properties and descendant nodes.

      Returns RootNode

    • Yields all nodes in this branch, including this node.

      Returns Generator<Node>

    • Yields all actions in this branch, excluding node actions from nodes with configs, as those are not stored as actions internally.

      Parameters

      • recurse: boolean = true

        Controls whether or not to yield actions in descendant nodes. Defaults to true.

      Returns Generator<DataAction | Action, void, any>

    • Yields all configs in this branch.

      Parameters

      • recurse: boolean = true

        Controls whether or not to yield configs in descendant nodes. Defaults to true.

      Returns Generator<IConfig, void, unknown>

    • Yields all properties in this branch, excluding properties inside modifiers and properties in the form of PropertyValues in DataActions.

      Parameters

      • recurse: boolean = true

        Controls whether or not to yield properties in descendant nodes. Defaults to true.

      Returns Generator<AnyProperty, void, undefined>

    MMNEPVFCICPMFPCPTTAAATR