Jump to content

Mapping Issue: Creating NPC Spawn Button


Recommended Posts


I've been out of the game for a while now, and I've got quite a bit rusty as a result. I remember years ago having some luck with this, but I just can't quite get it to go now. Could someone give me the step by step to creating a functioning NPC spawn switch in a map? I've done it with vehicles before, but I'm not having much luck with regular npcs. 

Link to comment

Create a trigger_multiple for the button (Don't forget a wait key on it). Target it at an npc_spawner entity.

On the npc_spawner, I forget the key name that determines the NPC to be spawned, but i think it's npc_type. And you may need to set the count value to -1.

Link to comment

Also - make sure the trigger_multiple is set to trigger by the conditions you want. By default, a trigger_multiple will fire it's target whenever a player touches it. If you want players to have to press the "Use" button on the trigger, you'll need to set the player_use spawnflag.

If nothing works, post a link to your map file, and someone here can definitely tell you what's wrong.

MagSul likes this
Link to comment

Ah that did it! I knew the problem was probably something really simple. Thanks! My problem was that I was (probably) selecting the spawner FIRST, and then the trigger_multiple. Now for one more issue if you folks have the time: I also need a button that spawns multiple NPCs at once. I recall there being SOMETHING about a team function, but I just can't dig up the specifics. 

Link to comment

The team key is used for doors, to make them move together in sync. In case one door is blocked and reverses, all other doors on the team will do the same.

If you want more than one spawner to be fired by that button, just give the other spawner the same targetname as the first one. When a trigger is fired, it will fire every entity with a targetname that matches it's target.

The easiest way to do this is just to copy and paste your current npc_spawner - it will keep the targetname. Then you can change the other parameters however you need.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...