Skip to content

Using the plugin in non native games

Jack Mioriday edited this page Jul 31, 2020 · 6 revisions

A non-native game is a game that doesn't natively support the NavMesh system (ex. Half-Life 2 Deathmatch). However, with the power of SourcePawn, the plugin can take an existing .NAV file and recreate the mesh in its entirety, providing access to a NavMesh-like system for all SourceMod plugins.

1. Create/Edit the .NAV file.

For this example, we'll have Half-Life 2: Deathmatch (HL2DM) be the target game we want to use the mesh in. Because HL2DM doesn't have the NavMesh system, we have to create the .NAV file via another game that does. Garry's Mod is a nice candidate as it doesn't add any custom data.

⚠️ WARNING: Do not create the .NAV file in games where game-specific data is appended. This will cause the plugin to incorrectly read your .NAV file in your target game. This list includes, but not limited to:

  • Counter-Strike: Global Offensive
  • Counter-Strike: Source
  • Team Fortress 2
  • Left 4 Dead
  • Left 4 Dead 2

In Garry's Mod, enter nav_generate and let the game do its thing. After the mesh is generated, feel free to edit the mesh to your liking.

20200726221453_1

2. Insert the .NAV file into the target game server's maps folder.

This is the best place to place it, as the maps folder is the first folder that the plugin searches for .NAV files in. In HL2DM's case, it'll be the only folder.

3. Start the map in the target game server.

Having the navmesh test plugin enabled, enter sm_navmesh_show 1 in console. If everything goes right, you should be greeted with something like this.

20200726223940_1

That's it. Have fun.

Clone this wiki locally