Zombie Marker Spawning

bubba752

New Member
Basically heres the current script:

Code:
_units = ["RyanZombieC_man_1slow", "RyanZombieC_man_polo_1_Fslow", "RyanZombieC_man_polo_2_Fslow", "RyanZombieC_man_polo_4_Fslow", "RyanZombieC_man_polo_5_Fslow", "RyanZombieC_man_polo_6_Fslow", "RyanZombieC_man_p_fugitive_Fslow", "RyanZombieC_man_w_worker_Fslow", "RyanZombieC_scientist_Fslow", "RyanZombieC_man_hunter_1_Fslow", "RyanZombieC_man_pilot_Fslow", "RyanZombieC_journalist_Fslow", "RyanZombieC_Orestesslow", "RyanZombieC_Nikosslow", "RyanZombieB_Soldier_02_fslow", "RyanZombieB_Soldier_02_f_1slow", "RyanZombieB_Soldier_02_f_1_1slow", "RyanZombieB_Soldier_03_fslow", "RyanZombieB_Soldier_03_f_1slow", "RyanZombieB_Soldier_03_f_1_1slow", "RyanZombieB_Soldier_04_fslow", "RyanZombieB_Soldier_04_f_1slow", "RyanZombieB_Soldier_04_f_1_1slow", "RyanZombieB_Soldier_lite_Fslow", "RyanZombieB_Soldier_lite_F_1slow","RyanZombieSpider1"];

_marker = zombiemkr select 0;

    while {true} do {
        {
            if (player distance getmarkerpos _x < player distance getmarkerpos _marker) then
            {
                _marker = _x;
            };
            sleep 0.01;
        }foreach zombiemkr;

        if (player distance getmarkerpos _marker < markerdist) then
        {
            if (count zarray < zombielimit) then {
                _pos = [(position player select 0) + floor (random 400)-200, (position player select 1) +floor (random 400)-200, 0];
                _type = _units call BIS_fnc_selectRandom;
                _type createUnit [_pos, groupZMB,"[this]spawn fncZcontact;"];
                sleep 0.2;
            };
        }
        else {sleep 3;};
        sleep 1;
        _rand = floor (random 2);
        if (count zarray >2 && _rand > 0) then
        {
            _one = zarray call BIS_fnc_selectRandom;
        };

    };

And what it does is selects markers from "zombiemkr" and allows zombies to ONLY spawn in those areas. What we would like is to have them spawn EVERYWHERE, BUT the specified markers. For example I want zeds everywhere except in a marker that I call zedmkr1. In zedmkr1 I want NO zombies to spawn there. I know it would be a pretty simple change, but I can't seem to really grasp what I would need to change. Thanks in advance and I hope I'm able to get help on this matter!
 
i put your code into a pastebin so we would have some line numbers
http://pastebin.com/1WZszd6m

look line 14, the if statement that spawns zombies if the player is near the marker.
line 23 is the else clause that does nothing becuase player is outside of spawn marker.
switch those 2 blocks so the block that executes if the player is within marker distance, does nothing. and the else clause where player is outside of marker it spawns zombies.
 
Last edited:
Back
Top