RSAV

From OHRRPGCE-Wiki
Jump to navigationJump to search

RSAV (Reload-Save) is the new format for savegames that the OHRRPGCE started using with the zenzizenzic release.

RSAV is a RELOAD document.

Although the tree structure of the rsav document is strict, the order in which the elements appear is flexible.

When loading a document that is missing a node, it is appropriate to use a reasonable default value instead of completely failing.

Node names in italics are obsolete; they were once saved, but are not any more. Node names in bold italics are obsolete and no longer saved, but are still read and somehow upgraded.

  • rsav - this is the root node
    • ver int - increment this to produce a warning message when loading a new rsav file in an old game player
    • game_client string - name of the program used to write this file. Optional and should be ignored if not recognised. The official client uses "OHRRPGCE", and writes the following children:
      • branch_name string - name of the release or branch, eg. "ypsiliform+2", "wip", from codename.txt
      • revision integer - SVN revision number
    • state - stores misc game state
      • current_map int - the number of the current map
      • caterpillar - hero walkabout party positions on the map
        • hero int - node for each caterpillar slot, value is caterpillar index 0-3
          • x int - x position in pixels
          • y int - y position in pixels
          • d int - direction as int 0-3
      • random_battle_countdown int - number of steps to the next random battle
      • camera - stores camera state
        • x int - camera offset in pixels
        • y int - camera offset in pixels
        • mode int - camera mode number
        • arg1 int - camera mode argument
        • arg2 int - camera mode argument
        • arg3 int - camera mode argument
        • arg4 int - camera mode argument
      • gold int - obviously stores your parties remaining gold
      • playtime - stores info about how long you have played
        • days int
        • hours int
        • minutes int
        • seconds int
      • textbox - stores current text box state
        • backdrop int - backdrop shown by text box
      • status_char - stores character used to label status afflictions
        • poison int - char number
        • stun int - char number
        • mute int - char number
        • regen int - char number
      • damage_cap int - maximum damage
      • level_cap int - maximum level (default to 99 if missing)
      • stats contains properties of stats
        • stat int - value is stat ID number 0-11
          • cap int - maximum value for this stat
    • script - stores state of script-related things
      • globals - stores script globals (integers only for now)
        • global int - one node for each global variable. Value is the global id number. If the global's value is 0, this node will not be present
          • int int - integer value of the global
      • strings - stores the plotstrings which can be displayed on the screen. Strings are only saved and loaded if saved_game.strings exists in general.reld. This means the node might be missing even if it's currently set to be saved/loaded.
        • string int - ID number, from 0-99. A node might be omitted if the string is unused (that is, all fields equal to zero/empty string/default value)
          • visible bool - whether the string is displayed
          • str str - contents of string
          • x int - x position
          • y int - y position
          • col int - 0-255: font colour index in master palette, or -1: use uiText colour (the default)
          • bgcol int - colour index of font background. Used only if the string style is 'flat' (in which case 0 is transparent), but still saved if it's not in case the style is later changed to flat.
          • style int - font option: 0 = edged, 1 = flat (not edged)
      • gameover_script - stored gameover trigger (Note: this is (currently) always saved but not loaded if the "Don't save gameover/loadgame script IDs" bit is set)
        • id int - script id of old-style script (should not coexist with name)
        • name str - script name of new-style script (should not coexist with id)
      • loadgame_script - stored loadgame trigger (Note as for gameover_script)
        • id int - script id of old-style script (should not coexist with name)
        • name str - script name of new-style script (should not coexist with id)
      • suspend - stores state of script suspend commands. If the child nodes are missing, those things are not suspended
        • npcs - node present if suspended
        • player - node present if suspended
        • obstruction - node present if suspended
        • herowalls - node present if suspended
        • npcwalls - node present if suspended
        • caterpillar - node present if suspended
        • randomenemies - node present if suspended
        • boxadvance - node present if suspended
        • overlays - node present if suspended
        • ambientmusic - node present if suspended
      • backdrop int - backdrop shown by script
    • maps - stores map state data
      • map int - value is map id number. Currently only stores the current map, but will store others in the future.
        • npcs - stores NPC locations for the current map (FIXME: this isn't loaded yet!)
          • npc int - for each npc instance. value is instance slot id number 0-299. Nodes only exist for NPCs that exist and that are explicitly saved (including ones that exist but are hidden by tags)
            • id int - npc id number 0-max
            • x int - x position in pixels
            • y int - y position in pixels
            • d int - direction 0-3
            • fr int - walking frame number 0-1
            • xgo int - queued horizontal walking distance in pixels. Only present if the npc is actually moving
            • ygo int - queued vertical waking distance in pixels. Only present if the npc is actually moving
            • extra int - one for each extra data 0-2 (optional: default to 0 if omitted). The value is the extra slot number
              • int int - integer value stored in the extra slot
            • ignore_walls - if present, npc can pass through walls
            • not_obstruction - if present, npc can pass through heroes and npcs and vice-versa
            • suspend_use - if present, npc can only be activated with usenpc
            • suspend_ai - if present, npc move-type is ignored
            • edit int - edit count, used in determining if an NPC's save state is still valid (unimplemented)
    • tags - stores tags
      • count int - number of tags
      • data - blob of bitsets
    • onetime - stores one-time-use tags
      • count int - number of tags
      • data - blob of bitsets
    • party - stores the state of the heroes in your party
      • slot int - one node for each party member, value is party slot id 0-40
        • id int - hero ID number. Not present if slot has no hero (other data is present even if hero has no id)
        • name string - the hero's name
        • locked - node exists if the hero is locked
        • stats - contains saved stats
          • stat int - one node for each stat, value is stat id number 0-11. If this node is not present than the stats are cur=0, max=0
            • cur int - current stat value
            • max int - max stat value
            • base int - base stat value. Not present in pre-Beelzebufo saves. If missing, should be computed from max stats and equipment.
        • lev int - hero's current level
        • lev_gain int - number of levels gained in last battle or script
        • exp int - current experience points
        • exp_next int - experience points for next level
        • exp_mult float - experience curve multiplier for this hero (defaults to the value in the hero definition if not present)
        • def_wep int - hero's default weapon
        • wep - stores info about hero's current weapon
          • pic int - picture id
          • pal int - palette id
        • hand - stores the hero's hand position. If this node doesn't exist, default hand positions should be used
          • frame int - 0 for attack A and 1 for attack B. If this node doesn't exist, default hand positions should be used
            • x int - x position of the hand relative to the top left corner of the hero sprite
            • y int - y position of the hand relative to the top left corner of the hero sprite
        • in_battle - stores info about hero's appearance in battle
          • pic int - picture id
          • pal int - palette id
        • walkabout - stores info about hero's appearance on the map
          • pic int - picture id
          • pal int - palette id
        • portrait - stores info about hero's portrait in textboxes and status screen
          • pic int - picture id
          • pal int - palette id
        • battle_menus - Obsolete. Was previously used to store hero battle menu data
        • spell_lists - contains the hero's spell lists
          • list int - one node for each spell list, value is list id 0-3
            • spells - contains the spells
              • spell int - one node for each spell in the list, value is list slot id 0-23. Node is not present if this spell slot is empty
                • attack int - attack id number used by this spell. Node is not present if this spell slot is empty
        • level_mp - contains hero's level mp
          • lev int - one node for each level mp level 0-7. Only stored when val is non-zero
            • val int - the current value for this level of level mp. Only stored when val is non-zero
        • equipment - contains the hero's equipped items
          • equip int - one for each equipment slot 0-4. value is slot id number. This node is not present for empty slots.
            • item int - the item id number equipped in this slot. This node is not present for empty slots.
        • elements - stores the hero's elemental strengths and weaknesses
          • element int - an element; ignored if larger than the highest enabled element, not saved in older versions
            • damage double - damage taken from this element (1.0 = 100% normal)
          • weak int - if present, the hero is weak to the element. Value is element ID number
          • strong int - if present, the hero is strong to the element. Value is element ID number
          • absorb int - if present, the hero absorbs the element. Value is element ID number
        • rename_on_add - if present, the hero is renamed when added to the party (totally absurd to have saved this)
        • rename_on_status - if present, the hero can be renamed on the status screen
        • hide_empty_lists - if present, the hero's empty spell lists are hidden
    • inventory - stores the party's inventory of items
      • size int - number of inventory slots available (or zero for default)
      • slots - contains the list of items
        • slot int - One for each non-empty inventory slot. Value is slot number.
          • item int - item id number
          • count int - number of items stacked in this slot
    • shops - stores shop state.
      • shop int - one node for each defined shop. Value is shop ID number
        • slots - contains data about each shop thing/stuff stock slot
          • slot int - one node for each used shop stock slot - but slots may be omitted. Value is the stockidx of a shop stuff, NOT the thing's index in the shop.
            • stock int - encodes number of shop stuffs left in stock for this slot. 0 if not initialised yet. -1 for infinite. >= 1 is amount in stock + 1 (eg 1 for out-of-stock). Defaults to 0 - omitted if not initialised yet.
            • orig_type int - the type of the shop stuff (at the time at the shop stock was initialized, which might not match shop data when the game was saved) - 0 for an item, 1 for a hero. Omitted if not initialised (may be missing even if stock is present). (This is a WIP feature)
            • orig_id int - the item/hero ID of the shop stuff (when the stock was initialized). Omitted if not initialised. (This is a WIP feature)
            • orig_stock int - the initial "In Stock" of the shop stuff (when the stock was initialized). -1 for infinite stock, 0 for none, > 0 for a finite amount (not offset by 1 like stock). Omitted if not initialised. (This is a WIP feature)
    • vehicle - stores state of currently active vehicle
      • id int - id number of the vehicle definition (only stored when actually riding a vehicle)
      • state - contains the state of the active vehicle (only stored when actually riding a vehicle)
        • active int - true if the vehicle is active
        • npc int - reference to vehicle npc
        • old_speed int - saved hero speed from before mounting the vehicle
        • mounting - present if vehicle is currently in mounting state
        • rising - present if vehicle is currently in rising state
        • falling - present if vehicle is currently in falling state
        • init_dismount - present if vehicle is currently initializing a dismount
        • trigger_cleanup - present if vehicle is currently triggering cleanup of itself
        • ahead - present if the hero is taking a step ahead after dismounting a vehicle
    • slices - stores saved slice trees
      • sprite_layer - if present, this is the root node of a saved Slicetree_n_n.reld slice collection. Note that the root node of a slice collection normally has an empty name, but this one has the name sprite_layer.