holiday_gift

From Valve Developer Community
Revision as of 21:32, 8 June 2025 by Kr0tchet (talk | contribs) (→‎Overview: - added CS:S, DOD:S entity description.)
Jump to navigation Jump to search
English (en)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the FGD by default.
See below for instructions on making it available.
C++ Class hierarchy
CHolidayGift
CItem
CBaseAnimating
CBaseEntity
Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality because:
The description only describes Left 4 Dead 2, but it also spawns from players who die in Counter-Strike: Source and Day of Defeat: Source.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.

holiday_gift is a model entity available in Left 4 Dead 2 Left 4 Dead 2, Day of Defeat: Source Day of Defeat: Source, and Counter-Strike: Source Counter-Strike: Source.

Overview

The mentioned entity has been in existence since December 2011 and was introduced in conjunction with the achievement Valve Gift Grab 2011 - L4D2. Its purpose is to collect three gifts dropped by Special Infected in Versus Mode.

The entity and achievements (named "Gift Grab", formerly "Valve Gift Grab 2011 – CS:S" and "Valve Gift Grab 2011 – DoD:S") are also present in Counter-Strike: Source and Day of Defeat: Source. Its purposes in these two games is to collect three gifts dropped by opponents.

Features

The gifts spawn for killed special infected and tanks, not for common/uncommon infected or the witch. Only players on the survivor team are able to collect the gifts. Both survivors and Special Infected/Tank can be the killer to obtain a gift drop. Even if the Special Infected/Tank is killed by the world (e.g. Any trigger_hurt or drowning), it can still trigger a gift drop.

Factors affecting gift spawning

Several factors determine whether a gift will spawn:

  1. The Convar: z_holiday_gift_drop_chance (default value: 0.3), indicating a 30% chance, with a minimum value of 0 and a maximum value of 1
  2. The date: Gifts spawn between December 1st and January 2nd (inclusive).
  3. Time interval: A new gift will only spawn after approximately 16 seconds have passed since the last one was dropped.

Gift lifespan

When a gift is not collected by any player, it will automatically despawn after 30 seconds.

FGD Code

Todo: Left 4 Dead 2 ver

Since this entity automatically disappears after 30 seconds if not picked up, it's best used in conjunction with point_template.

Counter-Strike: Source Counter-Strike: Source
@PointClass base(Targetname) size(-32 -32 -32, 32 32 32) studio("models/items/cs_gift.mdl") = holiday_gift : "A holiday present. Disappears after 30 seconds; spawn with point_template or vscript." []
Day of Defeat: Source Day of Defeat: Source
@PointClass base(Targetname) size(-32 -32 -32, 32 32 32) studio("models/items/dod_gift.mdl") = holiday_gift : "A holiday present. Disappears after 30 seconds; spawn with point_template or vscript." []
Left 4 Dead 2 Left 4 Dead 2
@PointClass base(Targetname) size(-32 -32 -32, 32 32 32) studio("models/items/l4d_gift.mdl") = holiday_gift : "A holiday present. Disappears after 30 seconds; spawn with point_template or vscript." []