User:Orin/Sandbox/Entity Additions: Difference between revisions

From SigMod
Jump to navigation Jump to search
(this is necessary)
 
m (quick hackjob)
 
(7 intermediate revisions by 2 users not shown)
Line 2: Line 2:


__NOEDITSECTION__
__NOEDITSECTION__
All entity-oriented feature additions from rafmod: Inputs, Outputs, Targetting, etc. are all documented here within their own heaps of lists.


To traverse this page, use the ''Table of Contents'' at the right side, or use the CTRL+F shortcut for your Browser.
<div style="float:right;clear:all;padding:0 1em;">__TOC__</div>
<div style="float:right;clear:all;padding:0 1em;">__TOC__</div>
All entity-oriented feature additions: Inputs, Outputs, Targetting, etc. are all documented within their own heaps of lists.
Note I/O inputs have two different type of parameters: <Required> and [Optional].
== I/O Expansions ==
== I/O Expansions ==
=== Targetname Prefixes ===
=== Targetname Prefixes ===
When targetting entities, adding prefixes of the format <code>@name1@</code> will instead target an entity relative to the given entity, usually by relationships.
When targetting entities, adding prefixes of the format <code>@name1@</code> will instead target an entity relative to the given entity, usually by relationships.
{| class="wikitable" style="margin-right:auto;"
{| class="wikitable" style="table-layout: fixed;"
! Prefix Syntax
! Prefix
! Description
! Description
|-
|-
Line 20: Line 22:
|-
|-
| <code>@bb<''vector'' mins> <''vector'' maxs>@<targetname></code>
| <code>@bb<''vector'' mins> <''vector'' maxs>@<targetname></code>
| Target ''all'' entiities within a [https://developer.valvesoftware.com/w/images/6/63/BoundingBoxMinsMaxs.png bounding box] relative to the given entity. Example: <code>@bb-100 -100 -100 100 100 100@prop_dynamic</code>.
| Target ''all'' entiities within a [https://developer.valvesoftware.com/wiki/Bounding_box bounding box] relative to the given entity. Example: <code>@bb-100 -100 -100 100 100 100@prop_dynamic</code>.
|}
|}


== Entities ==
=== Entity I/O Additions ===
=== [https://developer.valvesoftware.com/wiki/Point_viewcontrol point_viewcontrol] ===
==== <div style="font-size: 110%;">All Entities</div> ====
==== Inputs ====
 
{| class="wikitable" style="margin-right:auto;"
 
<b>Inputs</b>
{| class="wikitable" style="table-layout: fixed;"
! Input
! Input
! Description
! Description
|-
|-
| <code>$EnableAll,<none></code>
| <code>$FireUserAsActivator1-4 <string></code>
| Enable the camera for all players on the map.
| Acts like FireUser1-4, but the entity becomes the !activator and is passed as the parameter of OnUser1-4 output
: '''Warning:''' Spawmflag #512 may not do anything. (<code>Start At Player, Interruptable by Player</code>)
|-
|-
| <code>$EnableAll,<none></code>
| <code>$FireUser5-8 <string></code>
| Disable the camera for all players on the map
| Fires custom $OnUser5-8 output
|-
|-
| <code>$SetTarget,<entity></code>
| <code>$TakeDamage <int></code>
| Set current target to entity
| Take specified amount of damage
|-
| <code>$TakeDamageFromActivator <int></code>
| Take specified amount of damage, the !activator is the damage inflictor
|-
| <code>$SetModel <string></code>
| Set custom model
|-
| <code>$SetModelOverride <string></code>
| Set custom model, only changes the appearance
|-
| <code>$SetModelSpecial <string></code>
| Set custom model, in a special way, it does less additional changes to the entity
|-
| <code>$SetOwner <entity></code>
| Set entity owner
|-
| <code>$InheritOwner <entity></code>
| Set entity owner to the passed entity owner
|-
| <code>$InheritParent <entity></code>
| Set entity parent to the passed entity parent
|-
| <code>$GetKeyValue <string></code>
| Fire OnUser1 output, with key value as a parameter
|-
| <code>$MoveType <int>,<int></code>
| Set move type
|-
| <code>$PlaySound <string></code>
| Play sound from this entity
|-
| <code>$StopSound <string></code>
| Stop playing sound from this entity
|-
| <code>$SetLocalOrigin <vector></code>
| Set origin relative to parent
|-
| <code>$SetLocalAngles <vector></code>
| Set angles relative to parent
|-
| <code>$SetLocalVelocity <vector></code>
| Set velocity relative to parent
|-
| <code>$TeleportToEntity <entity></code>
| Teleport to specified entity
|-
| <code>$MoveRelative <vector></code>
| Move relative to parent (world)
|-
| <code>$RotateRelative <vector></code>
| Rotate relative to parent (world)
|-
| <code>SetKey$(keyvalue name) <string></code>
| Set keyvalue to specified value
|-
| <code>GetKey$(keyvalue name) <string></code>
| parameter format: entity|input|default value; example: !activator|$DisplayTextCenter|def<br>
Trigger the input of an entity, with keyvalue as a parameter (default value if not found)
|-
| <code>SetVar$(variable name) <string></code>
| Set custom entity variable
|-
| <code>GetVar$(variable name) <string></code>
| parameter format: entity|input|default value; example: !activator|$DisplayTextCenter|def<br>
Trigger the input of an entity, with variable as a parameter (default value if not found)
|-
| <code>SetData$([https://raw.githubusercontent.com/powerlord/tf2-data/master/datamaps.txt datamap] prop name) <string></code>
| Set datamap property to specified value
|-
| <code>GetData$([https://raw.githubusercontent.com/powerlord/tf2-data/master/datamaps.txt datamap] prop name) <string></code>
| parameter format: entity|input|default value; example: !activator|$DisplayTextCenter|def<br>
Trigger the input of an entity, with datamap prop as a parameter (default value if not found)
|-
| <code>SetProp$([https://raw.githubusercontent.com/powerlord/tf2-data/master/netprops.txt send prop] name) <string></code>
| Set send property to specified value
|-
| <code>GetProp$([https://raw.githubusercontent.com/powerlord/tf2-data/master/netprops.txt send prop] name) <string></code>
| parameter format: entity|input|default value; example: !activator|$DisplayTextCenter|def<br>
Trigger the input of an entity, with send prop as a parameter (default value if not found)
|}
 
<b>Outputs</b>
{| class="wikitable" style="table-layout:fixed;"
! Output
! Description
|-
| <code>$OnUser5-8 <string></code>
| Called when $FireUser5-8 input is used.
|-
| <code>$OnKilled</code>
| Fired when the entity is killed. The <code>!caller</code> entity will be inaccessible at this point.
|}
 
==== <div style="font-size:110%;">logic_case</u> ====
Redirects I/O in ways depending if a case's scenario has happened. [https://developer.valvesoftware.com/wiki/Logic_case VDC page]
 
For the inputs used in text formatting and menus, look at the [[#logic_case_2|Entity Expansions]] section.
 
<b>Inputs</b>
{| class="wikitable" style="table-layout: fixed;"
! Input
! Description
|-
| <code>$TestSigsegv</code>
| Dedicated for testing if the extension is successfully loaded. Fires <code>OnUser1</code> output.
|-
| <code>$ToFloat <any></code>
| Converts argument to float, or known as ''number''. Fires <code>OnDefault</code> output with result as parameter.
|-
| <code>$ToInt <any></code>
| Converts argument to integer, a ''number'' with no decimals. Fires <code>OnDefault</code> output with result as parameter.
|-
| <code>$GetConVar <string></code>
| Fetches a convar's (console variable) number value, but on two criterias: Having "replicated" flag, and not having a "protected" flag. If both pass, the <code>OnDefault</code> output fires with the parameter as the number value.
: ℹ️ '''Tip:''' The <code>help</code> concommand displays the flags of a convar.
|-
| <code>$GetConVarString <string></code>
| Identical to <code>$GetConVar</code>, but the fetched value is passed as a string.
|-
| <code>$CallerToActivator</code>
| Fires <code>OnDefault</code> output with <code>!activator</code> overriden as the entity in <code>!caller</code>.
|-
| <code>$GetKeyValueFromActivator <string></code>
| Grab value of a key from the <code>!activator</code> entity. Fires <code>OnDefault</code> output with result as parameter.
: 🛑 '''Superseded:''' Use <code>$GetKey$<keyvalue></code> input.
|}
|}


=== [https://developer.valvesoftware.com/wiki/Point_viewcontrol obj_sentrygun] (Sentry Gun) ===
==== <div style="font-size:110%;">point_viewcontrol</u> ====
==== Spawnflags ====
A camera entity capable to force the viewport of any desired players to use its own. [https://developer.valvesoftware.com/wiki/Point_viewcontrol VDC page]
 
<b>Inputs</b>
{| class="wikitable" style="table-layout: fixed;"
! Input
! Description
|-
| <code>$EnableAll</code>
| Enable the camera for all players on the map.<br>&nbsp;❗ '''Warning:''' Spawnflag #512 may not do anything. (<code>Start At Player, Interruptable by Player</code>)
|-
| <code>$DisableAll</code>
| Disable the camera for all players on the map.
|-
| <code>$SetTarget <entity></code>
| The entity that the camera should point to.
|}
 
==== <div style="font-size:110%;">tank_boss</u> ====
The big sluggish Tank robot. [https://developer.valvesoftware.com/wiki/Tank_boss VDC page]
 
<b>Outputs</b>
{| class="wikitable" style="table-layout:fixed;"
! Output
! Description
|-
| <code>$OnStartDeploy</code>
| Fired when the tank is deploying the bomb if a condition is fulfilled:
* Using <code>"spawnflags" "1"</code>
* Giving the Tank a <code>PointTemplate</code>.
|}
 
== Entity Expansions ==
=== obj_sentrygun ===
The Sentry Gun, one of Engineer's buildings. [https://developer.valvesoftware.com/wiki/Obj_sentrygun VDC page]<br>
<b>Spawnflags</b>
* '''[64]''' - Spawn as mini-sentry
* '''[64]''' - Spawn as mini-sentry


=== [https://developer.valvesoftware.com/wiki/Tf_point_weapon_mimic tf_point_weapon_mimic] (Weapon Mimic) ===
=== tf_point_weapon_mimic ===
==== General ====
An entity that mimics firing of various projectiles, as if a player shot the projectile. [https://developer.valvesoftware.com/wiki/Tf_point_weapon_mimic VDC page]<br>
# Added projectile type 4 - Bullet.
<b>Miscellaneous</b><br><br>
## <code>SpeedMax</code> keyvalue determines max distance (infinite if not specified).
'''>''' Killing the mimic entity now automatically removes all of its Stickybombs.<br>
## <code>SplashRadius</code> determines knockback force.
'''>''' Setting an owner with <code>$SetOwner</code> or <code>$InheritOwner</code> will assign the same owner to fired projectiles are assigned the same owner.<br>
# Shot projectiles are now team-assignable with <code>teamnum</code> keyvalue (2 for RED, 3 for BLU).
'''>''' Mimic can shoot bullets if <code>WeaponType</code> is set to 4. It can be customised with these keyvalues:
## Previously they're always of BLU team.
:'''>''' <code>SpeedMax</code> - max distance (infinite if not specified).
# If a player owner is set with <code>$SetOwner</code> or <code>$InheritOwner</code>, fired projectiles are assigned the same owner.
:'''>''' <code>SplashRadius</code> - knockback force.
# Stickybombs are automatically removed if the mimic is killed.
'''>''' If <code>teamnum</code> keyvalue is used, shot projectiles will be assigned a team. (Previously it was always team 3, BLU)
 
:'''>''' 2 for RED, 3 for BLU.
==== Spawnflags ====
<b>Spawnflags</b>
* '''[1]''' - Shot projectile callback; fires the <code>OnUser4</code> output whenever a projectile is shot, with <code>!activator</code> as the projectile.
* '''[1]''' - Shot projectile callback; fires the <code>OnUser4</code> output whenever a projectile is shot, with <code>!activator</code> as the projectile.
* '''[2]''' - Allow the keyvalues "''FireSound''" and "''ParticleEffect''" to have functionality.
* '''[2]''' - Allow the keyvalues "''FireSound''" and "''ParticleEffect''" to have functionality.


=== Tank (tank_boss) ===
=== Tank (tank_boss) ===
* When a tank with <code>PointTemplate</code>(s) starts deploying, "OnUser4" output is fired.
'''>''' When a tank with <code>PointTemplate</code>(s) starts deploying, "OnUser4" output is fired.
==== Outputs ====
{| class="wikitable" style="margin-right:auto;"
! Name
! Syntax
! Description
|-
| <code>OnStartDeploy,<none></code>
| Fired when the tank is deploying the bomb
|}


=== Medic shield (entity_medigun_shield) ===
=== Medic shield (entity_medigun_shield) ===
==== Spawnflags ====
<b>Spawnflags</b>
* '''[1]''' - Never expire, and don't block LOS
* '''[1]''' - Never expire, and don't block LOS
* '''[2]''' - Spawn as LV2 Shield
* '''[2]''' - Spawn as LV2 Shield


=== logic_case ===
=== logic_case ===
==== Text formatter ====
==== <div style="font-size:110%;">Text formatter</div> ====
With the use of the added inputs, logic_case can be transformed into a text formatter, replacing % in the format string into format parameters.
With the use of the added inputs, logic_case can be transformed into a text formatter, replacing % in the format string into format parameters.


Line 101: Line 254:
</syntaxhighlight>This would display "You have 6 out of 12 coins left. 50 % done" to all players
</syntaxhighlight>This would display "You have 6 out of 12 coins left. 50 % done" to all players


==== Menus ====
<b>Inputs</b>
You can use $DisplayMenu input to display a menu for the player, up to 15 entries<syntaxhighlight lang="php">
{| class="wikitable" style="table-layout: fixed;"
! Output
! Description
|-
| <code>$Format</code>
| Start a string format. When finished, fires <code>OnDefault</code> output with the formatted string as parameter.
|-
| <code>$FormatInput1-15 <string></code>
| Sets a respective formatting input's argument, then starts a string format.
|-
| <code>$FormatInputNoFire1-15 <string></code>
| Functionally, its <code>$FormatInput1-15</code> without starting a string format.
|-
| <code>$FormatString <string></code>
| Sets the string to be used in formatting, then starts a string format.
|-
| <code>$FormatStringNoFire <string></code>
| Functionally, its <code>$FormatString</code> without starting a string format.
|}
 
==== <div style="font-size:110%;">Menus</div> ====
Sourcemod Menus are displayed using the <code>$DisplayMenu</code> input.
 
<code>Case16</code> title, <code>Case01-15</code> choices.
 
Example: <syntaxhighlight lang="php">
Menu
Menu
{
{
Line 125: Line 303:
</syntaxhighlight>
</syntaxhighlight>


==== Inputs ====
<b>Inputs</b>
 
{| class="wikitable" style="table-layout: fixed;"
* $FormatString <string>
! Output
** Sets formatting string, then fires OnDefault output, with formatted string as parameter
! Description
* $FormatStringNoFire <string>
|-
** Sets formatting string
| <code>$DisplayMenu <entity></code>
* $FormatInput1 <string>
| Start displaying a menu to the player entity.
** Sets formatting input argument 1, then fires OnDefault output, with formatted string as parameter
|-
* $FormatInput2-15 <string>
| <code>$HideMenu <entity></code>
** Sets formatting input argument 2-15, then fires OnDefault output, with formatted string as parameter
| Forcefully hide the player's menu.
* $FormatInputNoFire1 <string>
|}
** Sets formatting input argument 1
* $Format
** Fires OnDefault output, with formatted string as parameter
* $TestSigsegv
** Fires OnUser1 output. Can be used to test if sigsegv extension is active
* $ToInt <any>
** Fires OnDefault output, converts parameter value from string/float to integer
* $ToFloat <any>
** Fires OnDefault output, converts value from string/int to real number
* $CallerToActivator <any>
** Fires OnDefault output, but the !caller entity is converted to !activator
* $GetKeyValueFromActivator <string>
** Fires OnDefault output, the key value from the !activator entity is the parameter
* $GetConVar <string>
** Fires OnDefault output, the convar (console variable) number value is the parameter
* $GetConVarString <string>
** Fires OnDefault output, the convar (console variable) string value is the parameter
*$DisplayMenu <entity>
**Display menu at player
*$HideMenu <entity>
**Hide menu at player


== tf_gamerules ==
== tf_gamerules ==
Line 281: Line 438:
== game_ui ==
== game_ui ==
The server will no longer crash if the player using the entity disconnected from the server
The server will no longer crash if the player using the entity disconnected from the server
== $filter_keyvalue ==
Custom filter that lets you filter entities matching the key value. Shares inputs with [https://developer.valvesoftware.com/wiki/Filter_base filter_base] entity
=== Keyvalues ===
* $name <string>
** Name of the key to compare, example: health
* $value <any>
** Value to compare against
* $compare <string>
** The condition for passing the filter (default: equal). Should only be set for numeric values
** Possible values:
*** equal
*** less than
*** greater than
*** less than or equal
*** greater than or equal
== $filter_variable ==
Custom filter that lets you filter entities matching the custom entity variable (declared by firing $SetVar$variablename input of the entity). Shares inputs with [https://developer.valvesoftware.com/wiki/Filter_base filter_base] entity
=== Keyvalues ===
* $name <string>
** Name of the variable to compare, example: myvar
* $value <any>
** Value to compare against
* $compare <string>
** The condition for passing the filter (default: equal). Should only be set for numeric values
** Possible values:
*** equal
*** less than
*** greater than
*** less than or equal
*** greater than or equal
== $filter_datamap ==
Custom filter that lets you filter entities matching the [https://raw.githubusercontent.com/powerlord/tf2-data/master/datamaps.txt datamap] prop. Shares inputs with [https://developer.valvesoftware.com/wiki/Filter_base filter_base] entity
=== Keyvalues ===
* $name <string>
** Name of the variable to compare, example: m_iHealth
* $value <any>
** Value to compare against
* $compare <string>
** The condition for passing the filter (default: equal). Should only be set for numeric values
** Possible values:
*** equal
*** less than
*** greater than
*** less than or equal
*** greater than or equal
== $filter_prop ==
Custom filter that lets you filter entities matching the [https://raw.githubusercontent.com/powerlord/tf2-data/master/netprops.txt send prop]. Shares inputs with [https://developer.valvesoftware.com/wiki/Filter_base filter_base] entity
=== Keyvalues ===
* $name <string>
** Name of the variable to compare, example: m_nCurrency
* $value <any>
** Value to compare against
* $compare <string>
** The condition for passing the filter (default: equal). Should only be set for numeric values
** Possible values:
*** equal
*** less than
*** greater than
*** less than or equal
*** greater than or equal
== All entities ==
=== Inputs ===
* $FireUserAsActivator1-4 <string>
** Acts like FireUser1-4, but the entity becomes the !activator, and the parameter is passed in OnUser1-4 output
*$FireUser5-8 <string>
** Fires custom $onuser5-8 output
* $TakeDamage <int>
** Take specified amount of damage
* $TakeDamageFromActivator <int>
** Take specified amount of damage, the !activator is the damage inflictor
* $SetModel <string>
** Set custom model
* $SetModelOverride <string>
** Set custom model, only changes the appearence
* $SetModelSpecial <string>
** Set custom model, in a special way, it does less additional changes to the entity
* $SetOwner <entity>
** Set entity owner
* $InheritOwner <entity>
** Set entity owner to the passed entity owner
* $InheritParent <entity>
** Set entity parent to the passed entity parent
* $GetKeyValue <string>
** Fire OnUser1 output, with key value as a parameter
* $MoveType <int>,<int>
** Set move type
* $PlaySound <string>
** Play sound from this entity
* $StopSound <string>
** Stop playing sound from this entity
* $SetLocalOrigin <vector>
** Set origin relative to parent
* $SetLocalAngles <vector>
** Set angles relative to parent
* $SetLocalVelocity <vector>
** Set velocity relative to parent
* $TeleportToEntity <entity>
** Teleport to specified entity
* $MoveRelative <vector>
** Move relative to parent (world)
* $RotateRelative <vector>
** Rotate relative to parent (world)
*$SetKey$(keyvalue name) <string>
**Set keyvalue to specified value
*$GetKey$(keyvalue name) <string>
**parameter format: entity|input|default value
**example: !activator|$DisplayTextCenter|def
**Trigger the input of an entity, with keyvalue as a paramer (default value if not found)
*$SetVar$(variable name) <string>
**Set custom entity variable
*$GetVar$(variable name) <string>
**parameter format: entity|input|default value
**example: !activator|$DisplayTextCenter|def
**Trigger the input of an entity, with variable as a paramer (default value if not found)
*$SetData$([https://raw.githubusercontent.com/powerlord/tf2-data/master/datamaps.txt datamap] prop name) <string>
**Set datamap property to specified value
*$GetData$([https://raw.githubusercontent.com/powerlord/tf2-data/master/datamaps.txt datamap] prop name) <string>
**parameter format: entity|input|default value
**example: !activator|$DisplayTextCenter|def
**Trigger the input of an entity, with datamap prop as a paramer (default value if not found)
*$SetProp$([https://raw.githubusercontent.com/powerlord/tf2-data/master/netprops.txt send prop] name) <string>
**Set send property to specified value
*$GetProp$([https://raw.githubusercontent.com/powerlord/tf2-data/master/netprops.txt send prop] name) <string>
**parameter format: entity|input|default value
**example: !activator|$DisplayTextCenter|def
**Trigger the input of an entity, with send prop as a paramer (default value if not found)
=== Outputs ===
* $OnUser5-8 <string>
** Called when $FireUser5-8 input is used
* $OnKilled
** Fired when the entity is killed. The calling entity no longer exist and cannot be accessed

Latest revision as of 05:30, 14 December 2021

WIP. Feel free to edit, but don't paste anything from here into the main page without my consent. If you have anything that needs to go there, edit it there.


All entity-oriented feature additions: Inputs, Outputs, Targetting, etc. are all documented within their own heaps of lists.

Note I/O inputs have two different type of parameters: <Required> and [Optional].

I/O Expansions

Targetname Prefixes

When targetting entities, adding prefixes of the format @name1@ will instead target an entity relative to the given entity, usually by relationships.

Prefix Description
@p@<targetname> Targets the parent of an entity. Example: @p@!activator.
@c@<targetname> Targets the child of an entity. Example: @c@!activator.
@bb<vector mins> <vector maxs>@<targetname> Target all entiities within a bounding box relative to the given entity. Example: @bb-100 -100 -100 100 100 100@prop_dynamic.

Entity I/O Additions

All Entities

Inputs

Input Description
$FireUserAsActivator1-4 <string> Acts like FireUser1-4, but the entity becomes the !activator and is passed as the parameter of OnUser1-4 output
$FireUser5-8 <string> Fires custom $OnUser5-8 output
$TakeDamage <int> Take specified amount of damage
$TakeDamageFromActivator <int> Take specified amount of damage, the !activator is the damage inflictor
$SetModel <string> Set custom model
$SetModelOverride <string> Set custom model, only changes the appearance
$SetModelSpecial <string> Set custom model, in a special way, it does less additional changes to the entity
$SetOwner <entity> Set entity owner
$InheritOwner <entity> Set entity owner to the passed entity owner
$InheritParent <entity> Set entity parent to the passed entity parent
$GetKeyValue <string> Fire OnUser1 output, with key value as a parameter
$MoveType <int>,<int> Set move type
$PlaySound <string> Play sound from this entity
$StopSound <string> Stop playing sound from this entity
$SetLocalOrigin <vector> Set origin relative to parent
$SetLocalAngles <vector> Set angles relative to parent
$SetLocalVelocity <vector> Set velocity relative to parent
$TeleportToEntity <entity> Teleport to specified entity
$MoveRelative <vector> Move relative to parent (world)
$RotateRelative <vector> Rotate relative to parent (world)
SetKey$(keyvalue name) <string> Set keyvalue to specified value
GetKey$(keyvalue name) <string> input|default value; example: !activator|$DisplayTextCenter|def

Trigger the input of an entity, with keyvalue as a parameter (default value if not found)

SetVar$(variable name) <string> Set custom entity variable
GetVar$(variable name) <string> input|default value; example: !activator|$DisplayTextCenter|def

Trigger the input of an entity, with variable as a parameter (default value if not found)

SetData$(datamap prop name) <string> Set datamap property to specified value
GetData$(datamap prop name) <string> input|default value; example: !activator|$DisplayTextCenter|def

Trigger the input of an entity, with datamap prop as a parameter (default value if not found)

SetProp$(send prop name) <string> Set send property to specified value
GetProp$(send prop name) <string> input|default value; example: !activator|$DisplayTextCenter|def

Trigger the input of an entity, with send prop as a parameter (default value if not found)

Outputs

Output Description
$OnUser5-8 <string> Called when $FireUser5-8 input is used.
$OnKilled Fired when the entity is killed. The !caller entity will be inaccessible at this point.

logic_case

Redirects I/O in ways depending if a case's scenario has happened. VDC page

For the inputs used in text formatting and menus, look at the Entity Expansions section.

Inputs

Input Description
$TestSigsegv Dedicated for testing if the extension is successfully loaded. Fires OnUser1 output.
$ToFloat <any> Converts argument to float, or known as number. Fires OnDefault output with result as parameter.
$ToInt <any> Converts argument to integer, a number with no decimals. Fires OnDefault output with result as parameter.
$GetConVar <string> Fetches a convar's (console variable) number value, but on two criterias: Having "replicated" flag, and not having a "protected" flag. If both pass, the OnDefault output fires with the parameter as the number value.
ℹ️ Tip: The help concommand displays the flags of a convar.
$GetConVarString <string> Identical to $GetConVar, but the fetched value is passed as a string.
$CallerToActivator Fires OnDefault output with !activator overriden as the entity in !caller.
$GetKeyValueFromActivator <string> Grab value of a key from the !activator entity. Fires OnDefault output with result as parameter.
🛑 Superseded: Use $GetKey$<keyvalue> input.

point_viewcontrol

A camera entity capable to force the viewport of any desired players to use its own. VDC page

Inputs

Input Description
$EnableAll Enable the camera for all players on the map.
 ❗ Warning: Spawnflag #512 may not do anything. (Start At Player, Interruptable by Player)
$DisableAll Disable the camera for all players on the map.
$SetTarget <entity> The entity that the camera should point to.

tank_boss

The big sluggish Tank robot. VDC page

Outputs

Output Description
$OnStartDeploy Fired when the tank is deploying the bomb if a condition is fulfilled:
  • Using "spawnflags" "1"
  • Giving the Tank a PointTemplate.

Entity Expansions

obj_sentrygun

The Sentry Gun, one of Engineer's buildings. VDC page
Spawnflags

  • [64] - Spawn as mini-sentry

tf_point_weapon_mimic

An entity that mimics firing of various projectiles, as if a player shot the projectile. VDC page
Miscellaneous

> Killing the mimic entity now automatically removes all of its Stickybombs.
> Setting an owner with $SetOwner or $InheritOwner will assign the same owner to fired projectiles are assigned the same owner.
> Mimic can shoot bullets if WeaponType is set to 4. It can be customised with these keyvalues:

> SpeedMax - max distance (infinite if not specified).
> SplashRadius - knockback force.

> If teamnum keyvalue is used, shot projectiles will be assigned a team. (Previously it was always team 3, BLU)

> 2 for RED, 3 for BLU.

Spawnflags

  • [1] - Shot projectile callback; fires the OnUser4 output whenever a projectile is shot, with !activator as the projectile.
  • [2] - Allow the keyvalues "FireSound" and "ParticleEffect" to have functionality.

Tank (tank_boss)

> When a tank with PointTemplate(s) starts deploying, "OnUser4" output is fired.

Medic shield (entity_medigun_shield)

Spawnflags

  • [1] - Never expire, and don't block LOS
  • [2] - Spawn as LV2 Shield

logic_case

Text formatter

With the use of the added inputs, logic_case can be transformed into a text formatter, replacing % in the format string into format parameters.

Example point template usage:

Formatter
{
	OnSpawnOutput
	{
		Target "formattest"
		Action "$Format"
		Delay 1
	}
	logic_case
	{
		"targetname" "formattest"
		"case16" "You have % out of % coins left. % %% done" // Formatter string
		"case01" "6" //First argument
		"case02" "12" //Second argument
		"case03" "50" //Third argument
		"ondefault" "player,$DisplayTextCenter,,0,-1"
	}
}

This would display "You have 6 out of 12 coins left. 50 % done" to all players

Inputs

Output Description
$Format Start a string format. When finished, fires OnDefault output with the formatted string as parameter.
$FormatInput1-15 <string> Sets a respective formatting input's argument, then starts a string format.
$FormatInputNoFire1-15 <string> Functionally, its $FormatInput1-15 without starting a string format.
$FormatString <string> Sets the string to be used in formatting, then starts a string format.
$FormatStringNoFire <string> Functionally, its $FormatString without starting a string format.

Menus

Sourcemod Menus are displayed using the $DisplayMenu input.

Case16 title, Case01-15 choices.

Example:

Menu
{
	OnSpawnOutput
	{
		Target "menutest"
		Action "$DisplayMenu"
		Delay 1
		Param "player"
	}
	logic_case
	{
		"targetname" "menutest"
		"case16" "Menu title|30|Cancel" // Title, menu duration (0 for infinite), display optional cancel button
		"case01" "option1" //First argument
		"case02" "!disabled option" //Second argument, disabled
		"case03" "suicide" //Third argument
		"oncase03" "!activator,sethealth,0,0,-1" // Selected 3rd option
		"ondefault" "player,$DisplayTextCenter,he,0,-1" // No option selected
	}
}

Inputs

Output Description
$DisplayMenu <entity> Start displaying a menu to the player entity.
$HideMenu <entity> Forcefully hide the player's menu.

tf_gamerules

Inputs

  • $StopVO <string>
    • Stops sound that was started with PlayVO input
  • $StopVORed <string>
    • Stops sound that was started with PlayVORed input
  • $StopVOBlue <string>
    • Stops sound that was started with PlayVOBlue input
  • $SetBossHealthPercentage <float>
    • Set Halloween boss bar percentage to a value between 0 and 1. 0 hides the health bar, any other value makes the bar appear
  • $SetBossState <int>
    • If set to 1, makes the health bar green, like if Merasmus is hiding. If set to 0, the bar goes back to normal
  • $AddCurrencyGlobal <int>
    • Add currency to all players

player

Inputs

  • $AllowClassAnimations <0|1>
    • Allow class animations instead of using refpose when UseCustomModel input is fired to change player model
  • $SwitchClass <string>
    • Switch player class. The parameter can be either a class name (heavyweapons for example), or class index
  • $SwitchClassInPlace <string>
    • Switch player class in current position. The parameter can be either a class name (heavyweapons for example), or class index
  • $ForceRespawn
    • The player instantly respawns
  • $ForceRespawnDead
    • The player instantly respawns, but only if they are dead
  • $DisplayTextCenter <string>
    • Display text in the middle of the screen
  • $DisplayTextChat <string>
    • Display text to the player's chat
  • $Suicide
    • Kill the player
  • $ChangeAttributes <string>
    • If the player is a bot, this can be used to change active EventChangeAttributes
  • $RollCommonSpell
    • Roll common spell
  • $SetSpell <string>
    • Set player current spell to one of the following:
      • Fireball
      • Ball O' Bats
      • Healing Aura
      • Pumpkin MIRV
      • Superjump
      • Invisibility
      • Teleport
      • Tesla Bolt
      • Minify
      • Meteor Shower
      • Summon Monoculus
      • Summon Skeletons
  • $AddSpell <string>
    • Adds spell to the number of spells. If the spell is different than the current one, it replaces the spell. The parameter is the same as in $SetSpell
  • $AddCond <int> [int]
    • Add condition to player. If a second argument is present, the condition will only run for a specified duration
  • $RemoveCond <int>
    • Remove condition from player
  • $AddPlayerAttribute <string>
    • Add attribute to player, the parameter should be passed in this way: attribute|value. Example: "move speed bonus|1.2"
  • $RemovePlayerAttribute <string>
    • Remove attribute from player. Example: "move speed bonus"
  • $AddItemAttribute <string>
    • Add attribute to item in slot, the parameter should be passed in this way: attribute|value|slot. Example "damage bonus|2|0" adds 100% damage bonus to primary weapon
  • $RemoveItemAttribute <string>
    • Remove attribute from item in slot, the parameter should be passed in this way: attribute|slot. Example "damage bonus|0" removes damage bonus from primary weapon
  • $PlaySoundToSelf <string>
    • Play sound to the player
  • $IgnitePlayerDuration <float>
    • Ignite the player for a specified duration in seconds
  • $WeaponSwitchSlot <int>
    • Forcibly switches to weapon in slot
  • $WeaponStripSlot <int>
    • Removes weapon from a slot (-1 = current slot)
  • $GiveItem <string>
    • Gives an item to the player
  • $AddCurrency <int>
    • Add currency to the player
  • $RemoveCurrency <int>
    • Remove currency from the player
  • $SetCurrency <int>
    • Set currency to specified value
  • $CurrencyOutputX <string>
    • Fires input if player currency is above specified value (the X in input name), the attribute should be passed in this way: target,input,parameter.
  • $CurrencyInvertOutputX<string>
    • Fires input if player currency is below specified value(the X in input name), the attribute should be passed in this way: target,input,parameter
  • $DropItem <int>
    • Drop item in slot (-1 = current slot)
  • $RemoveItem <string>
    • Remove item with a name
  • $Regenerate
    • Regenerate the player, as if touching resupply cabinet
  • $RefillAmmo
    • Restore player ammo

trigger_hurt

If entity owner is set with $SetOwner or $InheritOwner, the owner will become the damage inflictor

Filter entities

The server will no longer crash if the activator entity got removed the time TestActivator is called

Inputs

  • $TestEntity <entity>
    • Test any entity, rather than only the !activator

Trigger entities

The server will no longer crash if the caller entity got removed the time StartTouch or EndTouch is called

Inputs

  • $StartTouchEntity <entity>
    • StartTouch any entity, rather than only the !caller
  • $EndTouchEntity <entity>
    • EndTouch any entity, rather than only the !caller

game_ui

The server will no longer crash if the player using the entity disconnected from the server