Garry's Mod

Garry's Mod

NPC Navmesh Navigation
 Denne tråd er blevet fastgjort, så den er sikkert vigtig
Cheerful  [udvikler] 23. dec. 2022 kl. 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.
Sidst redigeret af Cheerful; 26. dec. 2022 kl. 10:32
< >
Viser 1-15 af 20 kommentarer
meatfrog 26. dec. 2022 kl. 10:21 
Does this work with VJ Base entities?
Cheerful  [udvikler] 27. dec. 2022 kl. 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 27. dec. 2022 kl. 4:33 
Oprindeligt skrevet af | 2 |-Brainless-| 4 |:
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 27. dec. 2022 kl. 10:07 
will this work for flying npcs in the future?
SLIME 28. dec. 2022 kl. 1:19 
does this work with dynamic npc squads or inpc?
Cheerful  [udvikler] 28. dec. 2022 kl. 9:16 
Oprindeligt skrevet af 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.





Oprindeligt skrevet af 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 28. dec. 2022 kl. 12:22 
Does this work with enhanced sandbox npcs?
Sidst redigeret af computer.boy89; 28. dec. 2022 kl. 12:24
Cheerful  [udvikler] 29. dec. 2022 kl. 9:08 
From what i have read about that mod, Some of it would work but i think a couple things might not.
Sidst redigeret af Cheerful; 29. dec. 2022 kl. 9:08
Solar 3. jan. 2023 kl. 16: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
Sidst redigeret af Solar; 3. jan. 2023 kl. 17:02
Cheerful  [udvikler] 5. jan. 2023 kl. 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 24. jan. 2023 kl. 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:
Cheerful  [udvikler] 24. jan. 2023 kl. 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 4. maj 2023 kl. 10:12 
how do i use the debug tool?

for the love of god tell me!
Sidst redigeret af LSD Dreamer; 4. maj 2023 kl. 10:12
Cheerful  [udvikler] 6. maj 2023 kl. 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 6. maj 2023 kl. 3:46 
Oprindeligt skrevet af | 2 |-Brainless-| 4 |:
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.
Sidst redigeret af LSD Dreamer; 6. maj 2023 kl. 4:16
< >
Viser 1-15 af 20 kommentarer
Per side: 1530 50