Jump to content
Sign in to follow this  
anthonyfromtheuk

Zombies and Demons spawned randomly in front of you that will hunt you down

Recommended Posts

MOD PLEASE REMOVE THIS THREAD - I cannot delete it myself

 

 

This is not working as expected, mod has own parameters for exactly the things this script deals with and as such its hit and miss. miss it seem more so than often. If I could delete this thread myself I would. Apologises for posting something that was not properly tested. It seemed fine in my first tests but has become apparent since that it is not what it is supposed to be.

 


This is just a rehash of something I made that was again rehashed that I previously put together with much help from the guys on this forum. Seems the mod Zombies and Demons is quite popular so here is a script to spawn a group of Zombies randomly within 180 degrees of the direction the player is facing, at a set distance in front of the player (Possible to make this Multi player compatible by making the script search for nearest "enemy" man instead of player), once they get moving will hunt you down indefinitely. The zombies can be a bit retarded to start with as the leader spawns in the middle of the group and takes a bit of time to figure out where to head, but once they get going you best be ready! They will not stop until you are dead. Deletion of the zombie group at a certain distance from player for resource saving is commented out, but possible. Distance they spawn from you in this script is set at 250 meters from player on this line -
_pos = [ player, 250, _from + _randomAngle ] call BIS_fnc_relPos;
Change it as you need, you can change more parameters also, such as what you actually want to spawn (original script was just OPFOR groups here, called from config) -
_attack = [getMarkerPos "randommrk", _side, ["RyanZombieC_man_1", "RyanZombieC_man_polo_1_F", "RyanZombieC_man_polo_2_F", "RyanZombieC_man_polo_4_F", "RyanZombieC_man_polo_5_F", "RyanZombieC_man_polo_6_F", "RyanZombieC_man_p_fugitive_F", "RyanZombieC_man_w_worker_F", "RyanZombieC_scientist_F", "RyanZombieC_man_hunter_1_F", "RyanZombieC_man_pilot_F", "RyanZombieC_journalist_F", "RyanZombieC_Orestes", "RyanZombieC_Nikos"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup;
Just change what is in there, more or less zombies your call. Call it with a trigger or how ever you like in game.
NULL= execVM "scriptname.sqf";
Below is the script...
if (!isServer) exitwith {};

private ["_side", "_attack", "_Zombies"];


//Marker setup spawn randomly within 180 degrees of the direction the player is facing
deleteMarker "randommrk";
_angleSector = 180;
_dir = getDir player;
_randomAngle = random _angleSector;
_from = _dir - ( _angleSector / 2 );

//distance away from player to spawn and marker creation
_pos = [ player, 250, _from + _randomAngle ] call BIS_fnc_relPos;
_marker = createMarker ["randommrk", _pos];

//Create side
_side = createcenter east;

//Spawn Zombies
_attack = [getMarkerPos "randommrk", _side, ["RyanZombieC_man_1", "RyanZombieC_man_polo_1_F", "RyanZombieC_man_polo_2_F", "RyanZombieC_man_polo_4_F", "RyanZombieC_man_polo_5_F", "RyanZombieC_man_polo_6_F", "RyanZombieC_man_p_fugitive_F", "RyanZombieC_man_w_worker_F", "RyanZombieC_scientist_F", "RyanZombieC_man_hunter_1_F", "RyanZombieC_man_pilot_F", "RyanZombieC_journalist_F", "RyanZombieC_Orestes", "RyanZombieC_Nikos"], [], [], [0.3, 0.6]] call BIS_fnc_spawnGroup;

//Original Script - anthonyfromtheuk

//Hunt Player
_Zombies= leader _attack;
_Zombies move (getPosATL player);
_attack setCombatMode "RED";
_attack setBehaviour "Aware";
_attack allowFleeing 0;

//Delete group if they get to far away from player
// while {true} do {
// sleep 0.5;
//
// if ((player distance (leader _attack)) > 500) exitWith {
// { deleteVehicle _x } forEach units _attack;
// deleteGroup _attack;
//
// };
// };

//Keep moving!
while {true} do {
sleep 0.5;
if ((unitReady _Zombies) && {(alive _Zombies)}) then {
sleep 0.5;
if (({ alive _x} count (units _attack)) != 0) then {
_Zombies = leader _attack;
_Zombies move (getPosATL player);
_attack setCombatMode "RED";
_attack setBehaviour "Aware";


};
};
};

I will add a working example mission when time permits.
You will need to be running the mod for this script to work obviously - If you come up with some amazing mission using this, let me know! Enjoy!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×