This article's documentation is for anything that uses the Source engine. Click here for more information.

Logic autosave: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Technical limitations)
No edit summary
 
(42 intermediate revisions by 20 users not shown)
Line 1: Line 1:
{{wrongtitle|title=logic_autosave}}
{{LanguageBar}} {{Source topicon}}
{{CD|CLogicAutosave|file1=logicentities.cpp}}
{{This is a|logical entity|sprite=1|name=logic_autosave}} It is used to force an autosave. It is usually triggered before large firefights or dangerous areas where the player might die.
{{note|Arguably pointless for multiplayer.}}


==Entity Description==
== Keyvalues ==
'''Entity Name:''' logic_autosave
{{KV Targetname}}
{{KV|Force New Level Unit|intn=NewLevelUnit|boolean|If set, the save will discard any savedata from previous levels, for the purpose of keeping savegame filesizes down. Can only be safely used if there is no way for the player to return to previous levels.}}
{{KV|Minimum Hit Points|intn=MinimumHitPoints|integer|Don't save dangerous when player has less than this many hitpoints.}}
{{KV|Minimum Hit Points to Commit|intn=MinHitPointsToCommit|integer|Minimum hitpoints required to commit to save. The save will be made if you have at least Minimum Hit Points, but when the autosave timer expires, the autosave is only kept if you have at least Min Hitpoints to Commit.}}


An entity that is used to force an autosave.
== Inputs ==
{{I|Save|Force an autosave.}}
{{I|SaveDangerous|Force an autosave as autosavedangerous.sav. If the player is alive after the passed number of seconds it replaces the standard auto save.|param=float}}
{{I|SetMinHitpointsThreshold|Set MinimumHitPoints to this.|param=integer}}


==Entity Values==
== See also ==
===Keys===
* {{Ent|logic_active_autosave}}
 
* {{Ent|trigger_autosave}}
* '''Name''' ''targetname <target_source>'' 
** The name that other entities refer to this entity by.
*'''Force New Level Unit''' ''NewLevelUnit <choices>''
** If set, the save will discard any savedata from previous levels, for the purpose of keeping savegame filesizes down. Can only be safely used if there is no way for the player to return to previous levels.
 
 
===Inputs===
 
* '''Kill'''
** Removes this entity from the world.
* '''KillHierarchy''' 
** Removes this entity and all its children from the world.
* '''AddOutput''' ''<string> <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>''
** Adds an entity I/O connection to this entity. Very dangerous, use with care
* '''FireUser1'''
** Causes this entity's OnUser1 output to be fired.
* '''FireUser2'''
** Causes this entity's OnUser2 output to be fired.
* '''FireUser3'''
** Causes this entity's OnUser3 output to be fired.
* '''FireUser4'''
** Causes this entity's OnUser4 output to be fired.
* '''Save'''
** Force an autosave.
 
 
===Outputs===
 
* '''OnUser1'''
** Fired in response to FireUser1 input.
* '''OnUser2'''
** Fired in response to FireUser2 input.
* '''OnUser3'''
** Fired in response to FireUser3 input.
* '''OnUser4'''
** Fired in response to FireUser4 input.
 
==Additional Info==
* Arguably pointless for multiplayer.

Latest revision as of 04:49, 29 April 2025

English (en)Translate (Translate)
C++ Class hierarchy
CLogicAutosave
CLogicalEntity
CServerOnlyEntity
CBaseEntity
C++ logicentities.cpp
Logic autosave.png

logic_autosave is a logical entity available in all Source Source games. It is used to force an autosave. It is usually triggered before large firefights or dangerous areas where the player might die.

Note.pngNote:Arguably pointless for multiplayer.

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Force New Level Unit (NewLevelUnit) <boolean>
If set, the save will discard any savedata from previous levels, for the purpose of keeping savegame filesizes down. Can only be safely used if there is no way for the player to return to previous levels.
Minimum Hit Points (MinimumHitPoints) <integer>
Don't save dangerous when player has less than this many hitpoints.
Minimum Hit Points to Commit (MinHitPointsToCommit) <integer>
Minimum hitpoints required to commit to save. The save will be made if you have at least Minimum Hit Points, but when the autosave timer expires, the autosave is only kept if you have at least Min Hitpoints to Commit.

Inputs

Save
Force an autosave.
SaveDangerous <floatRedirectInput/float>
Force an autosave as autosavedangerous.sav. If the player is alive after the passed number of seconds it replaces the standard auto save.
SetMinHitpointsThreshold <integerRedirectInput/integer>
Set MinimumHitPoints to this.

See also