logic_achievement

From Valve Developer Community
Jump to navigation Jump to search
English (en)Translate (Translate)
Info.png
This entity is not in the Portal 2 FGD by default, except in TeamSpen's Hammer AddonsPortal 2.
See below for instructions on making it available.
Class hierarchy
CLogicAchievement
CLogicalEntity
CServerOnlyEntity
CBaseEntity
logic_achievement.cpp
Logic achievement.png

logic_achievement is a point entity available in Half-Life 2 series Half-Life 2 series and Portal series Portal series. (not in Half-Life 2: Deathmatch)

It fires events that unlock or aid progression toward achievements.

Since achievements cannot currently be created or modified without access to the Steamworks backend, this entity is of limited use to modders.

Note.pngNote:In fact, it is still possible to create your own achievements that does not rely on Steam, but are fully functional within the in-game achievement system.
Example: Black Mesa Black Mesa (original 2012 Mod version)

Keyvalues

Name (targetname) <string>
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

Achievement Event (AchievementEvent) <choices>
The event that will be triggered. A game will only accept its own achievements.
Note.pngNote:Targetname "strings" in TeamSpen's Hammer Addons Portal 2 FGDs.
Achievement Name (AchievementName) <choices> (only in TeamSpen's Hammer AddonsPortal 2)
The name of the achievement to be awarded when this entity receives a 'FireEvent' input.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).

Inputs

Toggle
If the entity is disabled, it cannot relay the achievement message.
FireEvent
Tells the achievement system the specifed event has occured.

EnableDisable:

Enable / Disable
Enable/disable this entity from performing its task. It might also disappear from view.

Outputs

OnFired
Fires when the FireEvent input is received.

FGD code

Note.pngNote:Portal 2 does have halflife2.fgd, which includes logic_achievement, however it doesn't include any achievement event from Portal 2 at all.
Note.pngNote:Copied from Half-Life 2 and modified for Portal 2 (with some code from TeamSpen's Portal 2 FGD). It is also present on TeamSpen's Hammer Addons's Portal 2 FGDs.
Show FGD code
@PointClass base(Targetname, EnableDisable) = logic_achievement :
	"Sends an achievement system related event from the map to the achievement system."
[
	//keyvalues
	
	achievementevent(string) : "Achievement Event" : : "Named event is sent to the achievement system when this entity receives a 'FireEvent' input."
	achievementname(choices) : "Achievement Name" : : "The name of the achievement to be awarded when this entity receives a 'FireEvent' input." =
	[
		"ACH.SURVIVE_CONTAINER_RIDE": "Wake Up Call"
		"ACH.WAKE_UP": "You Monster"
		"ACH.LASER": "Undiscouraged"
		"ACH.BRIDGE": "Bridge Over Troubling Water"
		"ACH.BREAK_OUT": "SaBOTour"
		"ACH.STALEMATE_ASSOCIATE": "Stalemate Associate"
		"ACH.ADDICTED_TO_SPUDS": "Tater Tote"
		"ACH.BLUE_GEL": "Vertically Unchallenged"
		"ACH.ORANGE_GEL": "Stranger Than Friction"
		"ACH.WHITE_GEL": "White Out"
		"ACH.TRACTOR_BEAM": "Tunnel of Funnel"
		"ACH.TRIVIAL_TEST": "Dual Pit Experiment"
		"ACH.WHEATLEY_TRIES_TO": "The Part Where He Kills You"
		"ACH.SHOOT_THE_MOON": "Lunacy"
		"ACH.BOX_HOLE_IN_ONE": "Drop Box"
		"ACH.SPEED_RUN_LEVEL": "Overclocker"
		"ACH.COMPLIANT": "Pit Boss"
		"ACH.SAVE_CUBE": "Preservation of Mass"
		"ACH.LAUNCH_TURRET": "Pturretdactyl"
		"ACH.CLEAN_UP": "Final Transmission"
		"ACH.REENTER_TEST_CHAMBERS": "Good Listener"
		"ACH.NOT_THE_DROID": "Scanned Alone"
		"ACH.SAVE_REDEMPTION_TURRET": "No Hard Feelings"
		"ACH.CATCH_CRAZY_BOX": "Schrodinger's Catch"
		"ACH.NO_BOAT": "Ship Overboard"
		"ACH.A3_DOORS": "Door Prize"
		"ACH.A3_DOORS[1]": "Door Prize - 1/6"
		"ACH.A3_DOORS[2]": "Door Prize - 2/6"
		"ACH.A3_DOORS[3]": "Door Prize - 3/6"
		"ACH.A3_DOORS[4]": "Door Prize - 4/6"
		"ACH.A3_DOORS[5]": "Door Prize - 5/6"
		"ACH.A3_DOORS[6]": "Door Prize - 6/6"
		"ACH.PORTRAIT": "Portrait of a Lady"
		"ACH.DEFIANT": "You Made Your Point"
		"ACH.BREAK_MONITORS": "Smash TV"
		"ACH.BREAK_MONITORS[1]": "Smash TV - 1/11"
		"ACH.BREAK_MONITORS[2]": "Smash TV - 2/11"
		"ACH.BREAK_MONITORS[3]": "Smash TV - 3/11"
		"ACH.BREAK_MONITORS[4]": "Smash TV - 4/11"
		"ACH.BREAK_MONITORS[5]": "Smash TV - 5/11"
		"ACH.BREAK_MONITORS[6]": "Smash TV - 6/11"
		"ACH.BREAK_MONITORS[7]": "Smash TV - 7/11"
		"ACH.BREAK_MONITORS[8]": "Smash TV - 8/11"
		"ACH.BREAK_MONITORS[9]": "Smash TV - 9/11"
		"ACH.BREAK_MONITORS[10]": "Smash TV - 10/11"
		"ACH.BREAK_MONITORS[11]": "Smash TV - 11/11"
		"ACH.HI_FIVE_YOUR_PARTNER": "High Five"
		"ACH.TEAM_BUILDING": "Team Building"
		"ACH.MASS_AND_VELOCITY": "Confidence Building"
		"ACH.HUG_NAME": "Bridge Building"
		"ACH.EXCURSION_FUNNELS": "Obstacle Building"
		"ACH.NEW_BLOOD": "You Saved Science"
		"ACH.NICE_CATCH": "Iron Grip"
		"ACH.TAUNTS": "Gesticul-8"
		"ACH.YOU_MONSTER": "Can't Touch This"
		"ACH.PARTNER_DROP": "Empty Gesture"
		"ACH.PARTY_OF_THREE": "Party of Three"
		"ACH.PORTAL_TAUNT": "Narbacular Drop"
		"ACH.TEACHER": "Professor Portal"
		"ACH.WITH_STYLE": "Air Show"
		"ACH.LIMITED_PORTALS": "Portal Conservation Society"
		"ACH.FOUR_PORTALS": "Four Ring Circus"
		"ACH.SPEED_RUN_COOP": "Triple Crown"
		"ACH.STAYING_ALIVE": "Still Alive"
		"ACH.TAUNT_CAMERA": "Asking for Trouble"
		"ACH.ROCK_CRUSHES_ROBOT": "Rock Portal Scissors"
		"ACH.SPREAD_THE_LOVE": "Friends List With Benefits"
		"ACH.SUMMER_SALE": "Talent Show"
	]

	// Inputs
	input Toggle(void) : "Toggle the relay between enabled and disabled."
	input FireEvent(void) : "Tells the achievement system the specifed event has occured."
	input SetTargetPlayer(target_destination) : "Set the player who will be awarded this achievement."

	// Outputs
	output OnFired(void) : "When the event fires, this fires."
]