UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

How do I enable/disable infinite zombie spawns via scripting? [SOLVED FOR DOGS]

broken avatar :(
Created 2 years ago
by Chadric273
0 Members and 1 Guest are viewing this topic.
949 views
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 months ago
Posts
40
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Chadric273's Groups
Chadric273's Contact & Social Linkschadric.hjellming
As the title states, I basically am wondering how to enable/disable infinite zombie spawning. My example is basically while a player is standing in a specific trigger_multiple, I want zombies to spawn infinitely. Once the player leaves the trigger_multiple, I want the infinite zombie spawning to return to normal spawning. Any ideas?
Last Edit: May 25, 2022, 12:02:37 am by Chadric273
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 months ago
Posts
40
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Chadric273's Groups
Chadric273's Contact & Social Linkschadric.hjellming
If anyone else is wondering this, I did manage to figure this out for infite dog spawns.
 
You need to place a trigger_multiple in your level that covers the entire area that the player will go into to trigger the infite dog spawning function. Give this trigger the kvp:
 
Targetname : InfiniteDogSpawn
 
Then in your zm_MAPNAME.gsc, at the top of the file, if this line is not found anywhere within your hashtags, put this:
 
Code Snippet
Plaintext
#using scripts\zm\_zm_ai_dogs;

Then in zm_MAPNAME.gsc, in your main function, put this at the bottom:
 
Code Snippet
Plaintext
thread infinite_dogspawn_area();

Then at the bottom of your zm_MAPNAME.gsc, place this:
 
Code Snippet
Plaintext
function infinite_dogspawn_area()
{
    while(true)
    {
        spawndogs = GetEnt("InfiniteDogSpawn", "targetname");
        spawndogs waittill("trigger", player);
        if(player IsTouching(spawndogs))
        {
            zm_ai_dogs::special_dog_spawn(1);
        }
        else
        {
            zm_ai_dogs::special_dog_spawn(0);
        }
        wait 0.05;
    }
   
}
NOTE: this will cause infite dogs to spawn anywhere in the map where there are any players and not only in the area with the trigger_multiple. The moment all players have left the area with the trigger_multiple, then the infinte dog spawning will end. It might not be a bad idea to somehow make it obvious within the map the area that triggers infinte dog spawns, but that is only a suggestion.
 
NOTE: this code is set up in a way where you can only have one trigger_multiple in your map. Two ways around this...draw every spot that you wish to be the areas which will trigger the spawning. Select all the areas at the same time and right click and do "trigger-->multiple". This will make all the areas be "one entity". The second way around this is to modify the could so you use a GetEntArry and then do a "foreach" function.
 
Happy map making!
Last Edit: June 02, 2022, 01:57:25 am by Chadric273
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 7 February 2023
Last active: 1 year ago
Posts
11
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
wal hala's Groups
wal hala's Contact & Social Links
i can send u later my script i used for one of my maps as alarm. if a player walks accros the trigger it enables 30 seconds infinite spawning. if you want to stop it when leaving the trigger just set the wait to 0
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 months ago
Posts
40
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Chadric273's Groups
Chadric273's Contact & Social Linkschadric.hjellming
That would be wonderful! I'd love to see how you did it.

 
Loading ...