Modme Forums

Temporarily prevent drops from dropping in a zone?

Game Modding | Call of Duty: Black Ops 3 | Scripting


Sleepy216:

Is there a simple way to stop drops from dropping in a specific zone, but only for a short time?
I didn't see any kind of disable zone function in the zm_zonemgr.
I tried:

zone = level.zones[ "start_zone" ];
    zone.is_enabled = false;
    zone.is_active = false;    
which did disable the zone for players(not something I needed, but not an issue for what I'm going for either), but drops could still drop there regardless.
I saw killjoy mention a kvp that can make drops not spawn in a zone, but they didn't know it off hand, the op of the thread said the recommended one didn't work.
Plus I don't need them to permanently not spawn in a zone, just for a limited time.

I also tried just moving the zone out of the way with MoveZ, but that didn't move the zone. I also tried linking the zone to a struct and then moving the stuct, that also didn't work.
I made sure to enablelinkto before linking the zone to the struct.

Any thoughts on what I could do? Would I be better off just doing something similar to the parsites and have them pulled into an area I do want them to drop?
I guess now that I think about it, that would be super easy. I could've already had it done in the time I've wasted messing with disabling drops.. But I kind of would prefer to know how to disbale drops in a zone if possible.
Thanks for your time regardless!


eDeK:

This can be the worst method to do it, but is a option.
Delete the powerup if is touching the zone.

level.nopowerupsnow = false; // Use this line when you want to "turn off" delete powerups
level.nopowerupsnow = true; // Use this line when you want to "turn on" delete powerups
level thread no_powerups_for_x_time_x_zone(); 
function no_powerups_for_x_time_x_zone()
{
    level endon( "end_game" );

    for( ;; )
    {
        level waittill( "powerup_dropped", powerup );

        powerup thread xcheck_this_powerupx();
    }
}

function xcheck_this_powerupx()
{
    self endon( "powerup_grabbed" );

    self endon( "powerup_timedout" );

    zone = level.zones[ "YOUR_ZONE_NAME" ]; // Put your zone name

    while( 1 )
    {
        if( !isdefined( self ) )
        {    
            break;    
        }

        if( isdefined( self ) && self IsTouching( zone ) && IS_TRUE( level.nopowerupsnow ) )
        {
            self Delete();    

            break;    
        }

        WAIT_SERVER_FRAME;
    }
}
NOTE: If the powerup spawn in your face killing a zombie, probably you can grab it. xD


Sleepy216:

This can be the worst method to do it, but is a option.
Delete the powerup if is touching the zone.

That's a good idea actually. I added a check to the powerups.gsc that if my gamemode is active, and the drop is in the zone I don't want drops in, it drags it into the new playable area.
I get so fixated on doing something a certain way I go blind haha. I'm gonna look in the powerups.gsc again. I'm 99% sure I can add a check before it spawns and just not let it spawn to begin with instead of deleting it after it spawns, that way people won't see it get deleted. If I can't add check to not let them spawn, I can just delete it like you suggested.
Thanks so much for helping out!

Edit. So you can indeed just add your own check and then the drop just wont spawn! It works just how I wanted. The sad part is I just needed to move my original check up literally 10 lines from where it was, and change what runs to:
level.powerup_drop_count--;
        powerup delete();
        return;
instead of running my drop_move function haha.


Harry Bo21:

Create a volume and give it the kvp for no drops

Put it over your zone

Either hide / unhide or move it miles under when needed


Look in _zm you’ll find the kvp


Sleepy216:

Create a volume and give it the kvp for no drops

Put it over your zone

Either hide / unhide or move it miles under when needed


Look in _zm you’ll find the kvp

In normal _zm.gsc?
I ctrl F searched:
no drops, no_drops, drop, powerup, targetname, and kvp.
None lead to anything related to checking drops in a zone. The only thing that even mentioned drops was the init of the powerups script.
I appreciate the input, I'll probably spend some time looking through other zm related scripts to see if I can find it at another time


eDeK:

I think Harry is talking about this, maybe im wrong:

_zm_spawner.gsc
function zombie_can_drop_powerups( zombie )
{
    if( zm_utility::is_tactical_grenade( zombie.damageweapon ) || !level flag::get( "zombie_drop_powerups" ) )
    {
        return false;
    }

    if ( isdefined(zombie.no_powerups) && zombie.no_powerups )
    {
        return false;
    }

    if( IS_TRUE(level.no_powerups) )
    {
        return( false );
    }

    if ( IS_TRUE( level.use_powerup_volumes ) )
    {
        volumes = GetEntArray( "no_powerups", "targetname" ); <-----------------------------------------------
        foreach( volume in volumes )
        {
            if ( zombie IsTouching( volume ) )
            {
                return false;
            }
        }
    }

    return true;
}


Sleepy216:

I think Harry is talking about this, maybe im wrong:
_zm_spawner.gsc
function zombie_can_drop_powerups( zombie )
{
    if( zm_utility::is_tactical_grenade( zombie.damageweapon ) || !level flag::get( "zombie_drop_powerups" ) )
    {
        return false;
    }

    if ( isdefined(zombie.no_powerups) && zombie.no_powerups )
    {
        return false;
    }

    if( IS_TRUE(level.no_powerups) )
    {
        return( false );
    }

    if ( IS_TRUE( level.use_powerup_volumes ) )
    {
        volumes = GetEntArray( "no_powerups", "targetname" ); <-----------------------------------------------
        foreach( volume in volumes )
        {
            if ( zombie IsTouching( volume ) )
            {
                return false;
            }
        }
    }

    return true;
}

What a boss! I'm 99.99% sure that's what he was talking about! That will be great for future maps and plans i have! Thanks for taking the time to look for it!


Harry Bo21:

What a boss! I'm 99.99% sure that's what he was talking about! That will be great for future maps and plans i have! Thanks for taking the time to look for it!

“Targetname” “no_powerups” judging by what he posted

Literally just move the volume as and when you need

Might even work with hide()/show()

And yea that is the function that checks for it yea

Thx for that, not at a computer to check

You can also put these over your windows and shit to stop power ups out of bounds

Make sure to give it another kvp so you can grab it, like a script_noteworthy