Garry's Mod
3,101 人が評価
Patrol Routes STool
2
2
   
アワード
お気に入り
お気に入り
お気に入りから削除
Content Type: Addon
Addon Type: Tool
Addon Tags: Realism
ファイルサイズ
投稿日
更新日
12.064 KB
2016年2月14日 19時17分
2018年3月9日 16時37分
15 項目の変更履歴 ( 表示 )

サブスクライブしてダウンロード
Patrol Routes STool

解説
This tool allows you to create complex patrol routes for your NPCs. I made it mainly as a complement to my Stealth Mod. You can find it here: https://steamoss.com/sharedfiles/filedetails/?id=608796788 . This is my second project in LUA, I still have much to learn, so there may be bugs. Feel free to post them here and I'll try to fix them as soon as possible.

IT WON'T WORK IF THE MAP DOESN'T HAVE AI NODES
You can still use this tool in those maps, but you'll have to place patrol points really close to each other (less than 150 points of distance to be exact).

You can save and load your current patrol route to a file. Every map has its own list of saved patrol routes. These files are stored inside Garrysmod/data/patrolroutes.

This tool is compatible with the GMod Save system. However, as everyone knows, that system sucks and its bugged as hell. Always rememer to disable AI and move up your NPCs a bit, so they don't get stuck underground when you load.

Tool Settings:
Show Points: To show or hide the patrol points and links.
Show Chances: To show or hide the chances of links.
Autolink: If enabled, any patrol point you place will be automatically linked to the last.
Walk: If enabled, the NPC will walk through the patrol route.
Strict: If enabled, the NPC won't stop following a route to attack an enemy.
Back and Forth: If enabld, the NPC will start moving in the opposite direction if he finds a dead end.
Undirected Links: If enabld, the NPC will take any route, regardless of it's direction.
Wait Time: The time in seconds an NPC will wait at a specific patrol point.
Chance: The relative chance that an NPC will use a specific link.
Starting Node: The node where the NPC will start the patrol route.
Autoassigner Range: Maximum range for the Autoassigner.
Autoassigner Filter: Class filter for the Autoassigner.


Controls:
Mouse1: Add/Remove node.

(E+Mouse1): Select node.
--> Mouse1 on node: Add/Remove link.
--> Mouse1 on selected: Remove all links.
--> Release E: Deselect node.

Mouse2 on NPC: Assign route to NPC / Create assigner / Update assigner route and settings

(E + Mouse2): Recover route from NPC or assigner.

Reload: Clear nodes.


How to make different patrol routes:
- Create one route and assign it to an NPC with Right Click.

- Press RELOAD to clear your current nodes.

- Make another route, and assign it to another NPC.

NPCs will keep their last assigned patrol route even if you make a new one. Clearing or modifying your current route won't affect already assigned ones. You don't need to have all your routes active at the same time!!!


Single NPC mode:
This is the default mode. Make a route and press Mouse2 on an NPC to assign your current route to him. Press E+Mouse2 to recover the route assigned to that NPC.


Autoassigner mode:
In this mode, Right Click on the world to create an autoassigner. This entity will assign any NPC spawned inside a configurable radius to your current patrol route. You can use this to automatically assign NPCs spawned by other tools, like "NPC Spawn Platforms". Press Mouse2 on an existing autoassigner to update its stored route and settings, or E+Mouse2 to recover the route.

You can also filter which NPCs are assigned. Just write their class names separated by commas without spaces in the tool textbox.


Wire Assigner mode:
In this mode, Right Click on the world to create a Wire Assigner. This entity can be controlled with Wiremod tools. You can use this to assign its stored route to specific NPC's, or all NPCs in a certain radius. The radius and filter settings in the toolmenu are ignored, you need to specify them using Wiremod inputs. Press Mouse2 on an existing Wire Assigner to update its stored route and settings, or E+Mouse2 to recover the route.

Wire Inputs:
AssignNPC: When this is not "0", it will assign its stored route to a single NPC.
AssignInRange: When this is not "0", it will assign its stored route to any NPC inside its configured range.
NPC: The NPC you want to assign the route to with "AssignNPC".
Range: The maximum range for "AssignInRange".
Filter: The NPC filter for "AssignInRange". It has to be a list of class names separated by commas, without spaces.


Known Issues:
- I tried to optimize it as much as I could. Still, there can be FPS drops if you have too many patroling NPCs.


Credits:
Big thanks to Silverlan and his NPC Tools. I used part of his NPC Spawner code as a base to make this tool.

Also thanks to thelastpenguin for his pON (Penguin's Object Notation).
人気スレッド 全て表示 (18)
6
2020年11月20日 10時57分
NPCs won't return
Imagine sisyphus.
4
2020年10月13日 9時37分
flying npc's/striders/rollermines/Combine APC.
Snuffleupagu5
1
2021年9月24日 18時51分
error ?
SHREDDER(V)o¥o(V)
959 件のコメント
SpookyBain I COG 2024年12月27日 2時32分 
hey man i have a tiny list of questions and i need some assistance, if you dont mind taking my friend request that would be realy cool!
Kamil gaming with Friends 2024年12月21日 11時07分 
There were no obstacles, I was just trying to make 1 guard patrol 1 corridor, from corner to corner, but turns out the place was too big and game save decided to delete the set patrol route by itself the next day.
Max Shadow  [作成者] 2024年12月21日 9時47分 
That's probably because the map you're playing on doesn't have a nodegraph. NPCs use AI nodes to navigate, if there are no AI nodes, they can only move a short distance, and are unable to pathfind around obstacles.
Kamil gaming with Friends 2024年12月20日 11時12分 
And now the NPC doesn't to go through the route, unless the nodes are covering only half of the "500" range.
Kamil gaming with Friends 2024年12月20日 10時50分 
Nevermind, turns out the route was too big for autoassigner with range set to 500 even.
Kamil gaming with Friends 2024年12月20日 8時17分 
Okay, idk what's going on, but my NPC stops at the 2nd node everytime and then I have to rickclick on him again, but he walks back to the 1st node, instead of walking to the 3rd one. I wanted to make a real route, with like 6 nodes at least, but my NPC does this all the time instead and nothing works.
baernay 2024年11月26日 9時19分 
does this work for hammer?
not doge 2024年11月17日 21時05分 
the npc patrol mod is giving me a error\
elcartucho5566 2024年8月24日 10時13分 
the npc will get out of the patrol route and attack a threat?
Bobbymansツ 2024年8月20日 2時27分 
Hi I was wondering why only the first NPC follows the path but when I want to assign a 2nd NPC, the 2nd NPC goes back and forth once but then just stands still.