Difference between revisions of "Riven VARS resources"
(fixed wrong import)
|Line 1:||Line 1:|
of to each
Revision as of 19:47, 8 February 2008
The VARS resource is found in Riven saved game files. It stores the state of every game variable. The data seems to be just an array of 12-byte records, each representing a variable, with this structure:
|short||name_rec||Saved variable value|
u0 starts from 2, and seems to grow when going on with the game; u1 seems to be always 1 or 0. I don't know what these fields mean, they don't seem to be changed by scripts (i.e. they don't tell how many times the variable was written etc).
Fortunately, saved games contain a NAME resource that labels most variables in the VARS resource. The VARS record index simply matches the NAME one.
The number of records is not constant. If you save different games in different places then new records will appear, usually with u1 = 0 and strange values. However, "known" variables (dome combination, telescope levers state etc) are always at the same record.