Difference between revisions of "Riven VARS resources"

From A look inside The Link @ wiki
Jump to: navigation, search
(import)
 
(updated type field)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<noinclude>{{Riven}}</noinclude>
 
<noinclude>{{Riven}}</noinclude>
CARD resources describe general properties of cards and associate a command script to each card.
+
The VARS resource is found in Riven saved game files (there is just one). It stores the state of every game variable. The data is just an array of 12-byte records, each representing a variable, with this structure:
 
{| class="structure"
 
{| class="structure"
 
|unsigned long||u0||
 
|unsigned long||u0||
 
|-
 
|-
|unsigned long||u1||
+
|unsigned long||type||class="comment"|0 = unknown, 1 = integer
 
|-
 
|-
|short||name_rec||class="comment"|Saved variable value
+
|unsigned long||value||class="comment"|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).
+
''u0'' starts from 2, and seems to grow when going on with the game.
  
 
Fortunately, saved games contain a [[Riven NAME resources|NAME]] resource that labels most variables in the VARS resource. The VARS record index simply matches the NAME one.
 
Fortunately, saved games contain a [[Riven NAME resources|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.
 
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.

Latest revision as of 14:37, 5 June 2009

Riven
Mohawk Overview
BLST CARD FLST HSPT
MLST NAME PLST RMAP
SFXE SLST tBMP tMOV
tWAV VARS VERS ZIPS
Scripts Variables
External commands

The VARS resource is found in Riven saved game files (there is just one). It stores the state of every game variable. The data is just an array of 12-byte records, each representing a variable, with this structure:

unsigned long u0
unsigned long type 0 = unknown, 1 = integer
unsigned long value Saved variable value

u0 starts from 2, and seems to grow when going on with the game.

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.