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
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 (
_Dirtyflag). You do not need to call this function. {.is-warning}
()dataSave()Script data variables set via dataSetVar are automatically persisted:
- Each call to
dataSetVarsets a dirty flag inCAIScriptDataManager - The Backup Service periodically checks for dirty data and saves it
- Data is stored as a PDR (Persistent Data Record) binary file at
ai_script_data/<ais_name>_pdr.binin the shard save directory - On AI service startup, the PDR file is loaded to restore all variables
There is no need to explicitly trigger a save.
- dataSetVar - Set a persistent variable
- dataGetVar - Read a persistent variable
Source: ryzom/server/src/ai_service/nf_static.cpp (dataSave__), ryzom/server/src/ai_service/ai_script_data_manager.cpp