DayZ Mission System

anyone know if this works with epoch 1.0.2.1? Also, if you run with DZAI do you need to set up AI separately as with Sarge AI or can you leave default settings?​
 
I'm getting this every time an AI spawns in:

Code:
21:27:47 "AIUNIT: Creating BAF_Soldier_L_DDPM by <NULL-object> at [6439.31,13805.6,0]. Result:O 1-2-L:1 | Loadout:["VIL_HK33","VIL_30Rnd_556x45_HK"] / Num:0"
21:27:47 Error in expression <loadout select 2;
_aiammo2 = _ailoadout select 3;
_aiunit addweapon _aiwep1;
_ai>
21:27:47  Error position: <select 3;
_aiunit addweapon _aiwep1;
_ai>
21:27:47  Error Zero divisor
21:27:47 File z\addons\dayz_server\missions\add_unit_server.sqf, line 116
21:27:47 No speaker given for Marcel Schneider
21:27:47 "AIUNIT: Creating BAF_Soldier_L_DDPM by <NULL-object> at [6440.31,13806.6,0]. Result:O 1-2-L:2 | Loadout:["M4A1_HWS_GL_SD_Camo","30Rnd_556x45_StanagSD"] / Num:3"
21:27:47 Error in expression <loadout select 2;
_aiammo2 = _ailoadout select 3;
_aiunit addweapon _aiwep1;
_ai>
21:27:47  Error position: <select 3;
_aiunit addweapon _aiwep1;
_ai>
21:27:47  Error Zero divisor
21:27:47 File z\addons\dayz_server\missions\add_unit_server.sqf, line 116
21:27:47 No speaker given for Jens Muller
21:27:47 "AIUNIT: Creating BAF_Soldier_L_DDPM by <NULL-object> at [6441.31,13807.6,0]. Result:O 1-2-L:3 | Loadout:["G36A_camo","30Rnd_556x45_G36"] / Num:2"
21:27:47 Error in expression <loadout select 2;
_aiammo2 = _ailoadout select 3;
_aiunit addweapon _aiwep1;
_ai>
21:27:47  Error position: <select 3;
_aiunit addweapon _aiwep1;
_ai>
21:27:47  Error Zero divisor
21:27:47 File z\addons\dayz_server\missions\add_unit_server.sqf, line 116
21:27:47 "AIUNIT: Creating BAF_Soldier_L_DDPM by <NULL-object> at [6442.31,13808.6,0]. Result:O 1-2-L:4 | Loadout:["M24","5Rnd_762x51_M24"] / Num:1"
21:27:47 Error in expression <loadout select 2;
_aiammo2 = _ailoadout select 3;
_aiunit addweapon _aiwep1;
_ai>
21:27:47  Error position: <select 3;
_aiunit addweapon _aiwep1;
_ai>
21:27:47  Error Zero divisor
21:27:47 File z\addons\dayz_server\missions\add_unit_server.sqf, line 116
21:27:47 "AIUNIT: Creating BAF_Soldier_L_DDPM by <NULL-object> at [6443.31,13809.6,0]. Result:O 1-2-L:5 | Loadout:["SVD_CAMO","10Rnd_762x54_SVD"] / Num:0"
21:27:47 Error in expression <loadout select 2;
_aiammo2 = _ailoadout select 3;
_aiunit addweapon _aiwep1;
_ai>
21:27:47  Error position: <select 3;
_aiunit addweapon _aiwep1;
_ai>
21:27:47  Error Zero divisor
21:27:47 File z\addons\dayz_server\missions\add_unit_server.sqf, line 116
21:27:47 "AIUNIT: Creating BAF_Soldier_L_DDPM by <NULL-object> at [6444.31,13810.6,0]. Result:O 1-2-L:6 | Loadout:["VIL_M40A3"] / Num:3"
21:27:47 Error in expression <iloadout select 1;
_aiwep2 = _ailoadout select 2;
_aiammo2 = _ailoadout select 3>
21:27:47  Error position: <select 2;
_aiammo2 = _ailoadout select 3>
21:27:47  Error Zero divisor
21:27:47 File z\addons\dayz_server\missions\add_unit_server.sqf, line 115
21:27:47 "AIUNIT: Last Waypoint [O 1-2-L,6] at [6538.31,13904.6,80]"
 
Hertizch open the add_unit_ai.sqf files and check to make sure you have the correct number of possible random loadouts and make sure the loadouts are weapons that aren't banned on the map you're using.
 
I've got this installed on Epoch 1.0.2.3 and it's working. The only problem I have is that the delay between missions is non-existent.

As soon as you complete one another starts, sometimes 2 at a time. The longest delay I've seen is roughly 5 minutes.

I'd like to increase the delay so minor missions are 30 minutes apart at the soonest, and major missions are an hour apart at the soonest.

fnc_hTime.sqf
Code:
private["_time","_val","_return","_rand","_bool","_tar"];
_tar = _this select 0;
_val = _this select 1;
 
_rand  = round(random _tar);
_bool = true;
 
while {_bool} do
{
    if(_rand < _val) then {_rand  = round(random _tar);} else {_bool = false;};
};
 
_return = _rand;
_return;

Any suggestions on how to do this?
 
I was thinking about making a fixed delay time between missions. I _think_ (I am not sure, haven't tried it yet) this could be done by editing the file this way (only the 2nd line from the end of the file changed - highlighted in red). This should be valid and work only if the unit here is minutes, not seconds :)


private["_time","_val","_return","_rand","_bool","_tar"];
_tar = _this select 0;
_val = _this select 1;

_rand = round(random _tar);
_bool = true;

while {_bool} do
{
if(_rand < _val) then {_rand = round(random _tar);} else {_bool = false;};
};

_return = 30;
_return;

As stated above, I have NOT tested it yet. But I am willing to, shortly :)
 
I think this part of the script needs to be re-written so it's easier to adjust instead of some arbitrary time that server admin's don't really have control over setting.

Something that lets admins specify a minimum amount of time before a minor and a major mission is to begin, as well as a value that gives a limited random amount of time on top of the specified minimum. Forgive me for I'm not a coder, but this is an example of what I mean.

Code:
major_delay = 7200;            //Number of seconds between Major Mission starts
major_extra = 900;              //Seconds added on to 'major_delay', between 0 and number specified
 
minor_delay = 3600;            //Number of seconds between Minor Mission starts
minor_extra = 900;              //Seconds added on to 'minor_delay', between 0 and number specified

This will make Major missions start every 2 hours with up to 15 minutes added on to the delay and Minor missions start every hour with up to 15 minutes added on to the delay.

If anyone knows how to code something like this that would be greatly appreciated.
 
That is a brilliant idea, I think you should PM it to Sarge and ask him about chances of having it implemented. (assuming he misses this post).
 
guys its in it already
go in dayz_server/missions/SMGoMajor.sqf and dayz_server/missions/SMGoMinor.sqf then change this bit
_wait = [fixed time in sec,random after fixed time in sec] call fnc_hTime;
so fixed change to say 3000 then the second part be if you put 1500 be from 1 to 1500 random after the 3000
hope it helps =)
 
Yeah, everyone complains about the time selection, but it's already in there lol. SMGoMajor.sqf and SMGoMinor.sqf are your time selectors. This line:
Code:
_wait = [2000,650] call fnc_hTime;
Gives you two numbers in seconds that you can change. The first number is the maximum time between missions. The second number is the minimum time between missions. fnc_hTime selects a random number of seconds between the two.
 
I'll explain how fnc_hTime works.

Code:
private["_time","_val","_return","_rand","_bool","_tar"];
_tar = _this select 0; //Maximum time that you input
_val = _this select 1; //Minimum time that you input
 
_rand  = round(random _tar); //Select random number up to your maximum.
_bool = true;
 
while {_bool} do
{
    if(_rand < _val) then {_rand  = round(random _tar);} else {_bool = false;};
      //if the randomly selected number is less than the minimum, generate a new random number. else use the random number.
};
 
_return = _rand; //Use the good random number
_return; //Send the number back to SMGoMajor.sqf

And now SMGoMajor.sqf

Code:
_wait = [2000,650] call fnc_hTime; //Send these two numbers to fnc_hTime
sleep _wait; //Do nothing for the number of time that fnc_hTime sends back
MissionGo = 1; //Start the mission
 
Back
Top