Skip to main content

The "vngen_room_goto" Function

Syntax#

vngen_room_goto(room, [event, object], [perform]);
ArgumentTypeDescription
roomroomThe room index to go to
eventinteger/stringOptional: The VNgen event ID or label to jump to in the new room
objectobjectOptional: The VNgen object to jump to in the new room
performbooleanOptional: Enables or disables performing skipped events

Description#

Ends the current room and activates the specified room index in its place, safely clearing VNgen data from memory in the process to prevent errors and memory leaks. Optionally can also jump to a specific VNgen object and event in the new room.

This function should always be used in place of the standard room_goto function when one or more VNgen objects exist in the current room.

Note that vngen_room_goto is not an action, and therefore requires being wrapped in vngen_script_execute to behave as one. The exception to this is when used in conjunction with vngen_get_option in a dialog option segment: as vngen_get_option is itself not an action either (but behaves like one), in this case vngen_room_goto should be used normally.

Example#

vngen_room_goto(my_room);
vngen_room_goto(my_room, "choice_good", obj_vngen);
vngen_room_goto(my_room, "choice_bad", obj_vngen, false);