spawning zombies

I think its possible.

You would need to add something like this into server_spawnCrashSite.sqf (in your server.pbo)
under
Code:
_crash setDir round(random 360);
add something like
Code:
aiCrashLoc = _position;
[] execVM "\z\addons\dayz_mission\units\add_unit_server.sqf";

And then have add_unit_server.sqf catch the location something like:
Code:
_aispawnpos = aiCrashLoc;

I'm sure someone could get it if they messed around.
 
Sure, you could use a spawn ai script the same way. Example using axeman's script:
http://opendayz.net/threads/dayz-npc-ai-units-troops-add-to-server.8002/

Find this in init.sqf:
Code:
_serverMonitor =    [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";

Add this below it:
Code:
_dayzFactions = [] execVM "units\init.sqf";

This goes in units\init.sqf:
Code:
waitUntil{initialized};
createCenter east;
createCenter resistance;
WEST setFriend [RESISTANCE,0];
WEST setFriend [EAST,0];
EAST setFriend [RESISTANCE,0];
EAST setFriend [WEST,0];
EAST setFriend [CIVILIAN,0];
CIVILIAN setFriend [EAST,0];
RESISTANCE setFriend [WEST,0];
RESISTANCE setFriend [EAST,0];
RESISTANCE setFriend [CIVILIAN,0];

The trigger would look like this:
Code:
class Item10
            {
            position[]={8163.75,131.63644,9097.0596};
            a=900;
            b=900;
            activationBy="ANY";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="NPCSpawnTrigger1";
            expCond="(vehicle player) in thislist;";
            expActiv="npcspawn1 = [[8163.75,9097.0596,0],160,8,4] execVM ""units\add_unit_server.sqf"";";
            expDesactiv="terminate npcspawn1;";
            class Effects
            {
            };
            };

And then add_unit_server.sqf would be something like this:
Code:
    private["_aiunit","_xpos","_ypos","_unitpos","_aiGroup","_wppos","_wpradius","_wpnum","_numunits","_rndLOut","_ailoadout","_aiwep","_aiammo","_wp","_aispawnpos"];
    _aiunit = objNull;
    _aiGroup = createGroup resistance;
    _aispawnpos =_this select 0;
    _wpradius = _this select 1;
    _wpnum = _this select 2;
    _numunits = _this select 3;
 
    _xpos = _aispawnpos select 0;
    _ypos = _aispawnpos select 1;
 
    for [{ x=1 },{ x < _numunits+1 },{ x = x + 1; }] do {
    _unitpos = [_xpos+x,_ypos+x,0];
 
    _rndLOut=floor(random 3);
    _ailoadout=
    switch (_rndLOut) do
    {
      case 0: {["SCAR_H_STD_EGLM_Spect","20Rnd_762x51_B_SCAR"]};
      case 1: {["M8_SAW","100Rnd_556x45_BetaCMag"]};
      case 2: {["BAF_LRR_scoped_W","5Rnd_86x70_L115A1"]};
    };
 
    "GUE_Soldier_Crew_DZ" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"Private"];
 
    _aiunit enableAI "TARGET";
    _aiunit enableAI "AUTOTARGET";
    _aiunit enableAI "MOVE";
    _aiunit enableAI "ANIM";
    _aiunit enableAI "FSM";
    _aiunit allowDammage true;
 
    _aiunit setCombatMode "RED";
    _aiunit setBehaviour "COMBAT";
 
    removeAllWeapons _aiunit;
    _aiwep = _ailoadout select 0;
    _aiammo = _ailoadout select 1;
    _aiunit addweapon _aiwep;
    _aiunit addMagazine _aiammo;
    _aiunit addMagazine _aiammo;
    _aiunit addMagazine _aiammo;
    _aiunit addMagazine _aiammo;
    _aiunit addMagazine _aiammo;
    _aiunit addMagazine _aiammo;
    _aiunit addMagazine _aiammo;
    _aiunit addMagazine _aiammo;
 
    _aiunit setSkill ["aimingAccuracy",1];
    _aiunit setSkill ["aimingShake",1];
    _aiunit setSkill ["aimingSpeed",1];
    _aiunit setSkill ["endurance",1];
    _aiunit setSkill ["spotDistance",1];
    _aiunit setSkill ["spotTime",1];
    _aiunit setSkill ["courage",1];
    _aiunit setSkill ["reloadSpeed",1];
    _aiunit setSkill ["commanding",1];
    _aiunit setSkill ["general",1];
    } ;
 
    for [{ x=1 },{ x < _wpnum },{ x = x + 1; }] do {
    _wppos = [_xpos+(x*20),_ypos+(x*20),_wpradius];
    _wp = _aiGroup addWaypoint [_wppos, _wpradius];
    _wp setWaypointType "MOVE";
    };
    _wp = _aiGroup addWaypoint [[_xpos,_ypos,0], _wpradius];
    _wp setWaypointType "CYCLE";

Above script requires you to add this exception to the first line of your waypointstatement.txt, waypointcondition.txt and remoteexc.txt:

!"["true", ""]"

If he's already using Sarge AI then I would recommend changing:

_aiGroup = createGroup resistance;
to this:
_aiGroup = createGroup SAR_AI_unfriendly_side;
and not using the units\init.sqf

I found that using the seperate factions file as you've suggested (while also using Sarge AI) messes up the Sarge friendly AI and they actually start shooting at survivors. I've not had any issues since using the _aiGroup = createGroup SAR_AI_unfriendly_side; method. It also reduces my mission file size and means that any changes i make to the bandits under sarge config, also effect these guys too :)
 
Hi, i saw this post and would realy like to use it, but I can not for my lift figure out what position im suppose to use for the sql script and the mission.sqm... Can somebody help me ?
I wold like the Zombies to spawn at this map position [226,[4221.58,9625.93,0.001]]
And have trie and tried to figure out the X,Y,Z but nothing works out of all the combinations ive tried.

ATL and ASL omg nothing usfull in how to read up on it on google :p

Ive googled the subject and tried for 3 hours but not any whiser......

Its West of NWAF, if you can help I would be wery greatful.

Sry for any spelling misses, Im from Norway so English is my 2`ed lang :)
 
A quote from GORSY on opendayz.net

Yeh co-ords shud be X,Z,Y

Getting co-ords from database
taken from your survivors world location in ur database wud look like
[107,[1234.56,6543.21,0.00012]]
DIR X Y Z

Dir= Direction you are facing
X = horizontal
Y = vertical
Z = height

So what u need to do is get rid of Direction and Height

So all you will be left with is

1234.56 and 6543.21

Soo now what you need to do is put them in your sensors table

position[]={1234.56,###,6543.21};
X Z Y



Setting Z
Z works from the ground up, so if you set this to 500, your dome wud go from 0 (ground level) upto 500 meters in the sky

so your final position would look like

position[]={1234.56,500,6543.21};
X Z Y

Gorsy



Bags
 
A quote from GORSY on opendayz.net

Yeh co-ords shud be X,Z,Y

Getting co-ords from database
taken from your survivors world location in ur database wud look like
[107,[1234.56,6543.21,0.00012]]
DIR X Y Z

Dir= Direction you are facing
X = horizontal
Y = vertical
Z = height

So what u need to do is get rid of Direction and Height

So all you will be left with is

1234.56 and 6543.21

Soo now what you need to do is put them in your sensors table

position[]={1234.56,###,6543.21};
X Z Y



Setting Z
Z works from the ground up, so if you set this to 500, your dome wud go from 0 (ground level) upto 500 meters in the sky

so your final position would look like

position[]={1234.56,500,6543.21};
X Z Y

Gorsy



Bags

Nice guide ! much appreciated :D

Thank you graeme bourne :)
 
Thnx mate, but all creds go to GORSY for explaining it so simply... I copy pasted it into my notes, because it made it simple...And I'm just returning the favour to others that need it


Bags

p.s.s just thinking about it, obviously after a coffee, that The info I posted from gorsy was for sensor's about a safe zone, but it explains the method of the location stuff for you
 
Regarding the zombie spawn trigger is there a way to setup multiple points into a single spawnzombies.sqf file and call them individually through different triggers or do I need to create separate files for each trigger I want to create?
 
Hey ebay :)

I'm trying the script you provided below and can't seem to get it to work :S
I'm detecting when a player is near a certain object - the near object detection works, I tested - it gives a message when the player is near the object, then the very next line is the exec to call this script:

(running EPOCH by the way - that change things? - I checked, the FSM script is where it should be, so I assume that's right?)

private ["_zombletypes","_zomblesposition","_zombleselectedpos"];

_zombletypes = ["zZombie_Base", "z_worker3", "z_worker2", "z_worker1", "z_villager1", "z_villager2", "z_villager3", "z_worker3", "z_worker2",
"z_worker1", "z_villager1", "z_villager2", "z_villager3", "z_worker3", "z_worker2", "z_worker1", "z_villager1", "z_villager2", "z_villager3"];
_zomblesposition = [12217.315, 6804.6929, 0.079474516];
_i = 1;
for "_i" from 1 to 30 do
{
_genzombles = _zombletypes call BIS_fnc_selectRandom;
_agent = createAgent [_genzombles, _zomblesposition, [], 40, "NONE"];
_zombleselectedpos = getPosATL _agent;
[_zombleselectedpos,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
};
Can you see any issue in the script above? Did I do something wrong? :S
Thanks in advance!

You can adjust the local zombie limit in init.sqf for Epoch, but that will take effect server wide.

You can use this script to spawn zombies on a specific location:
spawnzombles.sqf:
Code:
_zombletypes = ["zZombie_Base", "z_worker3", "z_worker2", "z_worker1", "z_villager1", "z_villager2", "z_villager3", "z_worker3", "z_worker2",
"z_worker1", "z_villager1", "z_villager2", "z_villager3", "z_worker3", "z_worker2", "z_worker1", "z_villager1", "z_villager2", "z_villager3"];
_zomblesposition =    [9615.84,11370.1,0];
_i = 1;
    for "_i" from 1 to 30 do
    {
        _genzombles = _zombletypes call BIS_fnc_selectRandom;
        _agent = createAgent [_genzombles, _zomblesposition, [], 40, "NONE"];
        _zombleselectedpos = getPosATL _agent;
        [_zombleselectedpos,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
    };

Replace each zombie classname with the ones you want. You can add more zombies to the list and increase 30 to match the number you want to spawn. Replace position coordinates with where you want to spawn them. And replace 40 with the radius around those coordinates you want them to spawn.

Running this on loop every x seconds would badly hurt performance. Instead you should make a trigger that only runs it when a player enters within a certain distance of the area. For example in mission.sqm under class sensors this would spawn them when player enters within 500m:
Code:
class Item10
        {
            position[]={9615.84,131.63644,11370.1};
            a=500;
            b=500;
            activationBy="ANY";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="ZombleSpawnTrigger";
            expCond="(vehicle player) in thislist;";
            expActiv="zomblespawnt = [] execVM ""scripts\spawnzombles.sqf"";";
            expDesactiv="terminate zomblespawnt;";
            class Effects
            {
            };
        };

Note that will run every time a player enters the area. So one player will spawn 30 zombies, 2 players will spawn 60, etc.
 
Hi there
Using the script Ebay put at the start of the topic in a lingor (1.5) epoch server. Dosnt seem to work

my code:
Mission sqm :
class Sensors
{
items=1;
class Item0
{
position[]={2992.2559,14.071206,7175.3457};
a=500;
b=500;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="ZombleSpawnTrigger";
expCond="(vehicle player) in thislist;";
expActiv="zomblespawnt = [] execVM ""zedspawn\spawnzombles.sqf"";";
expDesactiv="terminate zomblespawnt;";
class Effects
{
};
};
};
};


spawnzombles.sqf:
_zombletypes = ["zZombie_Base", "z_worker3", "z_soldier_heavy", "z_worker1", "z_villager1", "z_villager2", "z_villager3", "z_worker3", "z_worker2",
"z_worker1", "z_villager1", "z_soldier_pilot",, "z_soldier_heavy", "z_worker3", "z_worker2", "z_worker1", "z_villager1", "z_villager2", "z_villager3"];
_zomblesposition = [2992.2559,7175.3457,14.071206];
_i = 1;
for "_i" from 1 to 30 do
{
_genzombles = _zombletypes call BIS_fnc_selectRandom;
_agent = createAgent [_genzombles, _zomblesposition, [], 20, "NONE"];
_zombleselectedpos = getPosATL _agent;
[_zombleselectedpos,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
};

I have got the same set up on my cherno server, also epoch where it does work, really well actually. Makes hitting certain high loot areas much more dangerous. also set it up round some areas with higher trigger range so its more difficult to use the zombie spawns as a sign of near by players, which is fantastic :)

no idea why its not working, i made sure the sensor is working (deleted the zombles file so i got a "file not found" error when entering the sensor are) so i assume its some problem with the coords for spawn?

any help would be great thanks.
 
When entering the "sensor" it activate the script, you must have deleted / removed / renamed the file. So now it cant execute it and you get the error" file not found"
 
I deliberately deleted so i would get that error to ensure my sensor was in the right place :p (was worried if i got the coords wrong, so knew the easiet way to get a msg to pop up if i was in the right place was to make it error lol)

EDIT: also im sure the coords are correct, i have used myself from database location, and also placed a sensor in the editor in the are i want and tested it with those coords, ofcourse changing the z axis where appropriate.

Further Edit: I notice now that i havnt really explained properly, probably due to lack of sleep and annoyance. Basically, I have the code in place exactly as it is on my cherno server (where it works) but doing the same, with only different coords, it dosnt seem to work at all on lingor. no error message, nothing. just no zombies spawning where i want.
 
Last edited:
I deliberately deleted so i would get that error to ensure my sensor was in the right place :p (was worried if i got the coords wrong, so knew the easiet way to get a msg to pop up if i was in the right place was to make it error lol)

EDIT: also im sure the coords are correct, i have used myself from database location, and also placed a sensor in the editor in the are i want and tested it with those coords, ofcourse changing the z axis where appropriate.

Further Edit: I notice now that i havnt really explained properly, probably due to lack of sleep and annoyance. Basically, I have the code in place exactly as it is on my cherno server (where it works) but doing the same, with only different coords, it dosnt seem to work at all on lingor. no error message, nothing. just no zombies spawning where i want.

Make sure if you are using worldspace coordinates to convert them to SQM coordinates.

X, Y, Height >to> X, Height, Y
 
Back
Top