data_save - ryzom/ryzomcore GitHub Wiki


title: Data Save description: Save script data variables to file (not implemented) published: true date: 2026-03-14T00:00:00.000Z tags: editor: markdown dateCreated: 2023-03-16T22:21:56.023Z

dataSave

The dataSave native AI script function is intended to save all previously written script data variables to a file.

This function is a no-op. The implementation is commented out and the function does nothing when called. Script data variables are instead persisted automatically through the Backup Service (Bsi) system when the AI service detects that variables have changed (_Dirty flag). You do not need to call this function. {.is-warning}

Syntax

()dataSave()

How Persistence Actually Works

Script data variables set via dataSetVar are automatically persisted:

  1. Each call to dataSetVar sets a dirty flag in CAIScriptDataManager
  2. The Backup Service periodically checks for dirty data and saves it
  3. Data is stored as a PDR (Persistent Data Record) binary file at ai_script_data/<ais_name>_pdr.bin in the shard save directory
  4. On AI service startup, the PDR file is loaded to restore all variables

There is no need to explicitly trigger a save.

See also

Source: ryzom/server/src/ai_service/nf_static.cpp (dataSave__), ryzom/server/src/ai_service/ai_script_data_manager.cpp

⚠️ **GitHub.com Fallback** ⚠️