Skip to main content

The "vngen_char_replace_ext" Function

Syntax#

vngen_char_replace_ext(name, newname, spr_body, spr_face_idle, spr_face_talk, xorig, yorig, face_x, face_y, scaling, flip, idle_pause, duration, ease);
ArgumentTypeDescription
namestringThe ID of the character to replace
newnamestring/macroThe new ID for the character being replaced (or keyword previous for no change)
spr_bodyspriteThe new sprite to display as a character body
spr_face_idlespriteThe new sprite to display as an idle face (or keyword none for none)
spr_face_talkspriteThe new sprite to display as a talking face (or keyword none for none)
xorigreal/macroThe new horizontal body sprite offset, or origin point, relative to the top-left corner
yorigreal/macroThe new vertical body sprite offset, or origin point, relative to the top-left corner
face_xrealThe horizontal position to display the face, relative to the body sprite top-left corner (or keyword previous for no change)
face_yrealThe vertical position to display the face, relative to the body sprite top-left corner (or keyword previous for no change)
scalinginteger/macroSets the new automatic scaling mode for the character
flipbooleanEnables or disables horizontally flipping the character
idlerealSets the delay in seconds between loops of the idle face sprite animation, where 3 is default
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 set of sprites and extra sprite properties and fades the old character 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.

Unlike other modifications, this script allows changing the character's name, which doubles as its entity ID. As such, be aware that changing a character's ID will require further modification actions to use the new ID instead of the old one in the future.

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

Example#

vngen_event() {
vngen_char_replace_ext("John Doe", previous, spr_new_body, spr_new_idle, spr_new_talk, orig_left, orig_bottom, 256, 384, scale_none, true, 3, 1, ease_sin_in_out);
}