Skip to main content

The "vngen_exists" Function

Syntax#

vngen_exists(id, type, [name]);
ArgumentTypeDescription
idreal/stringThe ID of the specific entity to check (or keyword 'any' for any)
typeinteger/macroSets which type of entity to check
[name]stringOptional: Sets the character name to check, if entity is an attachment

Description#

Returns true if the input entity exists, or false if it does not.

Note that in the case of buttons, results will differ depending on whether the log is currently open or not. If so, only log buttons will be counted, while if not, only non-log buttons will be counted instead.

See Macros & Keywords for a full list of available entity types. In addition to standard types, this script also supports checking the current speaking character(s) which can be used, for example, to trigger different UI styles depending on whose lines are in focus.

Example#

if (vngen_exists("John Doe", vngen_type_char)) {
vngen_goto("ev_char_exists");
} else {
vngen_goto("ev_char_create");
}