• Npc ai
    336 replies, posted
This addon allows ground npcs to chase there targets on a map without nodes. SVN: [url]http://npcaimod.googlecode.com/svn/trunk/NPC_AI[/url] Might wanna keep a back up before updating the svn incase theres bugs or something. Instructions to install: extract to you garrys mod addons folder C:\Program Files\Steam\steamapps\*your steam name*\garrysmod\garrysmod\addons Features: all basic ground npcs will chase there target: combine, rebels, zombies, antlions. anything other npc's are untested but should work. Friendly Fire if you keep shooting a friendly npc he will turn on you. Npcs will switch to the closer target if theirs is running. the basic weapons work, but you need to use the right weapon on the right npcs metro police: pistol, crowbar, stunstick, smg combine: ar2, shotgun, smg rebels: pretty much the metro police and combines weapons. white combines will shoot combine balls with the ar2 blue combines will throw grenades npcs will run from grenades as long as a npc is after you, you can run as far as you want and it will continue to chase you. if you have ignore player on they will not chase you. The ability for NPCs to form Squads ------------------------------------------ UPDATE 1.1 ------------------------------------------ Added Squads. Npcs can now form a squad with each other or you. fixed a problem with npcs switching targets Fixed some glitchs with shuffling npcs when you ran TO far from them Maybe improved preformance but added squad probably reversed it lol Fast zombies will now jump at you. Antlions will fly at you. Fixed manhacks. They will no longer fly off into the air and lose interest in you. They will always chase someone. Added support for the RPG. Though they still take awhile to shoot. And last but not least added a Menu to enable and Disable features. It's located under the Utilities Tab and then Under AI. [URL=http://img6.imageshack.us/my.php?image=showingg.png][IMG]http://img6.imageshack.us/img6/668/showingg.png[/IMG][/URL] MENU OPTIONS how to: Activate/Disable AI: Turns the whole thing on and off Reuse Array: Is a new feature thats beta but should be fine to leave on. If you find that spawning a npc lags more then usual try and disable this to see if it helps. Friendly Fire on NPCs: Enables and disables the ability for you to shoot friendly npcs and them turn against you. Next Think Time: OK! this is a big one. This is a fix for the npcs shuffling there feet and moving very slow. If your npc's do that try messing with this. Default is 0.3 and 0.5 is ok to. Allow Metro Police Manhacks: Enable wether or not MetroPolice can use manhacks. Amount of Manhacks: how man manhacks the metropolice get each. Allow Grenades: can combine use grenades. Amount of Grenades: how man grenades combine get each. Allow Players to be Squad Leaders: Can npcs join a players squad Allow Squads: enables and disables squads all together. Max Members of a squad: How many npcs can be in one squad including the Leader. Max Join Distance: how far away do npcs have to be from each other before they decide to join. Max Follow Distance: How far away the leader has to be till his squad starts to follow. NOTE: After some of these changes some npcs will need to be respawned. Video: [media]http://www.youtube.com/watch?v=45lahGPIzQY[/media] Download: Version 1.2 [url=http://www.garrysmod.org/downloads/?a=view&id=78800][img]http://www.garrysmod.org/img/?t=dll&id=78800[/img][/url] Version 1.1 [url=http://www.garrysmod.org/downloads/?a=view&id=67053][img]http://www.garrysmod.org/img/?t=dll&id=67053[/img][/url] Version 1.0 [url=http://www.garrysmod.org/downloads/?a=view&id=66741][img]http://www.garrysmod.org/img/?t=dll&id=66741[/img][/url] since its not based on nodes, it will reduce performance a tad because its based on arithmetic. The performance for me only drops about 10 fps off your normal fps with out it on a 10 vs 10. And my computer is about 4-5 years old. A server is hosting the newest npc ai mod version 1.2 at 89.238.160.31:27016 It has npc movement to navigate around props and the world(such as walls) antlions and fast zombies will jump over props ep2 monster have been fixed a fix on squads antlion gaurd charge attack fixed change automatic npc joining a player squad to press E or the use key on npc's to make them join and leave your squad. Tip spawn 1 npc at a time and tell it to join or it will form a npc squad.
W00T?This has already been done but not with maps without AI Nodes.Will they also work on AI noded maps?I mean, will combines and rebels go to cover when reloading and run from a superior enemy (by superior I mean like a rebel is running from a combine because he hasnt got anything to return fire with)?
Edit* Doesn't mess up nodes and can be turned off.
WOAH! Favorited! You saved my life mate! Could you make a tick box somewhere in the spawn menu so we can activate when it's on non-noded maps, and deactivate on noded ones? Aswell as a tickbox for the friendly fire thing, if possible! one side question: if there is a prop in their way, will they "try" to get around? Like step on their right/left a little? Was it hard to get this to work?
Can you also make combines use SMG?Pls?The reason why I`m asking this is because I want my custom NPCs to have any weapon (not including custom weapons) and to still throw nades and manhacks.You can see my NPCs here! :D [url]http://www.garrysmod.org/user/?u=66140&rnum=87647[/url]
[QUOTE=Bragdras;14621769]WOAH! Favorited! You saved my life mate! Could you make a tick box somewhere in the spawn menu so we can activate when it's on non-noded maps, and deactivate on noded ones? Aswell as a tickbox for the friendly fire thing, if possible! one side question: if there is a prop in their way, will they "try" to get around? Like step on their right/left a little? Was it hard to get this to work?[/QUOTE] there is a concommand to disable the whole thing i could work on a menu they do get stuck behind props. but this is just a first release i will try and work on that and some other advanced features @hole2score my combines use smg's so if your using the combine script is should work as well
Well if they work, I love you!lol
As long as the npc knows how to use the weapon this addon will work for it. its just the combines dont know how to use the crowbar and stunstick so they just bug out.
I hope you develop this! It's awesome! The main problem is the lack of option to turn the friendly fire thing off/on & how they don't try to get a round a prop, but that's because it's your first version as you said, keep it up!! Side note: fast zombies don't leap on non-noded maps
Yea I actually did get them to leap, but I had to redo the file a couple of times ill try and get them to do it again.
This is not lua its cfg. I wish there was a cfg scripting section. XD anyways nice try though. Edit: Shit, wrong thread, please disregard the text above I should reply that here: [url]http://www.facepunch.com/showthread.php?t=721392[/url] sorry
Will you be making any other updates on this?
yea i will, ill work on bragdras' request. anyone else have any?
Hmm, I know it might sound silly to ask, but if you have done that, do you think you could be able to change combine's aim? to make them more precise when shooting with weapons?
You cannot be serious. I'm going to test this out right now, this is epic awesomeness. Can they also jump?
No they cannot jump, because they do not jump in half life 2, I already asked if there was a way to make thier aim better, but no one told me. I dont think its really possible because i think its just hard coded. Barney and Alex have quite a aim though.
Nice, can you make that helicopter follow you and drop choppers or bombs and the strider use the cannon? And the Hunters now dont shoot, only use melee can you fix?
Can you make so they now how to corner an enemy like if there are 2 rebels against 10 combines, can you make so that combines can find another way to kill them easily without standing still in front of them and shooting in props/wall?
My my...NPCs wars in Garrysmod gets Better With Time. This is a huge step in the right direction and is key on making players less reliant on maps requiring nodes for worthy npc battles. I won't be downloading until I monitor to see how it develops but I commend you sir, well done.
[QUOTE=lingox;14628943]Nice, can you make that helicopter follow you and drop choppers or bombs and the strider use the cannon? And the Hunters now dont shoot, only use melee can you fix?[/QUOTE] oh i dont have ep 2 but i can fix it I already started working on the choppers haven't made them move yet, but did get them to shoot and drop bombs. [QUOTE=hole2score;14630951]Can you make so they now how to corner an enemy like if there are 2 rebels against 10 combines, can you make so that combines can find another way to kill them easily without standing still in front of them and shooting in props/wall?[/QUOTE] I spose its possible, but enabling more stuff like would most likely kill performance
So does this alter any Nodes?
I have no idea if someone could show me a map that has nodes ill test it out
gm_construct has nodes
Wow... i didnt think this is possible at all, i must say very good job on this, if you made it not mess up Noded maps then we have a winner.
[QUOTE=-TB-;14634404]oh i dont have ep 2 but i can fix it I already started working on the choppers haven't made them move yet, but did get them to shoot and drop bombs. I spose its possible, but enabling more stuff like would most likely kill performance[/QUOTE] So you are saying that its possible to make them corner an enemy but with reduced performances?Lol its fine by me!But if someone has a realy slow PC u should then put 2 downloads:one without the cornering stuff and one with all the cornering, following etc. options! :D
Well done -TB-. I'm going to try this out.
I played on a noded map with this addon and didnt see any changes.They still do what they are supouse to do.But as TB mentioned b4, u drop 10 FPS.
thanks guys. Well I tested it on gm_construct didn't make an effect on the nodes just a slight server performance which could be fixed by typing NPC_ai 0 if you don't want to lose any. I will make a better feature to enable and disable certain parts of the code.
Why the hell are you doing this: [code] function ChangeAI(value) AI=value end concommand.Add("NPC_ai",ChangeAI) [/code] Convars are there for a reason.
Well I dont understand every bit of garrys mod seeing as how this is the first thing i've made, but im guessing it should be. [code]AI=GetConVar( "NPC_ai" ):GetBool()[/code] edit* well i dont know how to add a Concommand starting as true.
Sorry, you need to Log In to post a reply to this thread.