Skip to main content

The "vngen_log_get_index" Function

Syntax#

vngen_log_get_index(entry);
ArgumentTypeDescription
entryinteger/macroThe on-screen entry to get historical index from, starting from 0 (or keyword 'previous' for most recent)

Description#

This script might seem confusing at first, but its function is actually quite simple. VNgen essentially stores backlog entries with two indices: 1) the order in which entries have appeared for the entire session, and 2) the order in which entries appear on the screen. Typically, the log will be limited to just 25 or 50 entries before purging old data, at which point these two indices will become desynchronized.

While you shouldn't often need it, at times it can be helpful to know the historical index of an on-screen backlog entry. These entries are ordered from zero to max size, from top to bottom. By inputting the on-screen index of a backlog entry in vngen_log_get_index, the historical index will be returned and can be used, for example, to add new log data at a certain position even without knowing exactly how many entries the user has viewed in total throughout their entire session.

Example#

var index_latest = vngen_log_get_index(previous);