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

Game score: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(9 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[File:{{PAGENAME}}.png|left|link=]]
{{CD|CGameScore|file1=1}}
 
{{this is a|logical entity|name=game_score|sprite=1}} An [[entity]] that modifies the points of the player who activates it ([[!activator]]).
{{base point|game_score}} An [[entity]] that modifies the points of the player who activates it ([[!activator]]).
[[File:Gamescore.jpg|thumb|right|300px|Modified Score of !activator (myself)]]
 
In code it is represented by class CGameScore, defined in maprules.cpp.
{{note|This entity cannot be used to affect the scores of teams/players in [[Left 4 Dead]] / [[Left 4 Dead 2]].}}
{{note|This entity cannot be used to affect the scores of teams/players in [[Left 4 Dead]] / [[Left 4 Dead 2]].}}


[[Image:Gamescore.jpg|thumb|right|300px|Modified Score of !activator (myself)]]
== Keyvalues ==
== Keyvalues ==
{{KV|Points to add (+/-)|integer|Number of points to add or substract.}}
{{KV|Master (Obsolete)|string|Legacy support: The name of a master entity. If the master hasn't been activated, this entity will not activate.}}
{{KV Targetname}}
{{KV Targetname}}
{{KV|Points to add (+/-)|intn=points|integer|Number of points to add or substract.}}
{{KV|Master (Obsolete)|intn=master|string|Legacy support: The name of a master entity. If the master hasn't been activated, this entity will not activate.}}


== Flags ==
== Flags ==
* 1 : Allow Negative
{{fl|1|Allow Negative}}
* 2 : Team Points
{{fl|2|Team Points}}


== Inputs ==
== Inputs ==
{{IO|ApplyScore|Add score to player.}}
{{I|ApplyScore|Add score to player.}}
{{I Targetname}}
{{I|AddScoreTerrorist|Add score to the Terrorist team.|only={{csgo}}}}
 
{{I|AddScoreCT|Add score to the Counter-Terrorist team.|only={{csgo}}}}
== Outputs ==
{{O Targetname}}

Latest revision as of 05:24, 29 April 2025

C++ Class hierarchy
CGameScore
CRulePointEntity
CRuleEntity
CBaseEntity
C++ maprules.cpp
Game score.png

game_score is a logical entity available in all Source Source games. An entity that modifies the points of the player who activates it (!activator).

Modified Score of !activator (myself)
Note.pngNote:This entity cannot be used to affect the scores of teams/players in Left 4 Dead / Left 4 Dead 2.

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

Points to add (+/-) (points) <integer>
Number of points to add or substract.
Master (Obsolete) (master) <string>
Legacy support: The name of a master entity. If the master hasn't been activated, this entity will not activate.

Flags

Allow Negative : [1]
Team Points : [2]

Inputs

ApplyScore
Add score to player.
AddScoreTerrorist  (only in Counter-Strike: Global Offensive)
Add score to the Terrorist team.
AddScoreCT  (only in Counter-Strike: Global Offensive)
Add score to the Counter-Terrorist team.