Arma 3
Zombies and Demons
Zombience.sqf




// hint "0";
_i = [] spawn {


_maxZombies = 5;
_distance = 50;
_addMed =1;

_ZombiesSlow= ["RyanZombieC_man_1SlowOpfor","RyanZombieC_man_polo_1_FSlowOpfor","RyanZombieC_man_pilot_FSlowOpfor","RyanZombieC_journalist_FSlowOpfor","RyanZombieC_OrestesSlowOpfor","RyanZombieC_NikosSlowOpfor","RyanZombieC_man_polo_2_FSlowOpfor","RyanZombieC_man_polo_4_FSlowOpfor","RyanZombieC_man_polo_5_FSlowOpfor","RyanZombieC_man_polo_6_FSlowOpfor","RyanZombieC_man_p_fugitive_FSlowOpfor","RyanZombieC_man_w_worker_FSlowOpfor","RyanZombieC_scientist_FSlowOpfor","RyanZombieC_man_hunter_1_FSlowOpfor"];
_ZombiesFast = ["RyanZombieC_man_1MediumOpfor","RyanZombieC_man_polo_1_FMediumOpfor","RyanZombieC_man_pilot_FMediumOpfor","RyanZombieC_journalist_FMediumOpfor","RyanZombieC_OrestesMediumOpfor","RyanZombieC_NikosMediumOpfor","RyanZombieC_man_polo_2_FMediumOpfor","RyanZombieC_man_polo_4_FMediumOpfor","RyanZombieC_man_polo_5_FMediumOpfor","RyanZombieC_man_polo_6_FMediumOpfor","RyanZombieC_man_p_fugitive_FMediumOpfor","RyanZombieC_man_w_worker_FMediumOpfor","RyanZombieC_scientist_FMediumOpfor","RyanZombieC_man_hunter_1_FMediumOpfor"];
_sZedsNum = count _ZombiesSlow;
_mZedsNum = count _ZombiesFast;
_startTime = time;
_initialBurst = 4;
_spawnTroops = true;

// hint "1";
AttackGroup = createGroup east;
while { _spawnTroops } do
{
// hint "2";
if( count units AttackGroup < _maxZombies) then
{
// hint "3";

_fastSlow = random 3;


_ZedType = _ZombiesSlow select (floor ( random _sZedsNum ));

if ( _fastSlow > 2 and _addMed == 1) then
{
_ZedType =_ZombiesFast select (floor ( random _mZedsNum ));

};



_plusX = random 2;
if(_plusX > 1 ) then
{
_plusX = 1;
};
if(_plusX < 1) then {
_plusX = -1;
};

_plusY = random 2;
if(_plusY >1 ) then
{
_plusY = 1;
};
if(_plusY < 1) then {
_plusY = -1;
};

_posY = 50 + random _distance;
_posX = 50 + random _distance;

_posY = _posY * _plusY;
_posX = _posX * _plusX;


spawnPos = getPos Player;
spawnPos = [(spawnPos select 0) + _posX, (spawnPos select 1) + _posY, 0];
objPos = getPos Player;

// hint "4";
unit1 = AttackGroup createUnit [_ZedType, spawnPos, [], 1, "FORM"];
// hint "5";


wp = AttackGroup addWaypoint [objPos,0];
wp setWaypointSpeed "Full";
wp setWaypointType "MOVE";
wp setWaypointBehaviour "COMBAT";


};
if( !Alive player) then
{
_spawnTroops = false;
};
sleep 30;
};
};

Last edited by CaptainMittens; 3 Nov, 2015 @ 8:31am
< >
Showing 1-15 of 30 comments
CaptainMittens 21 Sep, 2015 @ 1:23pm 
Hey, if anyone has any improvements let me know. It's a light weight spawner that doesn't hit the server as hard. Also, because the clients are spawning the zeds, it causes the players to do the AI processing for the zombies, so it helps distribute some of the CPU load off of the server (sort of like mini headless clients, but with heads :D ).

The idea is it creates an ambience of a few zeds around the players at all times, a Zombience if you will :).

This it supposed to be combined with the included spawners, so they can be more like events, and this can just keep a few zeds lingering around to keep players on their toes and moving.
Last edited by CaptainMittens; 21 Sep, 2015 @ 1:25pm
CaptainMittens 21 Sep, 2015 @ 1:27pm 
If there's some more API like stuff, I'd love to be able to incorporate the crawl out of the ground spawn animation. Also, whatever happens to editor placed zombies that allows them to kill players using ACE would be dope. Right now this has the same effect as the Included spawners where spawned units sometimes can't kill ACE units.

The funny thing is, I have 1 mission where the spawned zombies can kill ACE units, but only the players, not the friendly AI. But I havn't been able to replicate it in other missions even when copying all the ACE settings. It's really frustrating.
Coul 2 Nov, 2015 @ 2:16pm 
This is really cool, thank you so much for this
Last edited by Coul; 2 Nov, 2015 @ 2:23pm
CaptainMittens 3 Nov, 2015 @ 8:30am 
I just updated the OP to add the crawling out of the ground spawn animations, and tuned down the zombie presence. I tried it, and it was pretty overbearing, basically, it was replacing the zombies too fast and it would basically pin the player down.
Coul 3 Nov, 2015 @ 12:57pm 
sounds awesome i'll test it out now and give whatever feedback i can :steamhappy:
Coul 3 Nov, 2015 @ 12:58pm 
do you think its possible to make zombies side neutral because i've been playing this with escape altis and some of the enemies are independent so zombies would just ignore them
CaptainMittens 3 Nov, 2015 @ 8:06pm 
you can make indy friendly to opfor.
Coul 3 Nov, 2015 @ 8:07pm 
then zombies wouldnt attack opfor either
Coul 3 Nov, 2015 @ 8:08pm 
i want them to attack everyone
CaptainMittens 4 Nov, 2015 @ 9:46am 
If you want Zombies to attack indy, they're going to have to be opfor zombies, and independant is going to have to be hostile to both blue and opfor.
CaptainMittens 4 Nov, 2015 @ 9:48am 
If the existing enemies are Opfor, then change "AttackGroup = createGroup east;" to "AttackGroup = createGroup resistance;"
Coul 4 Nov, 2015 @ 2:25pm 
ah i see thanks, are the zombies opfor by default?
CaptainMittens 4 Nov, 2015 @ 2:40pm 
No, but the units spawned in this script use the opfor zombies _ZombiesSlow= ["RyanZombieC_man_1SlowOpfor","RyanZombieC_man_polo_1_FSlowOpfor","RyanZombieC_man_pilot_FSlowOpfor","RyanZombieC_journalist_FSlowOpfor","RyanZombieC_OrestesSlowOpfor","RyanZombieC_NikosSlowOpfor","RyanZombieC_man_polo_2_FSlowOpfor","RyanZombieC_man_polo_4_FSlowOpfor","RyanZombieC_man_polo_5_FSlowOpfor","RyanZombieC_man_polo_6_FSlowOpfor","RyanZombieC_man_p_fugitive_FSlowOpfor","RyanZombieC_man_w_worker_FSlowOpfor","RyanZombieC_scientist_FSlowOpfor","RyanZombieC_man_hunter_1_FSlowOpfor"];

That part, you'll notice the Opfor at the end of all the classes. you could replace those with the independant version of the zombie classes.

Additionally, you could just add zombie spawn modules if you're editing the map anyways.
Coul 4 Nov, 2015 @ 3:31pm 
ah thanks
Bungus 24 Nov, 2015 @ 5:57pm 
So if I paste this script into the description.ext file zombies will randomly spawn near players? or do I need to place a module in-game?
< >
Showing 1-15 of 30 comments
Per page: 1530 50