Nav Mesh/Console commands: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Team Fortress 2: Added TF2-specific nav mesh commands.)
 
(10 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Language subpage}}
{{LanguageBar}}
 
{{back|Nav Mesh}}
{{back|Nav Mesh}}
== [[Console command|Commands]] ==
== [[Console command|Commands]] ==
These commands can be bound to a key in a config file for faster workflow. For example, [[Left 4 Dead|Left 4 Dead (L4D)]] has [[Nav mode.cfg (L4D)|nav_mode.cfg]].
These commands can be bound to a key in a config file for faster workflow. For example, [[Left 4 Dead|Left 4 Dead (L4D)]] has [[Nav mode.cfg (L4D)|nav_mode.cfg]].


=== {{source|4}} ===
=== {{src|4}} ===


==== Mesh generation ====
==== Mesh generation ====
Line 16: Line 17:
| nav_clear_walkable_marks || Erase any previously placed walkable positions.
| nav_clear_walkable_marks || Erase any previously placed walkable positions.
|- id="nav_generate"
|- id="nav_generate"
| nav_generate || Generate a Navigation Mesh for the current map and save it to disk. {{ent|#nav_quicksave}} determines the amount of information generated. Also generates ladders {{csgo|not}} and does a <code>nav_analyze</code> in the end.
| nav_generate || Generate a Navigation Mesh for the current map and save it to disk. {{ent|nav_quicksave}} determines the amount of information generated. Also generates ladders {{csgo|not}} and does a <code>nav_analyze</code> in the end.
|- id="nav_generate_incremental"
|- id="nav_generate_incremental"
| nav_generate_incremental || Run the generation process from walkable markers instead of on the entire mesh. Newly created areas will usually connect to preexisting areas.
| nav_generate_incremental || Run the generation process from walkable markers instead of on the entire mesh. Newly created areas will usually connect to preexisting areas.
Line 29: Line 30:
| nav_load || Loads navigation mesh from the current map's [[NAV]] file.
| nav_load || Loads navigation mesh from the current map's [[NAV]] file.
|- id="nav_analyze"
|- id="nav_analyze"
| nav_analyze || Loads the Navigation Mesh for the current map. {{ent|#nav_quicksave}} determines the amount of information generated.
| nav_analyze || Loads the Navigation Mesh for the current map. {{ent|nav_quicksave}} determines the amount of information generated.
|- id="nav_max_view_distance"
| nav_max_view_distance || Modify the distance used to test visibility for all nav areas when generating.
{{tip|The default value (6000) is extremely inefficient for open, large maps and will generate bloated file sizes. Setting it to a value like 2000 will make generation much faster and take up way less file size.}}
|}
|}


Line 122: Line 126:
| nav_simplify_selected || Temporarily forces <code>nav_split_place_on_ground</code> to 1, keeps <code>nav_coplanar_slope_limit_displacement</code> and <nav_coplanar_slope_limit> to at least 0.5, and <code>nav_snap_to_grid</code> to 1. It then strips analyzed data and subdivides the selected areas into 1x1 area, performs <code>nav_generate_incremental</code> on them without generating any areas, and finally recombines them before reselecting the resulting nav areas.
| nav_simplify_selected || Temporarily forces <code>nav_split_place_on_ground</code> to 1, keeps <code>nav_coplanar_slope_limit_displacement</code> and <nav_coplanar_slope_limit> to at least 0.5, and <code>nav_snap_to_grid</code> to 1. It then strips analyzed data and subdivides the selected areas into 1x1 area, performs <code>nav_generate_incremental</code> on them without generating any areas, and finally recombines them before reselecting the resulting nav areas.
|- id="nav_save_selected"
|- id="nav_save_selected"
| nav_save_selected<br />nav_save_selected <code><name></code> || Stores a selected set in a [[KeyValues]] file at <code>maps/<map name or <name>>_selected_<number up to 1000>.txt</code>. <br />{{bug|If <code><name></code> exists, the file is saved with <code>nav_save_selected</code> instead of <code><name></code>.}}
| nav_save_selected<br />nav_save_selected <code><name></code> || Stores a selected set in a [[KeyValues]] file at <code>maps/<map name or <name>>_selected_<number up to 1000>.txt</code>. <br />{{bug|hidetested=1|If <code><name></code> exists, the file is saved with <code>nav_save_selected</code> instead of <code><name></code>.}}
|- id="nav_merge_mesh"
|- id="nav_merge_mesh"
| nav_merge_mesh <filename> || Imports nav areas from the specified [[KeyValues]] file in <code>maps/</code>.
| nav_merge_mesh <filename> || Imports nav areas from the specified [[KeyValues]] file in <code>maps/</code>.
Line 240: Line 244:
| nav_build_ladder || Attempts to build a nav ladder on the climbable surface under the cursor.
| nav_build_ladder || Attempts to build a nav ladder on the climbable surface under the cursor.
|- id="nav_gui"
|- id="nav_gui"
| nav_gui || {{Todo|Explain}}
| nav_gui || Opens the nav editing GUI, but it appears to only set {{code|nav_edit}} to 1.
|- id="nav_trouble_report"
|- id="nav_trouble_report"
| nav_trouble_report || Returns any problems with navmesh (e.g. Disconnected Ladders, Orphan Navmesh Areas (Disconnected Navmesh areas))
| nav_trouble_report || Returns any problems with navmesh (e.g. Disconnected Ladders, Orphan Navmesh Areas (Disconnected Navmesh areas))
Line 323: Line 327:
{{varcom|tf_show_incursion_flow| |01|Shows paths (as vectors within tf_show_incursion_flow_range) a team takes to get to the capturable point (1 shows RED team paths, 2 shows BLU team paths).}}
{{varcom|tf_show_incursion_flow| |01|Shows paths (as vectors within tf_show_incursion_flow_range) a team takes to get to the capturable point (1 shows RED team paths, 2 shows BLU team paths).}}
{{varcom|tf_show_sentry_danger| |integer|how sentry danger areas (colored red for RED sentries and blue for BLU sentries). 1:Use m_sentryAreas. 2:Check all nav areas.}}
{{varcom|tf_show_sentry_danger| |integer|how sentry danger areas (colored red for RED sentries and blue for BLU sentries). 1:Use m_sentryAreas. 2:Check all nav areas.}}
{{varcom|tf_show_sniper_spots| |01|Shows (purple for both teams, red for RED team, and blue for BLUE team) areas that aren't within {{ent|tf_show_sniper_areas_safety_range}} units of the enemy invasion area.}}
{{varcom|tf_show_sniper_areas| |01|Shows (purple for both teams, red for RED team, and blue for BLUE team) areas that aren't within {{ent|tf_show_sniper_areas_safety_range}} units of the enemy invasion area.}}
{{varcom|tf_show_sniper_areas_safety_range| |01|The range in which sniper spots withinin the invasion areas are not shown through {{ent|tf_show_sniper_spots}}.}}
{{varcom|tf_show_sniper_areas_safety_range| |01|The range in which sniper spots withinin the invasion areas are not shown through {{ent|tf_show_sniper_areas}}.}}
{{varcom|tf_show_train_path| |01|Shows the train track path for the payload cart.}}
{{varcom|tf_show_train_path| |01|Shows the train track path for the payload cart.}}
{{varcom|tf_show_incursion_flow_gradient| |integer|Shows the path a team takes to get to the capture-able point as gradient colors (1 shows RED team paths in red, 2 shows BLU team paths in blue).}}
{{varcom|tf_show_incursion_flow_gradient| |integer|Shows the path a team takes to get to the capture-able point as gradient colors (1 shows RED team paths in red, 2 shows BLU team paths in blue).}}

Latest revision as of 09:50, 11 July 2025

English (en)Esperanto (eo)日本語 (ja)中文 (zh)Translate (Translate)
Nav Mesh

Commands

These commands can be bound to a key in a config file for faster workflow. For example, Left 4 Dead (L4D) has nav_mode.cfg.

Source Source

Mesh generation

Command Description

Selection commands

Command ! Description
select_with_attribute Selects/highlights all nav mesh areas marked with one attribute specified.

Editing commands

Command Description

Attribute Modification Commands

Attributes modify the nav area with commands that modify NPC behavior, such as a forced crouch, following a specific path, disallowing spawn, etc. Many attributes also have their own command, such as nav_crouch. The command "mark CROUCH" is the same as the command nav_crouch.
Attributes.

Command Description
clear_attribute <Attribute> Clears attribute specified. If nav_clear_attribute does not work to clear an attribute specified, such as PLAYER_START, this command might work.
wipe_attributes Clears all attributes on the selected part of the nav mesh.
wipe_nav_attributes Clears all nav attributes on the selected part of the nav mesh.

Place name commands

Command Description

Other commands

Command Description
nb_delete_all
nb_delete_all <Group>
Removes all NPCs in the game or, if group is specified, removes Specified group only. An example group type would be Infected in L4D.
nb_move_to_cursor Commands all NPCs to move to the location of the 3D cursor

Additional Console Variables

Command Description

Team Fortress 2

Viewing

Cvar/Command Parameters or default value Descriptor Effect
tf_show_actor_potential_visibility 01 <bool> Shows areas potentially visible to a demographic (Purple for both teams, red for RED team, and blue for BLU team).
tf_show_bomb_drop_areas 0 disables, 1 enables Shows areas where BLU bots can get to and can drop the bomb.
tf_show_blocked_areas 0 disables, 1 enables Shows areas blocked by a demographic (Purple for both teams, red for RED team, blue for BLU team).
tf_show_control_points 0 disables, 1 enables Show areas that a control point (not payload) is on in yellow, and adjacent areas in dark yellow.
tf_show_in_combat_areas 0 disables, 1 enables Shows areas that are in combat from dark red to red depending on the amount of combat.
tf_show_enemy_invasion_areas 0 disables, 1 enables Shows the areas that the enemy team will invade.
tf_show_incursion_flow 0 disables, 1 enables Shows paths (as vectors within tf_show_incursion_flow_range) a team takes to get to the capturable point (1 shows RED team paths, 2 shows BLU team paths).
tf_show_sentry_danger integer how sentry danger areas (colored red for RED sentries and blue for BLU sentries). 1:Use m_sentryAreas. 2:Check all nav areas.
tf_show_sniper_areas 0 disables, 1 enables Shows (purple for both teams, red for RED team, and blue for BLUE team) areas that aren't within tf_show_sniper_areas_safety_range units of the enemy invasion area.
tf_show_sniper_areas_safety_range 0 disables, 1 enables The range in which sniper spots withinin the invasion areas are not shown through tf_show_sniper_areas.
tf_show_train_path 0 disables, 1 enables Shows the train track path for the payload cart.
tf_show_incursion_flow_gradient integer Shows the path a team takes to get to the capture-able point as gradient colors (1 shows RED team paths in red, 2 shows BLU team paths in blue).
tf_show_incursion_flow_range integer The range in which incursion flow vectors are visible.
tf_show_incursion_range 0 disables, 1 enables Highlight areas with incursion distances between tf_show_incursion_range_min and tf_show_incursion_range_max cvar values.
tf_show_incursion_range_min Hammer units Minimum range to show incursion distances within with tf_show_incursion_range.
tf_show_incursion_range_max Hammer units Maximum range to show incursion distances within with tf_show_incursion_range.

See also

Non-Game Specific

Left 4 Dead Series

Introduction

Resources