Jump to content
  • 0

How to spawn zombies ?


lmapper

Question

Recommended Posts

  • 0

This should suffice (Not tested but based off my zombie horde code):

/*	
	For DayZ Epoch
	Single Zed spawn by axeman
*/
private ["_zedTypes","_zedType","_zedPos","_agent","_zedTarget"];
_zedTypes = ["pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest"];
_zedPos = [6642.4,2439.6,0];//Position to spawn the Zed - Chernogorsk Central Garden
_zedTarget = [5956,7960,0];//Give the poor zed somewhere to walk to - Somewhere near Stary Sobor
_zedType = _zedTypes call BIS_fnc_selectRandom;
_agent = createAgent [_zedType, _zedPos, [], 40, "NONE"];
_agent disableAI "FSM";
_agent disableAI "AUTOTARGET";
_agent setBehaviour "COMBAT";
_agent setCombatMode "GREEN";
_agent setSkill 0;
_agent setUnitPos "UP";
_agent moveTo _zedTarget;
_agent forceSpeed 2;
[_zedPos,_agent,_zedTarget] execFSM "\z\addons\dayz_code\system\zombie_agent.fsm";//Set the normal Zed behaviour
Link to comment
Share on other sites

  • 0

 

This should suffice (Not tested but based off my zombie horde code):

/*	
	For DayZ Epoch
	Single Zed spawn by axeman
*/
private ["_zedTypes","_zedType","_zedPos","_agent","_zedTarget"];
_zedTypes = ["pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest"];
_zedPos = [6642.4,2439.6,0];//Position to spawn the Zed - Chernogorsk Central Garden
_zedTarget = [5956,7960,0];//Give the poor zed somewhere to walk to - Somewhere near Stary Sobor
_zedType = _zedTypes call BIS_fnc_selectRandom;
_agent = createAgent [_zedType, _zedPos, [], 40, "NONE"];
_agent disableAI "FSM";
_agent disableAI "AUTOTARGET";
_agent setBehaviour "COMBAT";
_agent setCombatMode "GREEN";
_agent setSkill 0;
_agent setUnitPos "UP";
_agent moveTo _zedTarget;
_agent forceSpeed 2;
[_zedPos,_agent,_zedTarget] execFSM "\z\addons\dayz_code\system\zombie_agent.fsm";//Set the normal Zed behaviour

 

thx. I'll try it.

Link to comment
Share on other sites

  • 0

ok this seems like an interesting script to add, how would one add this ?

 

can this work in a few differnt locations and set to spawn like every hour?

 

Probably, but spawning in a horde of zombies without anyone near is a server drag. Best to have multiple locations with triggers

Link to comment
Share on other sites

  • 0

Im not sure how one would go about setting up the server side way, but the trigger way is easy.

 

(copy paste off off user ebay I believe)

 

Make a trigger:

        class Item16
        {
position[]={11787.4,0.001,12674.5};  // database cords, xyz
a=100;
b=100;
activationBy="ANY";
repeating=1;  // every one who enters the area after this spawns an additional horde
interruptable=1;
age="UNKNOWN";
name="ZombleSpawnTrigger";
expCond="(vehicle player) in thislist;";
expActiv="zomblespawnt = [] execVM ""map_addons\zombies\1.sqf"";";
expDesactiv="terminate zomblespawnt;";
class Effects
{
};
};

 

now, make an sqf file called 1.sqf, with this in it:

 

_zombletypes = [
"zZombie_Base",
"z_worker1",
"z_worker2",
"z_worker3",
"z_villager1",
"z_villager2",
"z_villager3",
"z_suit1",
"z_suit2",
"z_soldier",
"z_soldier_heavy",
"z_soldier_pilot",
"z_policeman",
"z_teacher",
"z_doctor",
"z_hunter",
"z_priest"
];
_zomblesposition = [13616.088,3153.3975,5.3405762e-005]; //where you want the zombies to spawn, this location is xzy
_i = 1;
for "_i" from 1 to 30 do // spawns between 1 and 30 zombies
{
_genzombles = _zombletypes call BIS_fnc_selectRandom;
_agent = createAgent [_genzombles, _zomblesposition, [], 10, "NONE"];
_zombleselectedpos = getPosATL _agent;
[_zombleselectedpos,_agent] execFSM "\z\addons\dayz_code\system\zombie_agent.fsm";
};

 

and save that file in the mission file: map_addons\zombies\

 

 

upload, restart, happy tears

Link to comment
Share on other sites

  • 0

alternatively, you could set it up with

 

/*    
    For DayZ Epoch
    Single Zed spawn by axeman
*/
private ["_zedTypes","_zedType","_zedPos","_agent","_zedTarget"];
_zedTypes = ["pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest"];
_zedPos = [6642.4,2439.6,0];//Position to spawn the Zed - Chernogorsk Central Garden
_zedTarget = [5956,7960,0];//Give the poor zed somewhere to walk to - Somewhere near Stary Sobor
_zedType = _zedTypes call BIS_fnc_selectRandom;
_agent = createAgent [_zedType, _zedPos, [], 40, "NONE"];
_agent disableAI "FSM";
_agent disableAI "AUTOTARGET";
_agent setBehaviour "COMBAT";
_agent setCombatMode "GREEN";
_agent setSkill 0;
_agent setUnitPos "UP";
_agent moveTo _zedTarget;
_agent forceSpeed 2;

[_zedPos,_agent,_zedTarget] execFSM "\z\addons\dayz_code\system\zombie_agent.fsm";//Set the normal Zed behaviour
 

 

just be sure you adjust the cords 

Link to comment
Share on other sites

  • 0

so do i replace

 

class Item16
                {
                    position[]={5133.0991,0.96998656,-3091.2974};
                    azimut=-17.083944;
                    id=4;
                    side="WEST";
                    vehicle="Survivor1_DZ";
                    player="PLAY CDG";
                    skill=0.60000002;
                    init="this enableSimulation false;this allowDammage false;this disableAI 'FSM';this disableAI 'ANIM';this disableAI 'MOVE';";

 

or is that the wrong place?

Link to comment
Share on other sites

  • 0

still not got this working yet (moved the trigger from above markers to sensors dues to error "cannot load mission")

is there a way when to trigger activates it can give a message ingame? i dont see anyting in the rpt to do with the trigger or 1.sqf

 

you can add a line that tell the server the script is initiated so it shows in the rtp

 

post your mission.sqm to see if you made any errors placing it/I made any errors explaining it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...