Forum

> > CS2D > Maps/Editor > Respawning NPCs
Forums overviewCS2D overview Maps/Editor overviewLog in to reply

English Respawning NPCs

3 replies
To the start Previous 1 Next To the start

old Respawning NPCs

s0ulsh0ck3r101
User Off Offline

Quote
I was wondering if there's a way to respawn NPCs after they die. I plan to use this to respawn zombies for a Resident Evil The Hive custom map I'm making. I've seen this done in a map I think was called zombie land and the head crabs respawned after they were killed. I tried replicating but failed. If theres anything that can help me out I'd be greatful, thanks.

old Re: Respawning NPCs

DC
Admin Off Offline

Quote
It's not documented but cs2d entity env_npc triggers its triggers when the related NPC is killed. Moreover when it is triggered, it spawns a new NPC.

So you can even do respawning very easily with the editor only: Just enter the same name/value for the name and for the trigger field of the NPC. This basically means: The entity will trigger itself when its NPC is killed, making it spawn a new NPC.

Note that if you want to do this with multiple NPC entities, you have to choose unique names for each entity otherwise ALL will spawn new NPCs if ANY NPC is killed.
To the start Previous 1 Next To the start
Log in to reply Maps/Editor overviewCS2D overviewForums overview