Raised This Month: $32 Target: $400
 8% 

[HL2DM] Dynamic NPC Spawner


Post New Thread Reply   
 
Thread Tools Display Modes
Author
almcaeobtac
Senior Member
Join Date: Nov 2008
Location: Florida
Plugin ID:
1840
Plugin Version:
1.1
Plugin Category:
Fun Stuff
Plugin Game:
Half-Life 2 Deathmatch
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Spawns NPCs randomly around the map.
    Old 07-30-2010 , 01:09   [HL2DM] Dynamic NPC Spawner
    Reply With Quote #1

    It's been a really long time since I've uploaded anything, I hope you enjoy this ;)

    ZOMBIES
    The Dynamic NPC Spawner

    Cvars
    z_enabled : 0/1 Enabled or disable the plugin.
    z_population: Chooses the population from which NPCs are spawned.
    z_frequency: Chooses the frequency of which NPCs are spawned.

    Admin Commands
    z_addspawn: Adds a spawnpoint for an NPC to be spawned at. There can be a maximum of 1000 spawnpoints.

    Info
    Do you love spawning NPC's for your players to fight against, but hate the time it takes to spawn them, and turn on their AI? Don't you wish there was an easier way? Wish no more! With this plugin, you have the power to choose where NPCs spawn, when NPCs spawn, and which NPCs spawn, all without lifting a finger! (After the initial setup.) This plugin let's you create specific profiles for NPC populations and NPC spawning frequencies, then choose which profiles should be active. After that, the NPCs spawn at random spawnpoints, and turn on their AI automatically, creating surprise attacks for the players where they least expect them.

    Setup
    1. Add this plugin to your server, then make sure it activates, either by a server restart or a map change.

    2. There should now be 2 cfg files in your server's FTP: cfg/zombiefrequencies.cfg, and cfg/zombiepopulations.cfg

    3. Let's work on the populations first, so open zombiepopulations.cfg

    4. To create a new profile, simply write the name of it on a new line. Let's begin with "default", as this is the profile the plugin looks for by default.

    5. Once you have the profile name on it's own line, go down a line, and add a "{"

    6. Go down one line further. Now you're ready to start adding NPCs that you want to spawn. Simply type an npc name (without the npc_) on it's own line to add that NPC to the population! Let's make our default profile spawn headcrabs and manhacks, so we make one line say "headcrab" and the next line say "manhack".

    7. Let's close our profile with a "}" on the next line. Now we have our default profile done! Let's add another though. So go to the next line.

    8. Let's name our next profile "headcrabs", because with this one, we'll spawn all 3 types of headcrabs!

    9. So now that the profile name is "headcrabs", go to the next line, and put a "{", same as before. Now go down another line, and let's start adding in the NPC names.

    10. We should add "headcrab", "headcrab_black", and "headcrab_fast", all with new lines in between.

    11. Now close the profile with another "}". Great, we've made 2 population profiles! We can switch between the 2 with the cvar z_population, followed by either "default", or "headcrabs", without the quotes! Let's see if we've made the profiles correctly. Do they look like this?

    Code:
    default
    {
    headcrab
    manhack
    }
    headcrabs
    {
    headcrab
    headcrab_black
    headcrab_fast
    }
    If yours looks like that, then you've got the hang of it!

    12. Now let's work on setting up the frequency file, so open zombiefrequencies.cfg now.

    13. Let's make another default profile, so make a line that says "default", then on the next line, put a "{".

    14. Now each frequency profile has 3 values that need to be set. Refire, which is how often the timer fires that spawns the NPCs. Spawns, which is how many NPCs should be spawned every time the timer fires. Max, which is the maximum amount of NPCs that can be spawned with this plugin.

    15. First, let's take care of refire. For our default profile, let's make the timer refire once every minute. So we would write this on a new line: "refire=60". Easy huh?

    16. Next, let's take care of the spawns. Let's only make 1 NPC spawn every time the timer fires (every minute), so we would write this on a new line: "spawns=1".

    17. Last, let's put the max. Servers have a way of crashing when there are thousands of NPCs spawned, so for the sake of the server, let's make the maximum amount of NPCs that are able to be spawned relatively low. Write this on a new line: "max=100". When the plugin realizes that 100 NPCs exist on the map, it won't spawn any new ones until some of the existing ones are removed or killed.

    18. Finally close the profile with a "}". Now we have a frequency profile! But let's add another, so we can switch between them. Let's make this one a crazy one!

    19. Go down a line, and name your new profile "apocolypse"! Add a "{" after like before.

    20. This time, for refire, put it as: "refire=10-20". Notice how we have a hyphen now. This means that the timer will refire anywhere in between 10 seconds and 20 seconds. It could refire at 18 seconds, who knows? This is good for adding extra randomness to your NPC spawns, so the players don't know when the next NPC will be spawned.

    21. Now go down a line, and this time for spawns, put it as: "spawns=2-5". Again with the hyphen! This means that any amount in between 2 and 5 can be spawned. At one timer fire, 3 could be spawned. At the next, 5. It's all random!

    22. Now finally, let's do the max. Put it as: "max=300". Max can't use a hyphen, for obvious reasons. But this new maximum will let way more NPCs spawn!

    23. Finally, close the profile with a "}". Let's recap, does it look like this?

    Code:
    default
    {
    refire=60
    spawns=1
    max=100
    }
    apocolypse
    {
    refire=10-20
    spawns=2-5
    max=300
    }
    If it does, then great work! You've finished setting up your config files! If you ever want to add more profiles, you know exactly how to now! You can also switch your frequency with the cvar z_frequency, followed by either "default", or "apocolypse", without the quotes!

    24. Now that we have profiles ready, it doesn't mean NPCs can be spawned. Why you ask? They have nowhere to spawn! So what this means, is any admin with the cheats flag, has to go around the map setting spawnpoints. (NOTE: The entity: info_npc_spawn_destination acts as a spawnpoint.)

    25. Simply type the command: z_addspawn into your console, and a spawnpoint is automatically created right where you are standing! (NOTE: If you want to use flying or hovering NPCs, it's smart to create the spawnpoints a little off the ground, so the NPCs don't spawn in the ground.)

    26. So run or noclip around the map, using z_addspawn to create spawns where you want them!

    27. Finally, if the cvar z_enabled is off, turn it on, and your NPCs will begin to spawn!

    28. To change the NPC attack damage or health, use the built in sk_ commands.

    Notes
    Install THIS if you want to be able to spawn zombies without any problems!

    Changelog

    Version 1.0 : 7/30/10
    Publicly released!

    Version 1.1 : 7/30/10
    Able to be compiled.
    Attached Files
    File Type: sp Get Plugin or Get Source (zombies.sp - 3352 views - 14.5 KB)
    __________________

    Last edited by almcaeobtac; 08-05-2010 at 23:55.
    almcaeobtac is offline
    almcaeobtac
    Senior Member
    Join Date: Nov 2008
    Location: Florida
    Old 07-30-2010 , 15:34   Re: Dynamic NPC Spawner
    Reply With Quote #2

    Woops, fixed it so it can be compiled.
    __________________
    almcaeobtac is offline
    SolidSpark
    Junior Member
    Join Date: Dec 2009
    Location: SparksVille
    Old 07-30-2010 , 17:12   Re: Dynamic NPC Spawner
    Reply With Quote #3

    Alm..Friken Amazing

    -Solid Spark
    SolidSpark is offline
    Monkeys
    Veteran Member
    Join Date: Jan 2010
    Old 08-02-2010 , 22:10   Re: [HL2DM] Dynamic NPC Spawner
    Reply With Quote #4

    Does this still crash Windows-run servers? (Zombies crash Windows)
    __________________
    Get a lid on that zombie,
    he's never gonna be alri-i-ight.
    Oooh get a lid on that zombie,
    or he's gonna feed all night.
    Monkeys is offline
    almcaeobtac
    Senior Member
    Join Date: Nov 2008
    Location: Florida
    Old 08-03-2010 , 01:38   Re: [HL2DM] Dynamic NPC Spawner
    Reply With Quote #5

    Yes, how would I make them not crash in the plugin?
    __________________
    almcaeobtac is offline
    asherkin
    SourceMod Developer
    Join Date: Aug 2009
    Location: OnGameFrame()
    Old 08-03-2010 , 07:10   Re: [HL2DM] Dynamic NPC Spawner
    Reply With Quote #6

    You could include a link to my SourceMod extension: HL2:DM Zombie Crash Fix.
    __________________

    Last edited by asherkin; 08-05-2010 at 23:38.
    asherkin is offline
    almcaeobtac
    Senior Member
    Join Date: Nov 2008
    Location: Florida
    Old 08-03-2010 , 20:51   Re: [HL2DM] Dynamic NPC Spawner
    Reply With Quote #7

    Thank you very much!
    __________________
    almcaeobtac is offline
    ^eXeC
    Junior Member
    Join Date: May 2010
    Location: Vilnius
    Old 08-19-2010 , 13:07   Re: [HL2DM] Dynamic NPC Spawner
    Reply With Quote #8

    The NPC's that are spawned by this plugin doesn't makes sounds. Can you fix that? Or there is something wrong with my server? Only manhack makes his sounds. But for example headcrab attacks without any sound. Same with antlions when they are flying or antlionguards.

    BTW, Can you make that you would get points if you kill an NPC. It would be great ability for some servers. Or make that the admin could choose if he wants the points by setting the CVAR 0 to 1
    __________________


    Last edited by ^eXeC; 08-20-2010 at 16:43.
    ^eXeC is offline
    Send a message via Skype™ to ^eXeC
    asherkin
    SourceMod Developer
    Join Date: Aug 2009
    Location: OnGameFrame()
    Old 08-19-2010 , 15:32   Re: [HL2DM] Dynamic NPC Spawner
    Reply With Quote #9

    IIRC, you need to upload a load of the script files from the HL2:DM client install, there are quite a lot of files missing from the dedicated server package (such as the files needed to support the airboat).
    __________________

    Last edited by asherkin; 08-19-2010 at 15:39.
    asherkin is offline
    Syle22
    Junior Member
    Join Date: Jul 2009
    Old 08-23-2010 , 19:58   Re: [HL2DM] Dynamic NPC Spawner
    Reply With Quote #10

    alm great work as always
    __________________

    Syle22 is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 18:55.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode