Item sodacan: Difference between revisions
Jump to navigation
Jump to search
Note:This uses 
In most games except
Half-Life: Source,
Half-Life Deathmatch: Source, and
Jabroni Brawl: Episode 3, you will need to provide your own model as this one is not present.
Additionally, the ItemSoda.Bounce soundscript should also be provided, which plays every time the soda can thinks.
Note:Still exists in
Black Mesa, but is deprecated by prop_soda.
Note: See Model entity/Generic Keyvalues, Inputs and Outputs for keyvalues and inputs that affect model rendering.
Note that the following keyvalues are unavailable due to being overridden by game code:
model, solid
It may still be possible to use their associated inputs or AddOutput them.
Gtamike TSGK (talk | contribs) mNo edit summary |
m (Classifying as model entity) |
||
(18 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{ent not in fgd}}{{tabs|item_sodacan|goldsrc=1|source=1|main=source}} | |||
{{CD|CItemSoda|file1=effects.cpp}} | |||
{{this is a|model entity|name=item_sodacan|except=Strata}} It's a soda can that falls out of {{ent|env_beverage}}, healing 1 [[hit point]] when touched. | |||
{{note|This uses {{file|models/can|mdl}} by default.<br>In most games except {{hls|2}}, {{hldms|2}}, and {{jbep3|2}}, you will need to provide your own model as this one is not present.<br>Additionally, the {{code|ItemSoda.Bounce}} [[soundscript]] should also be provided, which plays every time the soda can [[think]]s.}} | |||
{{Note|Still exists in {{bms|2}}, but is deprecated by {{ent|prop_soda}}.}} | |||
== Keyvalues == | |||
{{studio rendering note|model, solid}} | |||
{{KV Targetname}} | |||
{{KV Angles}} | |||
== See also == | == See also == | ||
* [[env_beverage]] | * [[env_beverage]] | ||
== FGD Code == | |||
Add the following entry to the bottom of [[base.fgd]] to place soda cans directly in the map: | |||
{{expand|<source lang=cpp> | |||
@PointClass base(Targetname, Angles) size(-4 -4 -4, 4 4 4) studio("models/can.mdl") = item_sodacan : "Beverage; heals 1 HP." | |||
[ | |||
skin(choices) : "Beverage Type" : 0 = | |||
[ | |||
0 : "Coca-Cola" | |||
1 : "Sprite" | |||
2 : "Diet Coke" | |||
3 : "Orange" | |||
4 : "Surge" | |||
5 : "Moxie" | |||
] | |||
modelscale(float) : "Model Scale" : : "A multiplier for the size of the model." | |||
lightingorigin(target_destination) : "Lighting Origin" : : "Name of entity (not info_lighting!) from which to sample lighting instead of this entity's origin or $illumposition." | |||
disableshadows(choices) : "Disable Shadows" : "" : "Used to disable dynamic shadows on this entity." = | |||
[ | |||
"" : "No" | |||
1 : "Yes" | |||
] | |||
disablereceiveshadows(choices) : "Disable Receiving Shadows" : "" : "Prevent the entity from receiving dynamic shadows on itself."= | |||
[ | |||
"" : "No" | |||
1 : "Yes" | |||
] | |||
shadowcastdist(integer) : "Shadow Cast Distance" : : "Sets how far the entity casts dynamic shadows. 0 means default distance from the shadow_control entity." | |||
// Inputs | |||
input skin(integer) : "Changes the model skin to the specified number." | |||
input DisableShadow(void) : "Turn shadow off." | |||
input EnableShadow(void) : "Turn shadow on." | |||
input AlternativeSorting(bool) : "Used to attempt to fix sorting problems when rendering. True activates, false deactivates" | |||
input SetModelScale(string) : "Takes two values separated by a space. The first is the target model scale. The second value is the number of seconds the change in scale will be spread over." | |||
// Outputs | |||
output OnIgnite(void) : "Fired when this object catches fire." | |||
] | |||
</source>}} | |||
== External links == | == External links == | ||
* [http://gtamike.tsgk.com/developer/item_sodacan.rar Example .VMF with working model and materials] | * [http://gtamike.tsgk.com/developer/item_sodacan.rar Example .VMF with working model and materials] |
Latest revision as of 04:32, 19 May 2025
![]() |
---|
CItemSoda |
![]() |
item_sodacan
is a model entity available in all Source games except
Strata Source. It's a soda can that falls out of env_beverage, healing 1 hit point when touched.


models/can.mdl
by default.In most games except



Additionally, the ItemSoda.Bounce soundscript should also be provided, which plays every time the soda can thinks.


Keyvalues

Note that the following keyvalues are unavailable due to being overridden by game code:
model, solid
It may still be possible to use their associated inputs or AddOutput them.
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Pitch Yaw Roll (Y Z X) (angles) <QAngle>
- This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
See also
FGD Code
Add the following entry to the bottom of base.fgd to place soda cans directly in the map:
@PointClass base(Targetname, Angles) size(-4 -4 -4, 4 4 4) studio("models/can.mdl") = item_sodacan : "Beverage; heals 1 HP."
[
skin(choices) : "Beverage Type" : 0 =
[
0 : "Coca-Cola"
1 : "Sprite"
2 : "Diet Coke"
3 : "Orange"
4 : "Surge"
5 : "Moxie"
]
modelscale(float) : "Model Scale" : : "A multiplier for the size of the model."
lightingorigin(target_destination) : "Lighting Origin" : : "Name of entity (not info_lighting!) from which to sample lighting instead of this entity's origin or $illumposition."
disableshadows(choices) : "Disable Shadows" : "" : "Used to disable dynamic shadows on this entity." =
[
"" : "No"
1 : "Yes"
]
disablereceiveshadows(choices) : "Disable Receiving Shadows" : "" : "Prevent the entity from receiving dynamic shadows on itself."=
[
"" : "No"
1 : "Yes"
]
shadowcastdist(integer) : "Shadow Cast Distance" : : "Sets how far the entity casts dynamic shadows. 0 means default distance from the shadow_control entity."
// Inputs
input skin(integer) : "Changes the model skin to the specified number."
input DisableShadow(void) : "Turn shadow off."
input EnableShadow(void) : "Turn shadow on."
input AlternativeSorting(bool) : "Used to attempt to fix sorting problems when rendering. True activates, false deactivates"
input SetModelScale(string) : "Takes two values separated by a space. The first is the target model scale. The second value is the number of seconds the change in scale will be spread over."
// Outputs
output OnIgnite(void) : "Fired when this object catches fire."
]
|