CLogicAutosave

From Source Entities
(Redirected from Logic autosave)
Jump to navigation Jump to search
Logic autosave.png

CLogicAutosave is a class in every Source game. In singleplayer games, this entity tells the game to make a save state. It can also do "dangerous" saves, which will only count as valid if the player has at least a certain amount of health after a certain number of seconds. Danger-saves can be used to almost completely prevent infinite death loops.

Classnames:

  • logic_autosave

Keyvalues[edit | edit source]

Force New Level Unit (NewLevelUnit) <boolean>
If true, the game will purge all previous save files when either "Save" input is sent to this entity. This is done periodically to keep the save folder uncluttered.
Minimum Hit Points/Initiation Hit Points (MinimumHitPoints) <integer>
If doing a dangerous save, require that the player's health be at least this amount the moment the input is sent.
Minimum Hit Points to Commit (MinHitPointsToCommit) <integer>
If doing a dangerous save, require that the player's health be at least this amount when the "danger timer" (time specified in the input parameter) runs out.

Inputs[edit | edit source]

Save
Makes the game save.
SaveDangerous <float>
Makes a dangerous save. The player must have at least the amount of health in Minimum Hit Points when the input is sent, and also have at least the amount of health in Minimum Hit Points to Commit after the amount of seconds in the input parameter has passed. If this input is sent while another dangerous save is waiting to be validated, that one will be validated immediately.
SetMinHitpointsThreshold <integer>
Sets Minimum Hit Points.

See Also[edit | edit source]