d_eisenga Posted June 13, 2004 Share Posted June 13, 2004 i want to make a map where a new NPC is spawned every X seconds(but only if there arent already X NPCs on the map). i know you can spawn a new NPC when en existing NPC dies but that requires you to put all the NPCs into the map and link them to eachother, and that means the level isnt 'endless', which is what i'm going for. kinda like an exhaustion or endurance level. so i thought, i'll just run a script which will wait X seconds and spawn an NPC, and repeat that process forever. but i cant find a command in behaved to spawn an npc, or to check for the current number of npcs(though i suppose i could use a counter for that.) can anyone help? Link to comment Share on other sites More sharing options...
snife Posted June 13, 2004 Share Posted June 13, 2004 Try this: Mark all NPC then give them: key:count value:100000000000 or how many times u want the npc to spawn and: key:tagetname value:npc ______________________________ then make a func_timer give it: value:count key: how many sec u want and: value:target key:npc that would do it,,,,, Link to comment Share on other sites More sharing options...
d_eisenga Posted June 13, 2004 Author Share Posted June 13, 2004 thanks, i'll try that right away Link to comment Share on other sites More sharing options...
GothiX Posted June 13, 2004 Share Posted June 13, 2004 Count -1 would work better. Link to comment Share on other sites More sharing options...
d_eisenga Posted June 13, 2004 Author Share Posted June 13, 2004 yes, it works perfectly! thanks a lot. one more thing though, with all those npcs getting killed, a lot of dead bodies and dropped weapons pile up on my map. the bodies disappear(if only when they go off-screen) but the weapons dont disappear unless i pick them up, and this level is designed to be played mostly with the saber. how do i make these disappear(at least the weapons but the bodies too if possible)? thanks! Link to comment Share on other sites More sharing options...
zag Posted June 14, 2004 Share Posted June 14, 2004 make shader with the surfaceparm "nodrop" any one that dies inside of this brush wont drop a weapon i think Link to comment Share on other sites More sharing options...
{NJO}*Dark Posted June 14, 2004 Share Posted June 14, 2004 Do you want there to always be X number of npcs? If so then you just have it spawn its self every time it dies. There are two ways, either have X number of npc that spawn them selves or have one that will spawn x times at the beginning then spawn as you go along Zag, there is already a shader like that in textures/system/nodrop Link to comment Share on other sites More sharing options...
d_eisenga Posted June 14, 2004 Author Share Posted June 14, 2004 thanks guys. i considerd doing the spawning that way, but i dont want the number of NPCs to be constant. i just want a maximum. but the way the level is designed it shouldnt be possible to crash the game with too many NPCs so i dont need to limit it. Link to comment Share on other sites More sharing options...
{NJO}*Dark Posted June 15, 2004 Share Posted June 15, 2004 you should be carefull though, more that about 10 and the game really laggs, just try to limit it and you should be fine Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.