Scripted item drop: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (Classifying as model entity)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{l4d2 point|scripted_item_drop}} It is a prop similar to [[prop_physics_override]], but with much of its functionality removed. It does not collide with players and has outputs for being touched and picked up, making it useful for simple collectible items.
{{CD|CScriptItem}}
 
{{this is a|model entity|name=scripted_item_drop|game=Left 4 Dead 2}} It is a prop similar to [[prop_physics_override]], but with much of its functionality removed. It does not collide with players and has outputs for being touched and picked up, making it useful for simple collectible items.
 
== Keyvalues ==
{{KV Targetname}}
{{KV Parentname}}
{{KV Origin}}
{{KV Angles}}
{{KV Studiomodel}}
 
== Inputs ==
{{I Targetname}}
{{I Parentname}}
{{I Studiomodel}}
 


== Outputs ==
== Outputs ==
{{IO|OnCacheInteraction|{{todo|Unknown function}}|nofgd=1}}
{{O|OnCacheInteraction|Fires repeatedly while player is touching this|nofgd=1}}
{{IO|OnPlayerPickup|Fired when a player successfully picks up the prop. The [[List_of_L4D2_Script_Functions#CanPickupObject|CanPickupObject]] function needs to exist and return true for the prop for it to fire.|nofgd=1}}
{{O|OnPlayerPickup|Fired when a player successfully picks up the prop. The [[Left 4 Dead 2/Script Functions#CanPickupObject|CanPickupObject]] function needs to exist and return true for the prop for it to fire.|nofgd=1}}
{{IO|OnPlayerTouch|Fired when a player touches the prop.|nofgd=1}}
{{O|OnPlayerTouch|Fired when a player touches the prop.|nofgd=1}}
{{O Targetname}}
{{O Studiomodel}}

Latest revision as of 04:34, 19 May 2025

C++ Class hierarchy
CScriptItem
CItem
CBaseAnimating
CBaseEntity

scripted_item_drop is a model entity available in Left 4 Dead 2 Left 4 Dead 2. It is a prop similar to prop_physics_override, but with much of its functionality removed. It does not collide with players and has outputs for being touched and picked up, making it useful for simple collectible items.

Outputs

OnCacheInteraction  !FGD
Fires repeatedly while player is touching this
OnPlayerPickup  !FGD
Fired when a player successfully picks up the prop. The CanPickupObject function needs to exist and return true for the prop for it to fire.
OnPlayerTouch  !FGD
Fired when a player touches the prop.