• Welcome Guest, The new Modme forums are here! Please visit here for all recommended information.

Help Spawn Zombies by 1 Side in the same Zone

eDeK

Active member
I have 4 structs ( Up, Down, Left and Right ).
How can i do spawn zombies like "Dead Ops Arcade", by 1 Side or 2 Sides?.
I need a "script_int" to each struct?.
I have a BO1 script of DOA, but im very confused.
Code:
function get_all_the_map_spawners_on_side(side)
{
    spawners = [];

    for (i=0;i<level.zombie_spawners[side].size;i++)
    {
        spawner = level.zombie_spawners[side][i];
        spawners[spawners.size] = spawner;
    }

    return spawners;
}

function get_all_the_map_spawners()
{
    spawners = [];

    top = get_all_the_map_spawners_on_side("top");
    bottom = get_all_the_map_spawners_on_side("bottom");
    left = get_all_the_map_spawners_on_side("left");
    right = get_all_the_map_spawners_on_side("right");

    for (i=0;i<top.size;i++)
    {
        spawners[spawners.size] = top[i];
    }

    for (i=0;i<bottom.size;i++)
    {
        spawners[spawners.size] = bottom[i];
    }

    for (i=0;i<right.size;i++)
    {
        spawners[spawners.size] = right[i];
    }

    for (i=0;i<left.size;i++)
    {
        spawners[spawners.size] = left[i];
    }

    return spawners;
}

function get_opposite_side(side)
{
    if ( side == "top" )

    return "bottom";

    if ( side == "bottom" )

    return "top";

    if ( side == "left" )

    return "right";

    if ( side == "right" )

    return "left"; 
}

function get_random_side()
{
    chance = RandomInt( 4 );

    if( chance == 0 )
    {
        return "top";
    }

    else if( chance == 1 )
    {
        return "bottom";
    }

    else if( chance == 2 )
    {
        return "left";
    }

    else if( chance == 3 )
    {
        return "right";
    }
}

function create_spawn_group( wave_number )
{
    wave = SpawnStruct();
    wave.type = "zombies";
    wave.spawn_duration = 1 + RandomFloatRange( 0, 1 + wave_number * .3 ) + RandomFloatRange( 0, 1 + level.round_number * .2 );
    wave.spawn_delay = .6;
    wave.spawn_side = get_random_side();
    wave.time_till_next_group = 1 + RandomFloatRange( 0, wave.spawn_duration );

    return wave;
}

function setup_spawn_sequence()
{
    level.spawn_sequence = [];
    max = level.zombie_vars["zombie_max_waves"] + (level.arena_laps * level.zombie_vars["zombie_max_waves"]);
    waves = 6 + level.round_number;

    if ( waves > max )
    {
        waves = max;
    }
   
    for( i = 0; i < waves; i++ )
    {
        level.spawn_sequence[i] = create_spawn_group( i );
    }
}
 
Last edited:
Top