Skip to content

Commit 9be5039

Browse files
committed
Implement basic I/O docs
1 parent 3734748 commit 9be5039

6 files changed

Lines changed: 176 additions & 7 deletions

File tree

_includes/ent_io.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
{% if include.type %}
44
<span class="ent_kv_intn">&lt;{{ include.type }}&gt;</span>
55
{% endif %}
6+
{% if include.from %}
7+
<span class="ent_kv_io_name"><I>(from {{ include.from }})</I></span>
8+
{% endif %}
69
<br>
710
{% if include.desc %}
811
<span class="ent_kv_desc">{{ include.desc }}</span>

docs.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ header-center: true
1818

1919
<div class="feature_list" style="margin:0px auto;">
2020

21-
{% include docs_feature_wip.html url="iokv" text="I/O/KV" desc="New Inputs, Outputs, and KeyValues added to existing entities." icon="assets/entities/iokv01.png" bg="../assets/dev_measuregeneric_purple01.jpg" %}
21+
{% include docs_feature_button.html url="iokv" text="I/O/KV" desc="New Inputs, Outputs, and KeyValues added to existing entities." icon="assets/entities/iokv01.png" bg="../assets/dev_measuregeneric_purple01.jpg" %}
2222
{% include docs_feature_button.html url="utils" text="Utilities" desc="Miscellaneous quality-of-life tools." icon="assets/entities/game_menu.png" bg="../assets/dev_measuregeneric_purple01.jpg" %}
2323
{% include docs_feature_button.html url="game-scripts" text="Game Scripts" desc="Changes to scripts in the game files." icon="assets/entities/game_menu.png" bg="../assets/dev_measuregeneric_purple01.jpg" %}
2424
{% include docs_feature_wip.html url="visuals" text="Visuals" desc="Visual or rendering features." icon="assets/entities/game_menu.png" bg="../assets/dev_measuregeneric_purple01.jpg" %}

docs/iokv.markdown

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: article
3-
title: Utilities
3+
title: I/O/KV
44
permalink: /docs/iokv/
55
breadcrumb: true
66
---
@@ -9,11 +9,11 @@ This category covers the different types of new Inputs, Outputs, and KeyValues a
99

1010
<div class="feature_list" style="margin:0px auto;">
1111

12-
{% include docs_feature_button.html url="logical" text="Logical I/O" desc="Inputs and outputs that aid in map logic." icon="assets/entities/math_mod.png" bg="../assets/docs/feature_logicalio_bg.jpg" %}
13-
{% include docs_feature_button.html url="visual" text="Visual I/KV" desc="Inputs and keyvalues that provide control over visuals." icon="assets/entities/game_menu.png" bg="../assets/dev_measuregeneric_purple01.jpg" %}
14-
{% include docs_feature_button.html url="gameplay" text="Gameplay I/O/KV" desc="Inputs, outputs, and keyvalues that change how entities behave in-game." icon="assets/entities/game_menu.png" bg="../assets/website_bg.jpg" %}
15-
{% include docs_feature_button.html url="player" text="Player I/O/KV" desc="Inputs, outputs, and keyvalues that affect players." icon="assets/entities/game_menu.png" bg="../assets/website_bg.jpg" %}
16-
{% include docs_feature_button.html url="npc" text="NPC I/O/KV" desc="Inputs, outputs, and keyvalues that affect NPCs." icon="assets/entities/game_menu.png" bg="../assets/website_bg.jpg" %}
12+
{% include docs_feature_button.html url="logical" text="Logical I/O" desc="Inputs and outputs that aid in map logic." icon="assets/entities/math_mod.png" bg="../../assets/docs/feature_logicalio_bg.jpg" %}
13+
{% include docs_feature_button.html url="visual" text="Visual I/KV" desc="Inputs and keyvalues that provide control over visuals." icon="assets/docs/feature_visuals_icon.png" bg="../../assets/dev_measuregeneric_purple01.jpg" %}
14+
{% include docs_feature_button.html url="gameplay" text="Gameplay I/O/KV" desc="Inputs, outputs, and keyvalues that change how entities behave in-game." icon="assets/entities/game_menu.png" bg="../../assets/website_bg.jpg" %}
15+
{% include docs_feature_wip.html url="player" text="Player I/O/KV" desc="Inputs, outputs, and keyvalues that affect players." icon="assets/entities/game_menu.png" bg="../../assets/website_bg.jpg" %}
16+
{% include docs_feature_wip.html url="npc" text="NPC I/O/KV" desc="Inputs, outputs, and keyvalues that affect NPCs." icon="assets/entities/game_menu.png" bg="../../assets/website_bg.jpg" %}
1717
<div style="clear: left;"></div>
1818

1919
</div>

docs/iokv/gameplay.markdown

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
layout: article
3+
title: Gameplay I/O
4+
permalink: /docs/iokv/gameplay/
5+
breadcrumb: true
6+
---
7+
8+
### Inputs
9+
{% include ent_io.html name="SetTarget" desc="A special new input designed to change an entity's \"target\", including things like <code>path_track</code> paths and <code>env_gunfire</code> targets. By default, this changes the common target keyvalue on entities. Some entities override <code>SetTarget</code> for their own keyvalues, e.g. <code>scripted_sequence</code>'s target NPC. In code, this also calls <code>Activate()</code>, which is commonly used to assign <code>m_target</code> to cached entity handles." type="targetname" %}
10+
{% include ent_io.html name="SetOwnerEntity" desc="Sets this entity's \"owner entity\". Owner entities are mainly used for kill credit, and entities will typically never collide with their owner entity. Note that this has nothing to do with parenting." type="targetname" %}
11+
12+
{% include ent_io.html name="FreeChildren" desc="Unparents all entities parented to this entity in a movement hierarchy." type="void" %}
13+
14+
{% include ent_io.html name="SetLocalOrigin" desc="Sets this entity's origin in local space, relative to its parent if one exists. Otherwise relative to the world." type="vector" %}
15+
{% include ent_io.html name="SetLocalAngles" desc="Sets this entity's angles in local space, relative to its parent if one exists. Otherwise relative to the world." type="vector" %}
16+
{% include ent_io.html name="SetAbsOrigin" desc="Sets this entity's origin in the map, always relative to the world origin." type="vector" %}
17+
{% include ent_io.html name="SetAbsAngles" desc="Sets this entity's angles in the map, always relative to the world origin." type="vector" %}
18+
{% include ent_io.html name="SetLocalVelocity" desc="Sets this entity's current velocity." type="vector" %}
19+
{% include ent_io.html name="SetLocalAngularVelocity" desc="Sets this entity's current angular velocity." type="vector" %}
20+
21+
{% include ent_io.html name="AddSpawnFlags" desc="Adds spawnflag(s) to this entity. Many spawnflags have their respective numbers suffixed in Mapbase's FGD." type="integer" %}
22+
{% include ent_io.html name="RemoveSpawnFlags" desc="Removes spawnflag(s) from this entity. Many spawnflags have their respective numbers suffixed in Mapbase's FGD." type="integer" %}
23+
24+
{% include ent_io.html name="AddEFlags" desc="Adds EFlags to this entity." type="integer" %}
25+
{% include ent_io.html name="RemoveEFlags" desc="Removes EFlags from this entity." type="integer" %}
26+
{% include ent_io.html name="SetMoveType" desc="Sets this entity's movetype." type="integer" %}
27+
{% include ent_io.html name="SetCollisionGroup" desc="Sets this entity's collision group." type="integer" %}
28+
{% include ent_io.html name="AddSolidFlags" desc="Adds solid flags to this entity." type="integer" %}
29+
{% include ent_io.html name="RemoveSolidFlags" desc="Removes solid flags from this entity." type="integer" %}
30+
31+
{% include ent_io.html name="Touch" desc="Simulates the specified entity touching the entity receiving this input. (e.g. a trigger receiving this input with a player as the parameter will be triggered by that player)" type="target_destination" %}
32+
33+
{% include ent_io.html name="KillIfNotVisible" desc="Kills this entity if it's not visible to any players." type="void" %}
34+
{% include ent_io.html name="KillWhenNotVisible" desc="Kills this entity when it's not visible to any players. The parameter is the delay before this is evaluated." type="float" %}
35+
36+
{% include ent_io.html name="SetThinkNull" desc="Sets this entity's general think function to NULL. A string can be passed to clear the think of a specific context." type="string" %}
37+
38+
# Model Entities
39+
The following I/O/KV are only available on entities that use models (i.e. non-brush entities).
40+
41+
### Inputs
42+
{% include ent_io.html name="CreateSeparateRagdoll" desc="Creates a separate serverside ragdoll at this entity's origin." type="void" %}
43+
{% include ent_io.html name="CreateSeparateRagdollClient" desc="Creates a separate clientside ragdoll at this entity's origin." type="void" %}
44+
45+
### Outputs
46+
{% include ent_io.html name="OnServerRagdoll" desc="Fires when this object becomes/creates a serverside ragdoll. Passes the ragdoll." type="target_destination" %}

docs/iokv/logical.markdown

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
layout: article
3+
title: Logical I/O
4+
permalink: /docs/iokv/logical/
5+
breadcrumb: true
6+
---
7+
8+
### Inputs
9+
{% include ent_io.html name="PassUser1" desc="Causes this entity's <code>OutUser1</code> output to be fired. Can pass any parameter." type="string" %}
10+
{% include ent_io.html name="PassUser2" desc="Causes this entity's <code>OutUser2</code> output to be fired. Can pass any parameter." type="string" %}
11+
{% include ent_io.html name="PassUser3" desc="Causes this entity's <code>OutUser3</code> output to be fired. Can pass any parameter." type="string" %}
12+
{% include ent_io.html name="PassUser4" desc="Causes this entity's <code>OutUser4</code> output to be fired. Can pass any parameter." type="string" %}
13+
{% include ent_io.html name="FireRandomUser" desc="Fires <code>OnUser1</code>, <code>OnUser2</code>, <code>OnUser3</code>, or <code>OnUser4</code> with a 25% chance of each." type="void" %}
14+
{% include ent_io.html name="PassRandomUser" desc="Fires <code>OutUser1</code>, <code>OutUser2</code>, <code>OutUser3</code>, or <code>OutUser4</code> with a 25% chance of each. Can pass any parameter." type="string" %}
15+
16+
{% include ent_io.html name="SetHealth" desc="Sets this entity's health. This input already existed on several entities, but now it's part of all entities." type="integer" %}
17+
{% include ent_io.html name="AddHealth/RemoveHealth" desc="Adds to/removes from this entity's health. These inputs already existed on props and <code>func_breakables</code>, but now they're part of all entities, including NPCs." type="integer" %}
18+
{% include ent_io.html name="SetHealth" desc="Sets this entity's maximum health. This will not change the entity's current health unless it exceeds the new maximum, in which case the entity's health will be lowered down to the new maximum." type="integer" %}
19+
20+
{% include ent_io.html name="FireOutput" desc="Fires the named output on this entity. Format: <code>&lt;output name&gt;:&lt;activator&gt;:&lt;caller&gt;:&lt;parameter&gt;:&lt;delay&gt;</code> For example: <code>OnDeath:my_entity:my_entity</code>. Everything beyond the output name is optional." type="string" %}
21+
{% include ent_io.html name="RemoveOutput" desc="Removes all instances of the named output on this entity. Wildcards are supported, meaning you could just pass '*' to wipe all outputs from this entity." type="string" %}
22+
{% include ent_io.html name="AcceptInput" desc="Fires the named input on this entity. Format: <code>&lt;input name&gt;:&lt;parameter&gt;:&lt;activator&gt;:&lt;caller&gt;:&lt;output ID&gt;</code> Example: <code>SetTarget:target_entity</code>. Everything beyond the input name is optional. Note that this is arranged differently from <code>FireOutput</code>, having the parameter right after the input name." type="string" %}
23+
{% include ent_io.html name="CancelPending" desc="Cancels any events fired by this entity that are currently pending in the I/O event queue. This input originated from <code>logic_relay</code>, but it's been promoted to a base input so any entity could cancel their outputs." type="void" %}
24+
25+
{% include ent_io.html name="FreeChildren" desc="Unparents all entities parented to this entity in a movement hierarchy." type="void" %}
26+
27+
{% include ent_io.html name="SetLocalOrigin" desc="Sets this entity's origin in local space, relative to its parent if one exists. Otherwise relative to the world." type="vector" %}
28+
{% include ent_io.html name="SetLocalAngles" desc="Sets this entity's angles in local space, relative to its parent if one exists. Otherwise relative to the world." type="vector" %}
29+
{% include ent_io.html name="SetAbsOrigin" desc="Sets this entity's origin in the map, always relative to the world origin." type="vector" %}
30+
{% include ent_io.html name="SetAbsAngles" desc="Sets this entity's angles in the map, always relative to the world origin." type="vector" %}
31+
{% include ent_io.html name="SetLocalVelocity" desc="Sets this entity's current velocity." type="vector" %}
32+
{% include ent_io.html name="SetLocalAngularVelocity" desc="Sets this entity's current angular velocity." type="vector" %}
33+
34+
{% include ent_io.html name="AddSpawnFlags" desc="Adds spawnflag(s) to this entity. Many spawnflags have their respective numbers suffixed in Mapbase's FGD." type="integer" %}
35+
{% include ent_io.html name="RemoveSpawnFlags" desc="Removes spawnflag(s) from this entity. Many spawnflags have their respective numbers suffixed in Mapbase's FGD." type="integer" %}
36+
37+
{% include ent_io.html name="AddEFlags" desc="Adds EFlags to this entity." type="integer" %}
38+
{% include ent_io.html name="RemoveEFlags" desc="Removes EFlags from this entity." type="integer" %}
39+
{% include ent_io.html name="SetMoveType" desc="Sets this entity's movetype." type="integer" %}
40+
{% include ent_io.html name="SetCollisionGroup" desc="Sets this entity's collision group." type="integer" %}
41+
{% include ent_io.html name="AddSolidFlags" desc="Adds solid flags to this entity." type="integer" %}
42+
{% include ent_io.html name="RemoveSolidFlags" desc="Removes solid flags from this entity." type="integer" %}
43+
44+
{% include ent_io.html name="ChangeVariable" desc="A special version of <code>AddOutput</code> that changes a datadesc variable instead of a keyvalue, similar to <code>logic_datadesc_accessor</code>." type="string" %}
45+
46+
### Outputs
47+
{% include ent_io.html name="OutUser1" desc="Fires in response to <code>PassUser1</code>. Can pass any parameter." type="string" %}
48+
{% include ent_io.html name="OutUser2" desc="Fires in response to <code>PassUser2</code>. Can pass any parameter." type="string" %}
49+
{% include ent_io.html name="OutUser3" desc="Fires in response to <code>PassUser3</code>. Can pass any parameter." type="string" %}
50+
{% include ent_io.html name="OutUser4" desc="Fires in response to <code>PassUser4</code>. Can pass any parameter." type="string" %}
51+
52+
{% include ent_io.html name="OnKilled" desc="Fires when this entity is removed with the 'Kill' input." type="void" from="L4D" %}
53+
54+
### KeyValues
55+
The owner entity can now be accessed with the {{code|OwnerEntity}} keyvalue and {{code|m_fFlags}} (an internal flag variable) can now be accessed with the aptly named {{code|m_fFlags}} keyvalue, but neither are actually used in any base FGD classes to avoid clutter.

docs/iokv/visual.markdown

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
layout: article
3+
title: Visual I/KV
4+
permalink: /docs/iokv/visual/
5+
breadcrumb: true
6+
---
7+
8+
### Inputs
9+
{% include ent_io.html name="SetRenderMode" desc="Sets this entity's render mode." type="integer" %}
10+
{% include ent_io.html name="SetRenderFX" desc="Sets this entity's render FX." type="integer" %}
11+
{% include ent_io.html name="SetViewHideFlags" desc="Sets view ID hide flags. See the [#New nodraw abilities] section for more information." type="integer" %}
12+
{% include ent_io.html name="AddEffects" desc="Adds to this entity's effects flags." type="integer" %}
13+
{% include ent_io.html name="RemoveEffects" desc="Removes from this entity's effects flags." type="integer" %}
14+
{% include ent_io.html name="EnableDraw" desc="Draws this entity if it was undrawn before. Equivalent to <code>RemoveEffects 32</code>." type="void" from="Portal 2" %}
15+
{% include ent_io.html name="DisableDraw" desc="Undraws this entity if it was drawn before. Equivalent to <code>AddEffects 32</code>." type="void" from="Portal 2" %}
16+
17+
### KeyValues
18+
19+
{% include ent_kv.html name="View ID nodraw" desc="Controls whether an entity shouldn't be drawn in specific parts of the view rendering process. See the [#New nodraw abilities] section for more information.}" internal="viewhideflags" type="flags" %}
20+
{% include ent_kv.html name="Disable flashlight" desc="Used to disable flashlight (<code>env_projectedtexture</code>) lighting on this entity. Note that this will not stop the entity from casting projected texture shadows; see the [#New nodraw abilities] section for information on how to do that." internal="disableflashlight" type="choices" from="Portal 2" %}
21+
22+
#### New nodraw abilities
23+
24+
Mapbase adds a few new ways of turning an entity invisible:
25+
26+
* A <code>SetRenderMode</code> input which can be used to set an entity to the "Don't render" mode on the fly by using a parameter of 9.
27+
* New <code>Enable/DisableDraw</code> inputs inspired by the inputs of the same name from Portal 2.
28+
* A new "view ID nodraw" feature that hides an entity in specific render contexts.
29+
30+
Each of these methods turn an entity invisible in different ways, and they each have their own tradeoffs. For example, using <code>DisableDraw</code> will prevent an entity's data from being transmitted to the client, while using the other methods will not.
31+
32+
The view ID nodraw ability is unique in the fact that it prevents drawing in specific passes from the view rendering process. For example, if an entity is set to not draw in <code>VIEW_MONITOR</code>, then that entity will not show up on RT camera monitors, but it will show up everywhere else.
33+
34+
View IDs are specified in a similar fashion to spawnflags, and combinations of them can be used. Here's a list of view IDs in base Source 2013:
35+
36+
{% include ent_sf.html name="VIEW_MAIN" desc="The main view used for the default player camera." bit="1" %}
37+
{% include ent_sf.html name="VIEW_3DSKY" desc="Used by the 3D Skybox." bit="2" %}
38+
{% include ent_sf.html name="VIEW_MONITOR" desc="Used by <code>point_camera</code> screens." bit="4" %}
39+
{% include ent_sf.html name="VIEW_REFLECTION" desc="Used by expensive water and <code>func_reflective_glass</code> to reflect the world." bit="8" %}
40+
{% include ent_sf.html name="VIEW_REFRACTION" desc="Used by expensive water and <code>func_reflective_glass</code> to show underwater areas." bit="16" %}
41+
{% include ent_sf.html name="VIEW_INTRO_PLAYER" desc="Used by <code>script_intro</code>'s secondary camera view." bit="32" %}
42+
{% include ent_sf.html name="VIEW_INTRO_CAMERA" desc="When a <code>script_intro</code> is active, the player uses this instead of <code>VIEW_MAIN</code>." bit="64" %}
43+
{% include ent_sf.html name="VIEW_SHADOW_DEPTH_TEXTURE" desc="Used by <code>env_projectedtexture</code> and flashlight shadow maps. Hiding an entity in this view will stop it from casting projected texture shadows." bit="128" %}
44+
{% include ent_sf.html name="VIEW_SSAO" desc="Used by Pyrovision SSAO in TF2." bit="256" %}
45+
46+
---
47+
48+
The FGD also provides some default presets:
49+
50+
* 0 : "Draw normally"
51+
* 193 : "Hide in main view (player's eyes)" ''( VIEW_MAIN + VIEW_INTRO_CAMERA + VIEW_SHADOW_DEPTH_TEXTURE )''
52+
* 36 : "Hide in cameras" ''( VIEW_MONITOR + VIEW_INTRO_PLAYER )''
53+
* 24 : "Hide in mirrors/water" ''( VIEW_REFLECTION + VIEW_REFRACTION )''
54+
* 60 : "Hide in cameras and mirrors/water" ''( VIEW_MONITOR + VIEW_INTRO_PLAYER + VIEW_REFLECTION + VIEW_REFRACTION )''
55+
* 2 : "Hide in 3D skybox" ''( VIEW_3DSKY )''
56+
* 128 : "Hide projected texture shadows" ''( VIEW_SHADOW_DEPTH_TEXTURE )''
57+
58+
# Model Entities
59+
The following I/O/KV are only available on entities that use models (i.e. non-brush entities).
60+
61+
### Inputs
62+
{% include ent_io.html name="SetPoseParameter" desc="Sets the specified pose parameter to the specified value (e.g. <code>aim_yaw 45</code>)." type="string" %}
63+
{% include ent_io.html name="SetModel" desc="Sets this entity's model. Path must start with <code>models/</code> and include the extension." type="string" %}
64+
{% include ent_io.html name="SetCycle" desc="Sets the animation's cycle." type="float" %}
65+
{% include ent_io.html name="SetPlaybackRate" desc="Sets the animation's playback rate." type="float" %}

0 commit comments

Comments
 (0)