Trying to create Custom NPC without using Nextbot

Hi all,

I’m trying to create a custom NPC that extends from base_ai, based on a custom NPC I downloaded for Gmod around version 9.

The reason I want to stray away from Nextbot is that it doesn’t seem too compatible with most existing models, such as citizens and whatnot. Also, I see a lot of people complaining about the lack of functionality.

Now, once I start attempting to use functions like SetHull (basically any NPC-related functions), it’s telling me that the function is nil and doesn’t exist. Which leads me to believe it’s not actually inheriting from base_ai. (yes, I have Base set to “base_ai”).

When I get home from work, I’ll post my existing code.

Now, one thing I did differently–Instead of having a cl_init, init, and shared set of lua files, I just have one file/class named “MyNPCBuddy.lua”. It runs/spawns just fine if I don’t have any NPC-specific function calls.

Do I still need to use the legacy format of the three files?

Edit: I’m not too experienced with Gmod/Lua in particular, but not to programming itself.

  1. The SNPC base is broken, so if you are going to use it, you have to remake everything and this includes the animation system.
  2. You don’t need the cl_init and all that it is there just to make the files look organized and clean.
  3. You can use a base that I have made, you can download it from workshop: Steam Workshop::VJ Base

I’m digging through your code base, it’s very extensive!

I’m looking for a specific function: “VJ_SetSchedule”. I can’t seem to find it in any of the includes?

Well when I said you can use my base, I don’t mean go and take parts of it. The base has way too many files to even be able to take something. You can easily create SNPCs with the base, you just need to know how to set up the files. There is a tutorial and links that can help you set it up.
Here is a link to addons using the base (You can use them as an examples):
http://steamcommunity.com/sharedfiles/filedetails/?id=455199067
Here are some important links:

And please don’t forget to read the rules:

I’m more so just tracing down through your file structure to get an idea of how you started. Ripping code off ain’t my style, so no worries there

Well if you want just use the base like everyone else that wanted to make SNPCs, it’s really easy to use, I mean look at all the addons that people have made with and this list is just some of it: http://steamcommunity.com/sharedfiles/filedetails/?id=455199067