Skip to main content

The "vngen_option" Function

Syntax#

vngen_option(id, x, y, delay_in, delay_out, snd_hover, snd_select, [lang]);
ArgumentTypeDescription
idreal/stringThe identifier to use for the entire options block, as a group
xrealThe horizontal position to display the entire options block, relative to the global offset
yrealThe vertical position to display the entire options block, relative to the global offset
delay_inrealThe length of time in seconds to delay displaying options
delay_outrealThe length of time in seconds to delay destroying options
snd_hoversoundThe sound to play when an option is hovered (or keyword none for none)
snd_selectsoundThe sound to play when an option is selected (or keyword none for none)
[lang]real/stringOptional: Sets the language flag for the entire options block

Description#

Initializes a segment of code containing VNgen options. Once this script has been run, as many options as desired can be executed inside it. While it may behave like an event, this script is itself an action and will pause all further actions in the current event until a selection has been made.

As of version 1.0.7, options have both a block (or group) ID and individual option IDs. The ID of previously-selected options can be recalled at any time by supplying the option block ID in the vngen_get_option function.

For the sake of performance, vngen_option is intended to be used within an if statement. This guarantees that individual options within will only be performed while the option block is active.

See Language Functions for details on multi-language support.

Example#

if vngen_event() {
if vngen_option("op_choice", view_wview[0]*0.5, view_hview[0]*0.5, 0.5, 0.5, snd_hover, snd_select) {
//Options
}
}