Template:O Breakable: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(activator/caller)
 
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{o targetname}}
{{lang|Template:O Breakable}}
* '''OnBreak'''
This template isn't in line with anything specific in code. Default shows only outputs for brushes.
: Fired when this breakable breaks. {{activator|breaker}}
*<code>prop=1</code> shows outputs for props as well. There's nothing brushes have that props ''don't'' have.
* '''OnHealthChanged <float>'''
*<code>nohl2=1</code> hides the hl2-specific outputs.
: Fired when the health of this breakable changes, passing the new value of health as a percentage of max health, from [0..1].
The following is the result with no parameters. See also: {{tl2|O BreakableProp}}, {{tl2|O BreakableBrush}}.
* '''OnPhysCannonDetach'''
 
: Fired when the physcannon has ripped this breakable off of the wall. Only fired if ACT_PHYSCANNON_DETACH is defined in the model this breakable is using.
 
* '''{{ep1 add|OnPhysCannonAnimatePreStarted}}'''
{{ {{PAGENAME}}|prop=1 }}
: Fired when this prop starts playing the Pre physcannon-pull activity, caused by the player trying to grab this prop with the physcannon. Only fired if the ACT_PHYSCANNON_ANIMATE_PRE activity is defined in the model this breakable is using.
 
* '''{{ep1 add|OnPhysCannonAnimatePullStarted}}'''
<includeonly>
: Fired when this prop starts playing the physcannon-pull activity, caused by the player trying to grab this prop with the physcannon. Only fired if the ACT_PHYSCANNON_ANIMATE activity is defined in the model this breakable is using. If the prop has Pre pull anim, this will be fired after the Pre anim has finished playing.
 
* '''{{ep1 add|OnPhysCannonPullAnimFinished}}'''
<onlyinclude>{{minititle|Breakable{{#ifeq:{{{prop|0}}}|0|Brush|Prop}}}}<!--
: Fired when this prop has finished playing the physcannon-pull activity, caused by the player trying to grab this prop with the physcannon. Only fired if the ACT_PHYSCANNON_ANIMATE activity is defined in the model this breakable is using. If the prop has Pre & Post pull anims, this will be fired after the Post anim has finished playing.
-->{{O|OnBreak|activator = entity that breaks the object|Fired when this object breaks.}}
* '''{{ep1 add|OnPhysCannonAnimatePostStarted}}'''
{{O|OnHealthChanged|activator = entity that caused the health change|param=float|Fired whenever the health of the breakable has increased or decreased. {{outadd|the new health amount as a decimal percent (e.g. 45% {{=}} 0.45)}}}}<!--
: Fired when this prop starts playing the Post physcannon-pull activity. Only fired if the ACT_PHYSCANNON_ANIMATE_POST activity is defined in the model this breakable is using.
-->{{#ifeq:{{{prop|0}}}|0||
{{O|OnTakeDamage|activator = entity that caused the damage|Fired when damage is taken.}}<!--
-->{{#ifeq:{{{nohl2|0}}}|0|
{{O|OnPhysCannonAnimatePreStarted|activator = none|Fired when prop starts its <code>ACT_PHYSCANNON_ANIMATE_PRE</code> [[activity]]. Caused by the object being picked up by the gravity gun.}}
{{O|OnPhysCannonAnimatePullStarted|activator = none|Fired when prop has started its <code>ACT_PHYSCANNON_ANIMATE</code> activity. <code>ACT_PHYSCANNON_ANIMATE_PRE</code> plays once, then <code>ACT_PHYSCANNON_ANIMATE</code> starts looping.}}
{{O|OnPhysCannonDetach|activator = none|Fired when prop has started its <code>ACT_PHYSCANNON_DETACH</code> activity (caused by the gravity gun ripping it from a wall).}}
{{O|OnPhysCannonAnimatePostStarted|activator = none|Fired when prop has started its <code>ACT_PHYSCANNON_ANIMATE_POST</code> activity (caused by the player letting the prop go from the gravity gun).}}
{{O|OnPhysCannonPullAnimFinished|activator = none|Fired when prop has finished all gravity gun-related animations.}}
|}}
}}</onlyinclude>
 
</includeonly>
 
[[Category:Output Templates|Breakable]]

Latest revision as of 01:34, 22 April 2025

This template isn't in line with anything specific in code. Default shows only outputs for brushes.

  • prop=1 shows outputs for props as well. There's nothing brushes have that props don't have.
  • nohl2=1 hides the hl2-specific outputs.

The following is the result with no parameters. See also: {{O BreakableProp}}, {{O BreakableBrush}}.


BreakableProp:

OnBreak
!activator = entity that breaks the object
!caller = this entity
Fired when this object breaks.
OnHealthChanged <float>
!activator = entity that caused the health change
!caller = this entity
Fired whenever the health of the breakable has increased or decreased. This output automatically puts the new health amount as a decimal percent (e.g. 45% = 0.45) into the parameter box for inputs, if the mapper does not override the parameter with something else.
OnTakeDamage
!activator = entity that caused the damage
!caller = this entity
Fired when damage is taken.
OnPhysCannonAnimatePreStarted
!activator = none
!caller = this entity
Fired when prop starts its ACT_PHYSCANNON_ANIMATE_PRE activity. Caused by the object being picked up by the gravity gun.
OnPhysCannonAnimatePullStarted
!activator = none
!caller = this entity
Fired when prop has started its ACT_PHYSCANNON_ANIMATE activity. ACT_PHYSCANNON_ANIMATE_PRE plays once, then ACT_PHYSCANNON_ANIMATE starts looping.
OnPhysCannonDetach
!activator = none
!caller = this entity
Fired when prop has started its ACT_PHYSCANNON_DETACH activity (caused by the gravity gun ripping it from a wall).
OnPhysCannonAnimatePostStarted
!activator = none
!caller = this entity
Fired when prop has started its ACT_PHYSCANNON_ANIMATE_POST activity (caused by the player letting the prop go from the gravity gun).
OnPhysCannonPullAnimFinished
!activator = none
!caller = this entity
Fired when prop has finished all gravity gun-related animations.