1. Post #1
    BassPwnsYou's Avatar
    September 2007
    16 Posts
    I present to you, people of the internet, a STool for spawning NPCs in squads.

    I'll allow you a moment to catch your breath.

    Ok, so it's not that impressive, but the brilliance of it is in the simplicity. Have you ever been screwing around in gm_construct and wished the NPCs were a little more...smart? The AI in the source engine is better than that and all you have to do is assign an NPC a squadname key value and give him some friends to get more tactical actions.

    NPCs in squads communicate and coordinate attacks and defense, and will call for help from other squad members or faction members from different squads on the map when engaged by enemies, even if those other NPCs would not normally be in range to engage said threat. This is especially cool with Combine NPCs as they will communicate via radio to report contact and losses. Metropolice are even better, communicating with Overwatch as well.

    This STool allows you to place NPCs with the tool gun, meaning you can precisely position them. The default setting will place them facing the same direction as the player, but you can use the Angle Offset slider to rotate the NPC. Setting "Align to World" will ignore player facing direction and align to absolute world angles.

    New with version 0.9 are a TON more NPCs including rebels and medics, all types of Combine soldiers and neat Combine goodies, Vortigaunts (who will work with Rebels) and other story NPCs, the ability to align to the world or the player's view direction and offset from there, and a couple other "goodies." This is much better than version 0.75 you may have seen on garrysmod.org a few days back.

    NPCs I'd still like to get working are striders and combine APCs, but that's for the 1.0 release. The trouble with striders is that they use air nodes instead of ground nodes to navigate, so they tend to stand around in one place as few maps have air nodes.

    Known Problems
    NPCs who are assigned a squad name after spawning do not change their behavior. This causes the issue with NPCs like Alyx or Barney who are by default in player_squad and will not attach to another one.
    Spawning NPCs on a hill may or may not force them into the ground.

    Cool things to try!
    Make a Combine Scanner in the same squad as a Combine soldier or metrocop.

    Group a few different types of zombies together and scatter them over the map.

    Add a vortigaunt or two to your rebel squad.

    Add Citizens and their rebel brethren to player_squad.

    Spawn Breen at precisely 275 degrees aligned to world for your next "KILL BREEN" save file. (It's a joke from gmod.org that in retrospect wasn't that funny.)

    EDIT (9/3/2010): Added offset sliders.

    Subversion (Already improved from the garrysmod.org version):
    http://squadnpcs.googlecode.com/svn/trunk/

    Version 0.9:
    http://www.garrysmod.org/downloads/?a=view&id=109234
    If you're confused, read the readme first. It probably answers the question you want to ask.
    Reply With Quote Edit / Delete Reply United States Show Events Useful Useful x 7Winner Winner x 1 (list)

  2. Post #2
    ART1E117's Avatar
    March 2008
    741 Posts
    I love you.

  3. Post #3
    General Arnold's Avatar
    August 2010
    265 Posts
    Thats pretty cool dude. imma try dis out. But seriously. Its cool

  4. Post #4
    Aspirin's Avatar
    February 2010
    31 Posts
    You got my download.

  5. Post #5
    skylar15's Avatar
    April 2010
    181 Posts
    Ima get dis

  6. Post #6
    MHGooseMH's Avatar
    February 2010
    75 Posts
    Awesome tool, great for npc battles, here, have a wrench!

  7. Post #7
    Echo225's Avatar
    March 2010
    100 Posts
    I used to bind a key to set the Combine to squads, now I can just use a tool. Thank you so much!!

  8. Post #8
    Gold Member
    Kung Fu Jew's Avatar
    November 2006
    5,681 Posts
    Spawn Breen at precisely 275 degrees aligned to world for your next "KILL BREEN" save file.
    What does this mean?

    Anyway I love this STool so much. Lifesaver.

  9. Post #9
    Gold Member
    superstepa's Avatar
    June 2009
    8,939 Posts
    Looks cool , but with Advanced AI I dont need it . Npcs get in a squad themselves

  10. Post #10
    BassPwnsYou's Avatar
    September 2007
    16 Posts
    I would argue Advance AI has an entirely different application. The benefit here is that it doesn't modify your base NPCs in any way, which means it will never conflict with another addon.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1 (list)

  11. Post #11
    Flubascrub
    Flubadoo's Avatar
    August 2009
    10,532 Posts
    I put one combine squad (a) in the middle of gm_construct and some combine near the edge of the map. When rebels started shooting them, the other combine at the edge of the map didn't come over to assist the combines. How long is the working distance? Different squads call each other for assistance, or does one squad only call itself?

  12. Post #12
    BassPwnsYou's Avatar
    September 2007
    16 Posts
    Did you put the combine in one squad and the the rebels in another? If you put a single combine soldier in a squad he would behave as if he were not in a squad.

  13. Post #13
    Flubascrub
    Flubadoo's Avatar
    August 2009
    10,532 Posts
    Well first, if 5 combines were waiting at the edge of the map. And 5 combines in the same squad were in the middle of the map, would they regroup even if they aren't in combat?

  14. Post #14
    Gold Member
    Kung Fu Jew's Avatar
    November 2006
    5,681 Posts
    Looks cool , but with Advanced AI I dont need it . Npcs get in a squad themselves
    No they don't

    Edited:

    Also if you wanna fix NPCs spawning in the ground, allow us to set an offset height.

  15. Post #15
    BassPwnsYou's Avatar
    September 2007
    16 Posts
    No they don't

    Edited:

    Also if you wanna fix NPCs spawning in the ground, allow us to set an offset height.
    Already working on it, I've got a load of new features for the next release, including a new options panel to really get some control over your NPCs.

    Flubadoo posted:
    Well first, if 5 combines were waiting at the edge of the map. And 5 combines in the same squad were in the middle of the map, would they regroup even if they aren't in combat?
    They won't group up unless they had been in combat at some point. Otherwise they will just stand around wherever they were spawned. In 1.0 I'm looking to allow random patrolling to give a little more depth.

  16. Post #16
    monitor646's Avatar
    January 2009
    89 Posts
    GLORIOUS! Now if only my tool list was easier to navigate...

  17. Post #17
    Flubascrub
    Flubadoo's Avatar
    August 2009
    10,532 Posts
    allow random patrolling to give a little more depth.
    I thought combines sometimes already did that? I recall that they do it, but somewhat randomly.

  18. Post #18
    BassPwnsYou's Avatar
    September 2007
    16 Posts
    I thought combines sometimes already did that? I recall that they do it, but somewhat randomly.
    They stumble around after killing all hostiles, but I was thinking something grander.


    EDIT: Added SVN link to the first post.

  19. Post #19
    Gold Member
    Sunnday3's Avatar
    February 2007
    629 Posts
    You should make it so we spawn the npcs with custom npc weapons we have installed.

  20. Post #20
    bloodien0se's Avatar
    July 2007
    10 Posts
    Hmm, I'm getting some odd errors, and strange AI Behavior

    Code:
    Can't find factory for entity: npc_cscanner
    weapons\gmod_tool\stools\squadnpcs.lua:134: Tried to use a NULL entity!
    About 4 times per spawn. I didn't spawn any opposing forces on the same team or anything, it did this from the very first spawn. Any idea? Using SVN by the way.

  21. Post #21
    Flubascrub
    Flubadoo's Avatar
    August 2009
    10,532 Posts
    Grander, as in, new animations or patrolling around the whole place?

    Edited:

    You should make it so we spawn the npcs with custom npc weapons we have installed.
    You can go edit the place where it says wpn[] or something and add in your own using that example.

    Edited:

    Can you devise some way to let us add ourr own weapons without disrupting the lua? Since editing it means that the svn won't update correctly.

  22. Post #22
    BassPwnsYou's Avatar
    September 2007
    16 Posts
    I've already got a method setup for using the default list of NPC weapons. At the same time I'm working on taking the regular list of NPCs from the spawn menu, which is why I haven't released it to the SVN yet.

    EDIT: Do you own half-life 2? Try typing ent_create npc_cscanner into the console. If it works there's a bug, if not you don't have the content installed. If the game hangs for a while, then it works try using the tool again. (Gmod will download content from games you own as needed.)

    EDIT EDIT: Revision 7 of the SVN is up, I don't have any custom NPC weapons, so could someone confirm that they appear in the spawnlist? Current known problems include not being able to select no weapon. In the interim you can type squadnpcs_weapon weapon_none into the console to get around it.

  23. Post #23
    bloodien0se's Avatar
    July 2007
    10 Posts
    I don't know what was causing my console errors before, but it had to do with my dedicated server I was running. It works in single player, I've yet to add it back to my server to check it out.

    It would be neat to add this functionality to an NPC Spawning Platform such as this one

  24. Post #24
    BassPwnsYou's Avatar
    September 2007
    16 Posts
    I don't know what was causing my console errors before, but it had to do with my dedicated server I was running. It works in single player, I've yet to add it back to my server to check it out.

    It would be neat to add this functionality to an NPC Spawning Platform such as this one
    I definitely could do that, I don't think it would take more than a couple of minutes, but I'd feel bad ripping off some poor guy's code and redist. with my five minutes of work. Maybe I'll do it anyway.

  25. Post #25
    Aspirin's Avatar
    February 2010
    31 Posts
    I'm awaiting the custom NPC weapons update very patiently.
    Keep up the good work!

  26. Post #26
    Flubascrub
    Flubadoo's Avatar
    August 2009
    10,532 Posts
    Assigning npc that are not on the list are buggy. It only works half the time for npc_citizens with different models (5 second npcs) and works even less with SNPCs (HL:R npcs, Dans).

  27. Post #27
    BassPwnsYou's Avatar
    September 2007
    16 Posts
    Assigning npc that are not on the list are buggy. It only works half the time for npc_citizens with different models (5 second npcs) and works even less with SNPCs (HL:R npcs, Dans).
    All types of citizen are already in the NPC list.

  28. Post #28
    Flubascrub
    Flubadoo's Avatar
    August 2009
    10,532 Posts
    No, I mean things like this:

    It uses npc_citizen as the class, but it almost never works correctly when its assigned a squad using right click.

  29. Post #29
    BassPwnsYou's Avatar
    September 2007
    16 Posts
    No, I mean things like this:

    It uses npc_citizen as the class, but it almost never works correctly when its assigned a squad using right click.
    Right click doesn't work like it's intended to just yet. While technically speaking it works, it doesn't seem to change the behavior of NPCs that were created without the squad being set first. I'm working on it.

  30. Post #30
    Gold Member
    Wizey!'s Avatar
    October 2008
    2,064 Posts
    Wasnt it just as easy to set a key value...
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Dumb Dumb x 1 (list)

  31. Post #31
    BassPwnsYou's Avatar
    September 2007
    16 Posts
    Wasnt it just as easy to set a key value...
    That's all right click does, sets the keyvalue "squadname" to whatever value you apply. That works, and the keyvalue is set if you check it, but it doesn't seem to change their behavior.

  32. Post #32
    Gold Member
    elowin's Avatar
    December 2009
    7,714 Posts
    I would never have imagined that the npc's could get so great, simply by putting them in a squad...

  33. Post #33
    Suggestion:

    'Walk' and 'March Formation' tick boxes. I want to have a bunch of combine just walking and marching.

    Other small ideas;

    Waypoint (select squad member (selects whole squad)) and place some points, they go to them and then go to the next one, map should help if it has nodes so they can navigate to the next node easier.
    Keypad setting (so if I want I can have all squads go at once or I can have it one-by-one keys)

  34. Post #34
    MPSGA's Avatar
    July 2010
    144 Posts
    Are you still developing it?
    Reply With Quote Edit / Delete Reply Estonia Show Events Dumb Dumb x 1 (list)

  35. Post #35

    February 2010
    16 Posts
    I second Black-Ice's suggestion. Implement a waypoint function allowing us to create paths for single and multiple NPCs. And allow them to move in a continuous circle, for example around a builiding, so a map like Big City can appear populated. There are some add-ons that do some of these things but there needs to be something better.
    Reply With Quote Edit / Delete Reply Windows XP United States Show Events Dumb Dumb x 1 (list)