Env dispenser: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Somebody added similar picture for env_beverage, I think it would be nice to have the same thing for env_dispenser.)
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{this is a|point entity|name=env_dispenser|game=Black Mesa}} This entity used for [[Vending Machines|vending machines]] to dispense the soda cans ({{ent|prop_soda}} entity).
{{TabsBar|main=Env beverage}}
{{bug|Don't use this entity in multiplayer maps to spawn {{ent|prop_soda}}, {{ent|prop_soda}} physics is disabled in multiplayer.|hidetested=1}}
{{CDA|CEnv_Dispenser|CBaseEntity|}}
{{back |Black Mesa Level Creation}}
{{this is a|point entity|name=env_dispenser|game=Black Mesa}} This entity used for [[Vending Machines|vending machines]] to dispense the soda cans ({{ent|prop_soda}} entity).  


== Keyvalues ==
== Keyvalues ==
[[File:Env_dispenser_cans.png|thumb|The three flavors of soft drinks in {{bms|2}}.]]
[[File:Env_dispenser_cans.png|thumb|The three flavors of soft drinks in {{bms|2}}.]]
{{KV Targetname}}
{{KV|Model to spawn|intn=spawnmodel|studio|Model to spawn when activated.
{{KV|Model to spawn|intn=spawnmodel|studio|Model to spawn when activated.
{{bug|The default value in [[FGD]] is {{code|models/props_junk/popcan01a.mdl}}, if you use other value - {{ent|env_dispenser}} will spawn {{ent|prop_physics}} instead of {{ent|prop_soda}}, so, player will not be able to drink and heal.|hidetested=1}}
{{note|The default value in [[FGD]] is {{code|models/props_junk/popcan01a.mdl}}, if you use other value - {{ent|env_dispenser}} will spawn {{ent|prop_physics}} instead of {{ent|prop_soda}}, so, player will not be able to drink and heal.}}
}}
}}
{{KV|Spawn angles|intn=spawnangles|angle|Orientation of the model at spawn (Y Z X).
{{KV|Spawn angles|intn=spawnangles|angle|Orientation of the model at spawn (Y Z X).

Latest revision as of 08:56, 12 August 2025

Source Engine ( General | Black Mesa )
edit
C++ Class hierarchy
CEnv_Dispenser
CBaseEntity

env_dispenser is a point entity available in Black Mesa Black Mesa. This entity used for vending machines to dispense the soda cans (prop_soda entity).

Keyvalues

The three flavors of soft drinks in Black Mesa Black Mesa.
Model to spawn (spawnmodel) <model path>
Model to spawn when activated.
Note.pngNote:The default value in FGD is models/props_junk/popcan01a.mdl, if you use other value - env_dispenser will spawn prop_physics instead of prop_soda, so, player will not be able to drink and heal.
Spawn angles (spawnangles) <angle>
Orientation of the model at spawn (Y Z X).
Warning.pngWarning:Pitch Yaw Roll (Y Z X) property will override value here (only if Pitch Yaw Roll (Y Z X) value isn't 0 0 0).
Capacity (capacity) <integer>
Number of models to spawn.
Minimum skin (skinmin) <integer>
Minimum skin number.
Maximum skin (skinmax) <integer>
Maximum skin number.
Tip.pngTip:You can have multiple skins for soda cans. Minimum skin indicates the minimum possible skin value, Maximum skin indicates the maximum possible skin value. You can also have only one skin for soda cans, just use one and the same value for both properties.

Inputs

Activate <void>
Spawn object with the specified model and skin. The object will spawn in env_dispenser origin.
Break <void>
Rapidy spawn all the items remaining in the dispenser.

Outputs

OnBreak <void>
Fires via Break input.
OnEmpty <void>
Fires when entity tries to spawn model (via Activate input) while is empty.