Garry's Mod

Garry's Mod

NPC Navmesh Navigation
 此主题已被置顶,因此可能具有重要性
1  [开发者] 2022 年 12 月 23 日 上午 10:26
FAQ
Here is a FAQ section. Hopefully it will answer some questions you might have, Also feel free to help others out if you know the solution to a problem.

Q : NPCs are not moving?

A : 1 Firstly, Make sure the map you are playing on has a navmesh. You can generate one with the nav_generate console command.

A2: Is the mod enabled. ( Check in your addons list and in the spawnmenu settings. )

A3: Are their navmesh nodes near the NPCs? Can the NPCs reach their destination VIA the navmesh?You can check with ( nav_edit 1 ) and explore the location.

Q: Does this work with SNPCs? ( VJ Base for example )

A: Yes and no, No it does not work with SNPCs unless the developer of that mod adds support.

Q: I got an error / Bug ! What do it do?

A: Its best to report it to the Bugs and errors report section.
https://psteamcommunity.yuanyoumao.com/workshop/filedetails/discussion/2905690962/3730700942539928185/

Q: NPCs like to jump around a lot?

A: Thats because their navigator is detecting different heights between the waypoints so they jump.

If you want you can try turning off ( Allow jump Up ) and ( Allow jump down ) settings in the spawnmenu.

If all else fails try setting the console command ( z_npc_nav_allow_forward_jumps ) to 0

Q: Will this work with maps that have AI Nodes on them?

A: Yes, The navigator will only take over when an NPC can't seem to pathfind to its desired point.

Q: Will this work with addons that command NPCs to move to locations?

A: Yes, When the navigator detects that an NPC wants to move to a location it will override if they can't get there.

Q: Does this work with other gamemodes?

A: Yes. An example of some gamemodes is smashing survival or the wave breaker.

Q: What are console commands? How do i open console?

A: To open console you need to make sure its enabled. Open you main menu ( Not the spawnmenu ) Go to options, Then advanced options and tick the box that says ( enable developer console ) Good now you can open the console,
Click apply and open it.The default key for console is the tilder key ( below Esc and to the left of the 1 key on most keyboards )
If you don't have a tilder key you can change it in your options.
最后由 1 编辑于; 2022 年 12 月 26 日 上午 10:32
< >
正在显示第 1 - 15 条,共 20 条留言
meatfrog 2022 年 12 月 26 日 上午 10:21 
Does this work with VJ Base entities?
1  [开发者] 2022 年 12 月 27 日 上午 2:59 
Unfortunately, VJ Base SNPCs seem to use a different way of setting their destination. I can't see a reason why it would not be implemented in the future tho.
meatfrog 2022 年 12 月 27 日 上午 4:33 
Unfortunately, VJ Base SNPCs seem to use a different way of setting their destination. I can't see a reason why it would not be implemented in the future tho.
ah ok
Solar 2022 年 12 月 27 日 上午 10:07 
will this work for flying npcs in the future?
SLIME 2022 年 12 月 28 日 上午 1:19 
does this work with dynamic npc squads or inpc?
1  [开发者] 2022 年 12 月 28 日 上午 9:16 
引用自 Solar
will this work for flying npcs in the future?

flying NPCs use a different form of AI Nodes, simply called air nodes.
I will have to see if there is a way to get flying NPCs desired destination for my navigator to navigate to. So possibly in the future yes.





引用自 frordon geeman
does this work with dynamic npc squads or inpc?

Most likely not.
When NPCs don't have their normal AI Nodes they use, Their AI behaviour is less functional, My mod actually controls them a little to fix it, But INPC might try and fight for control over the NPCs with this mod.
However, NPC squad improvements.should be fine.
computer.boy89 2022 年 12 月 28 日 下午 12:22 
Does this work with enhanced sandbox npcs?
最后由 computer.boy89 编辑于; 2022 年 12 月 28 日 下午 12:24
1  [开发者] 2022 年 12 月 29 日 上午 9:08 
From what i have read about that mod, Some of it would work but i think a couple things might not.
最后由 1 编辑于; 2022 年 12 月 29 日 上午 9:08
Solar 2023 年 1 月 3 日 下午 4:59 
will npc's be able to obey the navigation areas marked with crouch, jump, sprint, danger, running, etc properties applied on them? and will they finally use ladders if theres a navmesh on the usable ladder brush that is
最后由 Solar 编辑于; 2023 年 1 月 3 日 下午 5:02
1  [开发者] 2023 年 1 月 5 日 上午 9:43 
The source engine has a very strange way that ladders work with the navmesh, They actually don't count has navmesh nodes directly. Instead they are their own unique kind of node thats complex to implement into the pathfinder.

I have actually got ladders to work before in some gamemodes of mine ( smashing survivals player bots can use ladders as an example.)

As for making them obey areas mark with attributes, Yes i can do that. Crouch would be a bit of a pain to implement tho, Since NPCs ( In code ) have a strange way of handling this.
ByFyves 2023 年 1 月 24 日 上午 7:13 
Is it possible to get the NPCs to walk instead of run? I'd like for them to walk to their points, they always look like they're rushing :melon:
1  [开发者] 2023 年 1 月 24 日 上午 9:41 
Thats actually a feature thats coming in the next update, So eventually, Yes! The update is quite close to being dropped in the next few days / weeks.
LSD Dreamer 2023 年 5 月 4 日 上午 10:12 
how do i use the debug tool?

for the love of god tell me!
最后由 LSD Dreamer 编辑于; 2023 年 5 月 4 日 上午 10:12
1  [开发者] 2023 年 5 月 6 日 上午 1:39 
The debug tool is useful if you find the NPCs are getting stuck somewhere on the navmesh.
Which after you found the problem you can edit the navmesh and fix it etc.....

One thing to note is its a good idea for the map to have a navmesh.

-------------
To use the tool,
Right click on a NPC to select them. ( Only one NPC can be selected at a time )

You can use left click to make the selected NPC move to the location that you fired the toolgun at.
--------------

Pressing your reload key will make the selected NPC move to a random location nearby.

All the settings in the spawnmenu should be self explanatory.
LSD Dreamer 2023 年 5 月 6 日 上午 3:46 
The debug tool is useful if you find the NPCs are getting stuck somewhere on the navmesh.
Which after you found the problem you can edit the navmesh and fix it etc.....

One thing to note is its a good idea for the map to have a navmesh.

-------------
To use the tool,
Right click on a NPC to select them. ( Only one NPC can be selected at a time )

You can use left click to make the selected NPC move to the location that you fired the toolgun at.
--------------

Pressing your reload key will make the selected NPC move to a random location nearby.

All the settings in the spawnmenu should be self explanatory.
thank you. altho sometimes i have to refresh it. but that is easely fixed by left clicking on the ground with a hostile npc.
最后由 LSD Dreamer 编辑于; 2023 年 5 月 6 日 上午 4:16
< >
正在显示第 1 - 15 条,共 20 条留言
每页显示数: 1530 50