Spawn NPCs on the press of a button

Well, the title pretty much sums it up. But have a few questions.

I would pretty much would like to know how to add custom npc’s and make them spawnable by the press of a button. I’ve tried so many things but have failed.
If anyone can link me some tutorials that can give me exactly what I want or can just help me out in this thread, it’d be greatly appreciated. :smile:

I’m using hammer in Garry’s Mod’s bin folder.

im still a noob at hammer

you cant really have custom npcs on your map. as to how to make them spawn, heres what you do.

(this will take a bit to get together, give me a min or two)

[editline]5th September 2016[/editline]

(if you need me to clarify any part, do let me know.)

Ok so first off, create your npc. give him a name, just a simple name, like what i did here.

Imgur

Now, Create a point_template (which is an entity, created from the entity tool.)

then, give the template another simple name. then, on the Template 1 box, put in the name of the npc.

Imgur

Now, pick the nodraw texture from the texture browser and then create a rectangle (8x4) is the best, the thickness of it doesnt matter)

Now go into the texture browser, search button and then grab the texture with the red dot in the middle. It doesnt really matter which texture you use, but this is a tutorial, im not going to give oyu every nook and cranny of mapping. now select the texture application tool, and right click on the faces that people will be able to see.

Nooooooow you click on the button with the selector tool, press Ctrl + T, type func_button, press enter twice. then, go into outputs, and click add. in order from the top box to the bottom, do this:



OnPressed
(Point_template name)
ForceSpawn

Imgur

[editline]5th September 2016[/editline]

god dammit i went to put the imgur links in an edit since they dont support it, but i got a security check and now its gone. the links are not in my history either…

Worked like a charm, thank you so much!