Garry's Mod

Garry's Mod

3,055 hodnocení
Patrol Routes STool
2
2
   
Ocenit
Přidat do oblíbených
Oblíbeno
Odebrat z oblíbených
Content Type: Addon
Addon Type: Tool
Addon Tags: Realism
Velikost souboru
Přidáno
Aktualizováno
12.064 KB
14. úno. 2016 v 19.17
9. bře. 2018 v 16.37
Poznámky ke změnám (15) – zobrazit

Klikněte na „Odebírat“ pro stažení položky
Patrol Routes STool

Popis
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://steamcommunity.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).
Populární diskuze Zobrazit vše (17)
6
20. lis. 2020 v 10.57
NPCs won't return
Imagine sisyphus.
4
13. říj. 2020 v 9.37
flying npc's/striders/rollermines/Combine APC.
Snuffleupagu5
1
24. zář. 2021 v 18.51
error ?
SHREDDER(V)o¥o(V)
Počet komentářů: 941
NormalPolishBoy 9. čvn. v 2.36 
Right clicking on an NPC does nothing. how fix?
Max Shadow  [autor] 11. dub. v 9.13 
Make sure the radius is big enough, and also clear the NPC filter field, otherwise it only affects NPCs with those classnames
Soup Can 11. dub. v 4.15 
The Autoassigner wont work for some reason and the npcs just stay in place
Max Shadow  [autor] 6. dub. v 11.59 
Nope. One way to implement that would be to have a toggleable option that automatically connects newly placed nodes with any other node in a certain radius and in line of sight. That would be useful for a waypoint system. Sadly, I haven't played GMod in a while, so it's very unlikely I'll ever update this mod.
HOOVY 6. dub. v 11.39 
I have a question, is there some sort of easy way to connect alot of Patrol-Nodes with eachother? Something like, you can set that all Patrol-Nodes in a specific Radius connect to eachother or that 1 Patrol-Node connects with all others
MattsterHamster 7. led. v 5.35 
@AmisAuto, Pretty easy to set that up by disabling "back and forth". This will make an NPC complete its patrol (works best with a one-direction line) and stop at the end.
AmisAuto 1. led. v 13.51 
Can I make NPC to abandon their route after he reached his last point? I'd like them to go somewhere, and then act on their own.
Detiplays 29. pro. 2023 v 6.25 
Combine Faction NPC's don't work. They just stand in place when assigned to a route.
Nietabs 24. lis. 2023 v 20.11 
@Wesker1991 just watched your npc battles, very epic. thank you for showing me this :steamhappy:
Wesker1991 29. říj. 2023 v 14.06 
SNPCs do work well with this. I have made many YouTube battles with this mod, wouldn't play Garry's Mod without it.