The "vngen_attach_replace_ext" Function

Syntax

vngen_attach_replace_ext(name, id, sprite, xorig, yorig, scaling, duration, ease);
ArgumentTypeDescription
namestringThe ID of the attachment parent character
idreal/stringThe ID of the attachment to replace
spritespriteThe new sprite to display as a attachment
xorigreal/macroThe new horizontal sprite offset, or origin point, relative to the top-left corner
yorigreal/macroThe new vertical sprite offset, or origin point, relative to the top-left corner
scalinginteger/macroSets the new automatic scaling mode for the attachment, relative to the parent character
durationrealSets the duration of the fade transition, in seconds
easeinteger/macroSets the ease mode to perform the fade transition in

Description

Replaces the input entity ID with a new sprite and extra sprite properties and fades the old sprite to the new one over the input duration.

As with other types of modifications, replacements made with this script are permanent and will persist until another replacement is performed. This script cannot be performed simultaneously with other replacement actions operating on the same entity ID.

See Macros & Keywords for a list of available origin points, scaling modes, and ease modes.

Example

vngen_event() {
vngen_attach_replace_ext("John Doe", "attach", spr_new, orig_center, orig_center, scale_none, 1, ease_sin_in_out);
}