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

Editing spawns

broken avatar :(
Created 11 years ago
by Soy-Yo
0 Members and 1 Guest are viewing this topic.
2,120 views
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
Maybe what I'm trying to do is impossible but I was trying to edit the way zombies spawn for my map because I can't have so many zombie ents (g-spawn :P).

I have a zone that covers all the map and one zombie targeted to hat zone. I'm only using risers and all of them are normal risers. Then I edited this function in _zombiemode_zone_manager.gsc:
Code Snippet
Plaintext
manage_zones( initial_zone )
Just before the else I changed this:
Code Snippet
Plaintext
// activate any associated zombie_rise locations
if ( level.zones[ zone_name ].rise_locations.size > 0 ) // level.zones[ zone_name ].rise_locations.size == 9
{
    // Soy-yo's edit
    level.zombie_rise_spawners = []; // restart variable
    if( true )//if( no_dupes ) Soy-yo's edit: leave this here; maybe need to re-edit
    {
        for(x=0; x<level.zones[ zone_name ].rise_locations.size; x++)
{
            // Soy-yo's edit
            unlock = false;
            level.zones[ zone_name ].rise_locations[x].locked_spawner = true;
            unlock = maps\cube::checkCanActivateStruct(level.zones[ zone_name ].rise_locations[x]); // only get structs in a cube where a player is
            if( unlock ) {                           
                level.zones[ zone_name ].rise_locations[x].locked_spawner = false;
                level.zombie_rise_spawners[ level.zombie_rise_spawners.size ] = level.zones[ zone_name ].rise_locations[x];
            }
}
    }
}
And for this line:
Code Snippet
Plaintext
unlock = maps\cube::checkCanActivateStruct(level.zones[ zone_name ].rise_locations[x]); // only get structs in a cube where a player is
I have this function:
Code Snippet
Plaintext
checkCanActivateStruct(struct) {
    cube = check_point_in_active_zone(struct,true);
    players = get_players();
    for( i = 0; i < players.size; i++) {
        if( !isDefined( players[i].isInCube ) ) continue;
        if( cube == players[i].isInCube ) return true;
    }
    return false;
}
"player.isInCube" has the number of the cube where the player is; and "check_point_in_active_zone()" return the zone where the struct is.

Well, and the problem here is that zombies continue spawning all over the map. Then I checked how many times "checkCanActivateStruct()" is called and it's only called with the first struct. :-\

Maybe I misunderstood the function or there's something wrong there I can't see.
Hope you understand what I'm trying to explain, and thank you for any help. :)
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I really don't understand why you are getting g-spawn with less than 500 ents, but if you are getting it so often, then you will want to check coop, cause I thought I fixed mine and a few more players brought it back. Also, make sure your not using glowing eyes on zombies, that spawns an ent too. You could also disable gibbing, by setting each zombie to gibbed already, which should help.



Did you check what your function is returning? That continue should not be there, cause that can cause undefined, which will make all structs available for spawning. Perhaps print something or make false? Also you may need to add something else that then locks them again if it returns false.

Code Snippet
Plaintext
// activate any associated zombie_rise locations
if ( level.zones[ zone_name ].rise_locations.size > 0 ) // level.zones[ zone_name ].rise_locations.size == 9
{
    // Soy-yo's edit
    level.zombie_rise_spawners = []; // restart variable
    if( true )//if( no_dupes ) Soy-yo's edit: leave this here; maybe need to re-edit
    {
        for(x=0; x<level.zones[ zone_name ].rise_locations.size; x++)
{
            // Soy-yo's edit
            unlock = false;
            level.zones[ zone_name ].rise_locations[x].locked_spawner = true;
            unlock = maps\cube::checkCanActivateStruct(level.zones[ zone_name ].rise_locations[x]); // only get structs in a cube where a player is
            if(isdefined(unlock)){
                iprintlnbold(unlock, " lock status");
            }else{
                iprintlnbold("unlock not defined");
            }
            wait(.4);//added so you can see the prints. remove then
            if( unlock ) {                           
                level.zones[ zone_name ].rise_locations[x].locked_spawner = false;
                level.zombie_rise_spawners[ level.zombie_rise_spawners.size ] = level.zones[ zone_name ].rise_locations[x];
            }else{
                level.zones[ zone_name ].rise_locations[x].locked_spawner = true;
                //maybe use array_remove for the level.zombie_rise_spawners array if you are still using it...?
            }
}
    }
}





As far as editing the existing script, its up to you, but might just be easier to make your own spawning system. Then you don't need zones or script_flags or anything. I'm not even sure how your script_flags are working then with only one zone on the whole map, which is how it locks and unlocks spawn points I thought...

You could make them reg zombies spawning, or risers, at structs with some fx, similar to deadship. A custom spawning system could be implemented with script_structs in the center of the cubes, you could get the struct that is closest to each player, basically establishing which cube they are in, and with kvps, get all the other structs and lock or unlock those structs in each cube for spawning or just update a level array for zombiemode gsc. Then just modify the script that spawns zombies in zombiemode gsc, and maybe an edit or two in spawner gsc for no windows needed on normal zombies.

Last Edit: October 20, 2015, 04:10:47 pm by MakeCents
Marked as best answer by Soy-Yo 11 years ago
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
I did the test and unlock was defined and true, don't know why, because I've just found the bug in the script:
Code Snippet
Plaintext
cube = check_point_in_active_zone(struct,true);
This function needs an origin for first parameter and I was passing it the entity. :facepalm2: Now everything works.

I really don't understand why you are getting g-spawn with less than 500 ents, but if you are getting it so often, then you will want to check coop, cause I thought I fixed mine and a few more players brought it back. Also, make sure your not using glowing eyes on zombies, that spawns an ent too. You could also disable gibbing, by setting each zombie to gibbed already, which should help.
I had less than 500 when I didn't have the triggers for the doors. Now I have near 800. :gusta: I'm not getting g-spawn now, but I want to have at least 100 free entities to add perks and stuff and so the map is playable and you don't get g-spawn with two zombies. :D

As far as editing the existing script, its up to you, but might just be easier to make your own spawning system. Then you don't need zones or script_flags or anything. I'm not even sure how your script_flags are working then with only one zone on the whole map, which is how it locks and unlocks spawn points I thought...

You could make them reg zombies spawning, or risers, at structs with some fx, similar to deadship. A custom spawning system could be implemented with script_structs in the center of the cubes, you could get the struct that is closest to each player, basically establishing which cube they are in, and with kvps, get all the other structs and lock or unlock those structs in each cube for spawning or just update a level array for zombiemode gsc. Then just modify the script that spawns zombies in zombiemode gsc, and maybe an edit or two in spawner gsc for no windows needed on normal zombies.
:poker: LOL. I've been reading spawn functions the last two days to learn how they work and do this and I just understood a bit of them. I don't want to mess anything up. ::) "If something works, don't touch it". :D
Last Edit: October 20, 2015, 05:35:48 pm by Soy-Yo
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
It was true cause of the bug. That is why they were spawning from everywhere. That is why I said to add the println
cube was most likely undefined and here would return true:
Code Snippet
Plaintext
if( cube == players[i].isInCube ) return true;

I would remove those triggers, and do an alternative method, if you added 300-400, holy crap. Something that checks the distance of players instead.


"If something works, don't touch it". :D

Sure, if you get it working this way.
Last Edit: October 20, 2015, 05:44:51 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
I really don't understand why you are getting g-spawn with less than 500 ents, but if you are getting it so often, then you will want to check coop, cause I thought I fixed mine and a few more players brought it back. Also, make sure your not using glowing eyes on zombies, that spawns an ent too. You could also disable gibbing, by setting each zombie to gibbed already, which should help.



Did you check what your function is returning? That continue should not be there, cause that can cause undefined, which will make all structs available for spawning. Perhaps print something or make false? Also you may need to add something else that then locks them again if it returns false.

Code Snippet
Plaintext
// activate any associated zombie_rise locations
if ( level.zones[ zone_name ].rise_locations.size > 0 ) // level.zones[ zone_name ].rise_locations.size == 9
{
    // Soy-yo's edit
    level.zombie_rise_spawners = []; // restart variable
    if( true )//if( no_dupes ) Soy-yo's edit: leave this here; maybe need to re-edit
    {
        for(x=0; x<level.zones[ zone_name ].rise_locations.size; x++)
{
            // Soy-yo's edit
            unlock = false;
            level.zones[ zone_name ].rise_locations[x].locked_spawner = true;
            unlock = maps\cube::checkCanActivateStruct(level.zones[ zone_name ].rise_locations[x]); // only get structs in a cube where a player is
            if(isdefined(unlock)){
                iprintlnbold(unlock, " lock status");
            }else{
                iprintlnbold("unlock not defined");
            }
            wait(.4);//added so you can see the prints. remove then
            if( unlock ) {                           
                level.zones[ zone_name ].rise_locations[x].locked_spawner = false;
                level.zombie_rise_spawners[ level.zombie_rise_spawners.size ] = level.zones[ zone_name ].rise_locations[x];
            }else{
                level.zones[ zone_name ].rise_locations[x].locked_spawner = true;
                //maybe use array_remove for the level.zombie_rise_spawners array if you are still using it...?
            }
}
    }
}





As far as editing the existing script, its up to you, but might just be easier to make your own spawning system. Then you don't need zones or script_flags or anything. I'm not even sure how your script_flags are working then with only one zone on the whole map, which is how it locks and unlocks spawn points I thought...

You could make them reg zombies spawning, or risers, at structs with some fx, similar to deadship. A custom spawning system could be implemented with script_structs in the center of the cubes, you could get the struct that is closest to each player, basically establishing which cube they are in, and with kvps, get all the other structs and lock or unlock those structs in each cube for spawning or just update a level array for zombiemode gsc. Then just modify the script that spawns zombies in zombiemode gsc, and maybe an edit or two in spawner gsc for no windows needed on normal zombies.

redspace informs me he also found some potential Gspawns with the treyarch code for this

He said this :

Quote
Yeah like for the eye glow it was assigned to a zombie ent but it did not always get deleted. When I made it local and ran a loop that runs for the duration the ai is alive, and run delete after the loop broke, the eye ent deleted fine. I've had a few other situations like this before to


he mentioned another with risers, if you kill em too quick apparently the anchor doesnt get deleted
Last Edit: October 23, 2015, 07:23:53 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
redspace informs me he also found some potential Gspawns with the treyarch code for this

He said this :
Yeah like for the eye glow it was assigned to a zombie ent but it did not always get deleted. When I made it local and ran a loop that runs for the duration the ai is alive, and run delete after the loop broke, the eye ent deleted fine. I've had a few other situations like this before to


he mentioned another with risers, if you kill em too quick apparently the anchor doesnt get deleted
Cool, then. :D Thanks for the info. I'll try to make something to make sure those things get deleted or something. I don't want people to get g-spawn on round 10. :D

 
Loading ...