Func buyzone: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Updated)
(updates)
Line 1: Line 1:
{{base brush multi|func_buyzone|game1=Counter-Strike: Source|game2=Counter-Strike: Global Offensive}}
{{lang|Func buyzone}}
{{base brush multi|func_buyzone|game1=Counter-Strike: Source|game2=Counter-Strike: Global Offensive}} It is used to define the "Buy Zones" used by players to purchase weapons and equipment.


==Entity description==
{{code class|CBuyZone|func_buy_zone.cpp}}
It is used to define the "Buy Zones" used by Terrorists and Counter-Terrorists in the game to purchase their weapons and equipment.


== Keyvalues==
==Keyvalues==
{{KV Targetname}}
{{KV|Team number (int) (TeamNum)|int|The team that can use the buyzone.}}
{{KV|Team number|int|The team that can use the buyzone. (Default is "0")}}
:{| class=standard-table
:{| class=standard-table
!| Value || Description
!| Value || Description
|-
|-
| 0 || None
| -1 || None{{csgo}}
|-
|-
| 1 || All Teams
| 0 || None{{css}} All Teams{{csgo}}
|-
| 1 || All Teams{{css}} Unassigned?{{csgo}}
|-
|-
| 2 || Terrorist
| 2 || Terrorist
Line 18: Line 19:
| 3 || Counter-Terrorist
| 3 || Counter-Terrorist
|}
|}
{{KV BaseTrigger}}
{{KV BaseEntity|brush=1}}


==Inputs==
==Inputs==
{{I Trigger}}
{{IO|SetTeam_TerroristOnly|since=CSGO|Restrict buyzone to terrorists only.}}
{{IO|SetTeam_CTOnly|since=CSGO|Restrict buyzone to counter-terrorists only.}}
{{IO|SetTeam_AllTeams|since=CSGO|Allows all teams to use the buyzone.}}
{{IO|SetTeam_None|since=CSGO|Allows no team to use the buyzone, effectively disabling it. {{todo|Does this actually behave different from <code>Disable</code> in any way?}}}}
{{I BaseTrigger|notf2=1}}
{{I BaseEntity}}


==Outputs==
==Outputs==
{{I Trigger}}
{{O BaseTrigger}}
{{O BaseEntity}}

Revision as of 04:31, 6 October 2018

English (en)Translate (Translate)

Template:Base brush multi It is used to define the "Buy Zones" used by players to purchase weapons and equipment.

C++ In code, it is represented by theCBuyZoneclass, defined in thefunc_buy_zone.cppfile.

Keyvalues

Team number (int) (TeamNum) ([todo internal name (i)]) <integer>
The team that can use the buyzone.
Value Description
-1 NoneCounter-Strike: Global Offensive
0 NoneCounter-Strike: Source All TeamsCounter-Strike: Global Offensive
1 All TeamsCounter-Strike: Source Unassigned?Counter-Strike: Global Offensive
2 Terrorist
3 Counter-Terrorist
BaseTrigger
Filter Name (filtername) <filter>
A filter entity to test potential activators against.
Start Disabled (StartDisabled) <boolean>
Stay dormant until activated (with theEnableinput).


Inputs

SetTeam_TerroristOnly  (in all games since Counter-Strike: Global Offensive)
Restrict buyzone to terrorists only.
SetTeam_CTOnly  (in all games since Counter-Strike: Global Offensive)
Restrict buyzone to counter-terrorists only.
SetTeam_AllTeams  (in all games since Counter-Strike: Global Offensive)
Allows all teams to use the buyzone.
SetTeam_None  (in all games since Counter-Strike: Global Offensive)
Allows no team to use the buyzone, effectively disabling it.
Todo: Does this actually behave different from Disable in any way?
BaseTrigger
Toggle
Toggles this trigger between enabled and disabled states.
Enable
Enable trigger
Disable
Disable trigger
TouchTest  (in all games since Source 2007)
Triggers either the OnTouching or OnNotTouching outputs for whether anything is touching this entity.
Icon-Bug.pngBug:Sleeping prop_physics will never fire "OnTouching". Also applies to entities using prop_physics as base.  (tested in: Half-Life 2)
StartTouch  (in all games since Source 2007) !FGD
Behave as if the !caller entity had just entered the trigger volume. Accepts non-physical entities.
EndTouch  (in all games since Source 2007) !FGD
Behave as if !caller had just exited the trigger volume.
DisableAndEndTouch  (only in Source 2013 MultiplayerTeam Fortress 2 branch)
Disables this trigger and calls EndTouch on all currently-touching entities.


Outputs

BaseTrigger
OnStartTouch
!activator = entity that caused this output
!caller = this entity
Fired when a valid entity starts touching this trigger.
OnStartTouchAll
!activator = entity that caused this output
!caller = this entity
Fired when a valid entity starts touching this trigger, and no other entities are touching it. If there are any other entities touching the trigger when a new one begins to touch, only OnStartTouch will fire.
OnEndTouch
!activator = entity that caused this output
!caller = this entity
Fired when a valid entity stops touching this trigger.
Note.pngNote:Will also fire for entities touching it when trigger is disabled via Disable input
Warning.pngWarning:This includes entities which are deleted while inside the trigger. In this case !activator will be invalid.
Warning.pngWarning:OnEndTouch can fire before OnStartTouch under certain circumstances[How?] where both are fired on the same tick and each have the same delay.
Note.pngFix:Add a slight delay to OnEndTouch.
OnEndTouchAll
!activator = entity that caused this output
!caller = this entity
Fired when all valid entities stop touching this trigger.
OnTouching  (in all games since Source 2007)
!activator = !caller = this entity
Fired if something is currently touching this trigger when TouchTest is fired.
OnNotTouching  (in all games since Source 2007)
!activator = !caller = this entity
Fired if nothing is currently touching this trigger when TouchTest is fired.