trigger_save

Modified

12-Jul-2023

Trigger_save allows to save an entity's keyvalue to external map-data stored in mapname.save in the "maps"-folder, which is stored on the server running the map. Its counterpart is trigger_load. Supports custom keyvalues.

Keyvalues


OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.

Name targetname : Set name of trigger_save so other entities can trigger it to save keyvalue data.

Label to store in netname : A label under which data is to be stored.

Source Entity target : Entity to read value from.

Source Keyvalue message : Name of the keyvalue of the source entity to read value from.

Trigger after saving m_iszTrigger : Entity to trigger after the save-operation, even if nothing was loaded.

If the entity to read from is not found, the save-file won't be touched.

Trying to write strings containing line breaks (this does e.g. apply to game_text message-keyvalues containing the "\n"-character sequence) or colons will corrupt the save-file. This is because of how the feature was implemented and is simply not supported.