Jump to content

Wicked AI/Mission system


Markk311

Recommended Posts

Yeah one finally spawned at server uptime 2hr 48min. Which file has it where i can change the time it loads up

This might be because your server is running at low FPS. Someone else might know about this better, but when the server goes below 5 FPS or so the time moves drastically slower than it should.

Link to comment
Share on other sites

Something that would be really cool for the next update, would be some more missions. At the moment there's around 7 different ones, what would be really cool if there were around 20 and it ran up to 2-3 missions at once!

 

Also loving the AI in this more and more, they're 100x better than Sarge AI!!!!!

Link to comment
Share on other sites

Must say, this looks realy nice ! Have some questions. I read the scripts and need ask :

 

1. can i use with this epoch events - like loot events?

2. where can i see the time of starting and how long will this missions take?

 

sorry, i am not so experinced like you, but great job !

Link to comment
Share on other sites

Sonikot have a look at AIconfig.sqf for 

 

 

 

 
///////////////////////////////////////////////////////
/// Allows you to set a custom skill array for units. (True: will use these arrays. False: will use number in spawn array)
ai_custom_skills = True;
 
/// Custom skill array. Use 0 to use this with ai_custom_skills = True 
ai_custom_array1 = [
["aimingAccuracy",0.75],
["aimingShake",1.00],
["aimingSpeed",0.75],
["endurance",1.00],
["spotDistance",0.75],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];
 
/// Custom skill array. Use 1 to use this with ai_custom_skills = True 
ai_custom_array2 = [
["aimingAccuracy",0.50],
["aimingShake",1.00],
["aimingSpeed",0.50],
["endurance",1.00],
["spotDistance",0.50],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];
 
/// Custom skill array. Use 2 to use this with ai_custom_skills = True 
ai_custom_array3 = [
["aimingAccuracy",0.25],
["aimingShake",1.00],
["aimingSpeed",0.25],
["endurance",1.00],
["spotDistance",0.25],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];

Have a play about with the amounts just don't go higher than 1.0

 

Also have a look at this section

 

/// Sets behavior of AI groups 

ai_combatmode = "RED";
ai_behaviour = "STEALTH";

 


Here are the different ai_beahaviour you can use.

 

  • SAFE, CARELESS - Units will stay upright
  • AWARE, COMBAT - Units will stay upright most of the time, kneeling down occasionally
  • STEALTH - Units will be prone most of the time
Link to comment
Share on other sites

Ronnie11 I have one event running with wicked AI, altogether I have 5 events, 4 normal and one which we call a rare event (Less chance of spawning - more loot)

 

Problem we have had is with the AI cleanup after the event time is up.

 

If we don't clean the ai they start to wander and take pot shots/kill players. Causing players to rage as we run a pve server and usually ai is marked on the map at the events.

 

But when we add the cleanup it cleans up all the AI created by WickedAI with the cleanup=true tag. Missions and events. So basically if events overlap or you have 2 running and the WAI missions, it cleans up all the AI on the map. Leaving loot boxes, events/missions with no AI at all.

Link to comment
Share on other sites

 

Sonikot have a look at AIconfig.sqf for 

 

Have a play about with the amounts just don't go higher than 1.0

 

Also have a look at this section

 

Here are the different ai_beahaviour you can use.

 

  • SAFE, CARELESS - Units will stay upright
  • AWARE, COMBAT - Units will stay upright most of the time, kneeling down occasionally
  • STEALTH - Units will be prone most of the time

 

thank you mate, trying to make them work for their phat lootz. cheers!

Link to comment
Share on other sites

Hello and thank you for the awesome work! We implemented it and it's working like a charm, but I got a couple of questions

 

1) I tried setting up a specific weapons loadout for a specific static AI group. I edited the AIconfig file adding this section:

/// 5 - chedaki ///
ai_wep5 = [
["RPK_74","75Rnd_545x39_RPK"], 
["Sa58V_RCO_EP1","30Rnd_762x39_AK47"],
["Pecheneg_DZ","100Rnd_762x54_PK"], 
["AKS_74_GOSHAWK","30Rnd_545x39_AK"],
["Sa58V_RCO_EP1","30Rnd_762x39_AK47"], 
["VSS_Vintorez","20Rnd_9x39_SP5_VSS"]
];

and I tried assigning it to the static AI group:

// GREEN MOUNTAIN CHDKZ BASE
[[3707.3,5994.57,0.001],                 //position
10,                        //Number Of units
1,                        //Skill level 0-1 or skill array number if using custom skills "Random" for random Skill array.
5,                 //Primary gun set number. "Random" for random weapon set.
4,                        //Number of magazines
"",                       //Backpack "" for random or classname here.
"Ins_Soldier_GL_DZ",             //Skin "" for random or classname here.
"Random"                  //Gearset number. "Random" for random gear set.
] call spawn_group;

If I leave it on "Random" they will have random loadouts, but if I set it to either 5, or ai_wep5 they will spawn with no weapons! What's the syntax to use there?

 

 

 

2) Mission vehicles are not deleted at server restart. Is there a way to do this?

 

Thank you again and keep it up since the script is awesome!

Link to comment
Share on other sites

Hello and thank you for the awesome work! We implemented it and it's working like a charm, but I got a couple of questions

 

1) I tried setting up a specific weapons loadout for a specific static AI group. I edited the AIconfig file adding this section:

/// 5 - chedaki ///
ai_wep5 = [
["RPK_74","75Rnd_545x39_RPK"], 
["Sa58V_RCO_EP1","30Rnd_762x39_AK47"],
["Pecheneg_DZ","100Rnd_762x54_PK"], 
["AKS_74_GOSHAWK","30Rnd_545x39_AK"],
["Sa58V_RCO_EP1","30Rnd_762x39_AK47"], 
["VSS_Vintorez","20Rnd_9x39_SP5_VSS"]
];

and I tried assigning it to the static AI group:

// GREEN MOUNTAIN CHDKZ BASE
[[3707.3,5994.57,0.001],                 //position
10,                        //Number Of units
1,                        //Skill level 0-1 or skill array number if using custom skills "Random" for random Skill array.
5,                 //Primary gun set number. "Random" for random weapon set.
4,                        //Number of magazines
"",                       //Backpack "" for random or classname here.
"Ins_Soldier_GL_DZ",             //Skin "" for random or classname here.
"Random"                  //Gearset number. "Random" for random gear set.
] call spawn_group;

If I leave it on "Random" they will have random loadouts, but if I set it to either 5, or ai_wep5 they will spawn with no weapons! What's the syntax to use there?

 

 

 

2) Mission vehicles are not deleted at server restart. Is there a way to do this?

 

Thank you again and keep it up since the script is awesome!

You will have to add a case to all the scripts you want to use the loadout on. It would be better to just edit one of the four that is default.

 

It would look like this

for "_x" from 1 to _unitnumber do {
    switch (_gun) do {
        case 0 : {_aiweapon = ai_wep0;};
        case 1 : {_aiweapon = ai_wep1;};
        case 2 : {_aiweapon = ai_wep2;};
        case 3 : {_aiweapon = ai_wep3;};
        case 4 : {_aiweapon = ai_wep4;};
        case 5 : [_aiweapon = ai_wep5;};
        case "Random" : {_aiweapon = ai_wep_random call BIS_fnc_selectRandom;};
Link to comment
Share on other sites

Must say, this looks realy nice ! Have some questions. I read the scripts and need ask :

 

1. can i use with this epoch events - like loot events?

2. where can i see the time of starting and how long will this missions take?

 

sorry, i am not so experinced like you, but great job !

1. You can set-up your loot events to spawn AI by putting the calls you want in the loot event. Just use the same format as in customSpawns.sqf

2. Look near the top of missionCfg.sqf. Time is in seconds

Link to comment
Share on other sites

This may be a dumb question but when it says "ONLY WORKS FOR DAYZ EPOCH CURRENTLY" does that mean just the Chenarus map or for all Dayz Epoch maps?

It can work for all DayZ mods if you know how the database and objectmonitor work for each one. It should work for all maps that the function BIS_fnc_findSafePos works with. There are posts on earlier pages that says how to make them spawn at random set locations where BIS_fnc_findSafePos won't work correctly.

Link to comment
Share on other sites

Something that would be really cool for the next update, would be some more missions. At the moment there's around 7 different ones, what would be really cool if there were around 20 and it ran up to 2-3 missions at once!

 

Also loving the AI in this more and more, they're 100x better than Sarge AI!!!!!

I need some more mission ideas. The reason other mission systems seem like they have more missions is because they have separate missions for each vehicle. WAI uses random vehicles for each mission so each missions could have 5-10 different vehicles that it chooses from.

Link to comment
Share on other sites

Well maybe add something like a construction mission..i did it myself by simply copying the weapon crate mission and changing the loadout but well...

Or you could add some less difficult mission types for players that play alone, like 2 sniper AIs somewhere or a hidden tent with 2-4 bandits guarding it.......or something like a markerless mission with hints--and plaindowns-- like a treasure has been hidden on a big mountain--- where players would have to go and search actually

 

Just some ideas for your absolutely awesome script :D

Link to comment
Share on other sites

Hello Guys,

 

im pretty new at Scripting and Server-Hosting.

 

Ive started renting a server at the Hoster called VILAYER.

 

so my question is where i have to put the WAI folder.

 

 

I hope anybody can help me with that ?

 

 

great wishes

Zernichter

 

Should be here:

 

File Manager > \vilayercodecustom\dayz_epoch\

Link to comment
Share on other sites

I follow the setup info....Download Here (version 0.16)

Setup is easy Put the WAI folder in your main dayz_server directory

 Add above allowConnection = true; in server_monitor.sqf

    [] ExecVM "\z\addons\dayz_server\WAI\init.sqf";
    allowConnection = true;

 

when I try to log into my server after requsting authentication for 30 seconds im standing in a field and cant do anything im running dayz epoch 1.0.3

Link to comment
Share on other sites

Just verifying that these are typo's in the AIconfig.sqf?

Should the sysyem's be system's and the ahare's be share's orare they deliberately labelled that way for a reason?   Also with the Clears should they both be ai_clear or ai_clean or are they meant to be different?

 

Please don't take this to be a smartarse criticism or nitpicking, I'm really new to this and trying to get my head around all the syntax.  Thanks.  Awesome mod btw :)

 

 

///////////////////////////////////////////////////////
///Use the built in mission system (config file for mission system in mission folder)
ai_mission_sysyem = True;

///////////////////////////////////////////////////////
/// clears all Weapons and Magazines off body on death
ai_clear_body = False;

/// Clears dead bodies after given time
ai_clean_dead = True;

/// Time (in seconds) after which a dead body will be cleaned up
cleanup_time = 1800;
///////////////////////////////////////////////////////
/// Sets radius for AI patrols (call spawn_group)
ai_patrol_radius = 300;

/// Sets number of waypoints to add in patrol area (call spawn_group)
ai_patrol_radius_wp = 10;

/// Sets behavior of AI groups
ai_combatmode = "RED";
ai_behaviour = "SAFE";

///////////////////////////////////////////////////////
/// Turns on AI info sharing (Makes them very hard even on low skill settings)
ai_ahare_info = True;

/// Distance AI will let other enemies know of your position (currently only on kill)
ai_share_distance = 300;

///////////////////////////////////////////////////////
/// Gain humanity for killing an AI unit (True: is on. False: is off.)
ai_humanity_gain = True;

/// Humanity added for AI kill
ai_add_humanity = 50;

/// Adds bandit kill when killing an AI (True: on. False: off.)
ai_banditkills_gain = True;

///////////////////////////////////////////////////////
/// Allows you to set a custom skill array for units. (True: will use these arrays. False: will use number in spawn array)
ai_custom_skills = True;

/// Custom skill array. Use 0 to use this with ai_custom_skills = True
ai_custom_array1 = [
["aimingAccuracy",0.60],
["aimingShake",0.60],
["aimingSpeed",1.00],
["endurance",1.00],
["spotDistance",1.00],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];

/// Custom skill array. Use 1 to use this with ai_custom_skills = True
ai_custom_array2 = [
["aimingAccuracy",0.15],
["aimingShake",0.20],
["aimingSpeed",1.00],
["endurance",1.00],
["spotDistance",1.00],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];

/// Custom skill array. Use 2 to use this with ai_custom_skills = True
ai_custom_array3 = [
["aimingAccuracy",0.60],
["aimingShake",0.60],
["aimingSpeed",1.00],
["endurance",1.00],
["spotDistance",1.00],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];

/// Arrays used in "Random" custom skill
ai_skill_random = [ai_custom_array1,ai_custom_array2,ai_custom_array3];

///////////////////////////////////////////////////////
/// Allows AI on static guns to have a loadout
ai_static_useweapon = True;

/// Allows you to set custom array for AI on static weapons. (True: On False: Off)
ai_static_skills = True;

/// Custom skill array. Use this with ai_static_skills = True;
ai_static_array = [
["aimingAccuracy",0.15],
["aimingShake",0.20],
["aimingSpeed",0.50],
["endurance",1.00],
["spotDistance",1.00],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];

///////////////////////////////////////////////////////
/// Gearset arrays for unit Loadouts ///

/// 0 ///
ai_gear0 = [
["ItemBandage","ItemBandage","ItemPainkiller"],
["ItemKnife","ItemFlashlight"]
];

/// 1 ///
ai_gear1 = [
["ItemBandage","ItemBandage","ItemPainkiller"],
["ItemKnife","ItemFlashlight"]
];

/// 2 ///
ai_gear2 = [
["ItemBandage","ItemBandage","ItemPainkiller"],
["ItemKnife","ItemFlashlight"]
];

/// 3 ///
ai_gear3 = [
["ItemBandage","ItemBandage","ItemPainkiller"],
["ItemKnife","ItemFlashlight"]
];

/// 4 ///
ai_gear4 = [
["ItemBandage","ItemBandage","ItemPainkiller"],
["ItemKnife","ItemFlashlight"]
];

/// Gearsets to use if set to "Random" ///
ai_gear_random = [ai_gear0,ai_gear1,ai_gear2,ai_gear3,ai_gear4];

///////////////////////////////////////////////////////
/// Weapon arrays for unit Loadouts ///
/// Format is ["Gun","Ammo"] ///

/// 0 ///
ai_wep0 = [
["AKS_74_UN_kobra","30Rnd_545x39_AKSD"],
["M4A3_CCO_EP1","30Rnd_556x45_Stanag"],
["M4A1_AIM_SD_camo","30Rnd_556x45_StanagSD"],
["M16A4","30Rnd_556x45_Stanag"],
["m8_carbine","30Rnd_556x45_Stanag"],
["BAF_L85A2_RIS_Holo","30Rnd_556x45_Stanag"],
["Sa58V_CCO_EP1","30Rnd_762x39_AK47"]
];

/// 1 ///
ai_wep1 = [
["AK_107_pso","30Rnd_545x39_AK"],
["M16A4_ACG","30Rnd_556x45_Stanag"],
["Sa58V_RCO_EP1","30Rnd_762x39_AK47"],
["SCAR_L_STD_Mk4CQT","30Rnd_556x45_Stanag"],
["BAF_L86A2_ACOG","30Rnd_556x45_Stanag"],
["M4A1_AIM_SD_camo","30Rnd_556x45_StanagSD"],
["M14_EP1","20Rnd_762x51_DMR"],
["M8_sharpshooter","30Rnd_556x45_Stanag"]
];

/// 2 ///
ai_wep2 = [
["AK_107_GL_pso","30Rnd_545x39_AK"],
["AK_107_GL_kobra","30Rnd_545x39_AK"],
["M4A1_HWS_GL","30Rnd_556x45_Stanag"],
["M16A4_ACG_GL","30Rnd_556x45_Stanag"],
["M8_carbineGL","30Rnd_556x45_Stanag"],
["SCAR_L_STD_EGLM_RCO","30Rnd_556x45_Stanag"],
["BAF_L85A2_UGL_Holo","30Rnd_556x45_Stanag"],
["M4A3_RCO_GL_EP1","30Rnd_556x45_Stanag"]
];

/// 3 ///
ai_wep3 = [
["SCAR_H_STD_EGLM_Spect","20rnd_762x51_B_SCAR"],
["M110_NVG_EP1","20rnd_762x51_B_SCAR"],
["SCAR_H_LNG_Sniper_SD","20rnd_762x51_SB_SCAR"],
["SVD_CAMO","10Rnd_762x54_SVD"],
["VSS_Vintorez","20Rnd_9x39_SP5_VSS"],
["DMR","20Rnd_762x51_DMR"],
["M40A3","5Rnd_762x51_M24"]
];

/// 4 ///
ai_wep4 = [
["RPK_74","75Rnd_545x39_RPK"],
["MK_48_DZ","100Rnd_762x51_M240"],
["M249_DZ","200Rnd_556x45_M249"],
["Pecheneg_DZ","100Rnd_762x54_PK"],
["M240_DZ","100Rnd_762x51_M240"]
];

/// Arrays used in "Random" for weapons///
ai_wep_random = [ai_wep0,ai_wep1,ai_wep2,ai_wep3,ai_wep4];

///////////////////////////////////////////////////////
/// Backpacks used when "" for random ///
ai_packs = [
"DZ_Patrol_Pack_EP1",
"DZ_Assault_Pack_EP1",
"DZ_Czech_Vest_Puch",
"DZ_TerminalPack_EP1",
"DZ_ALICE_Pack_EP1",
"DZ_TK_Assault_Pack_EP1",
"DZ_CompactPack_EP1",
"DZ_British_ACU",
"DZ_GunBag_EP1",
"DZ_CivilBackpack_EP1",
"DZ_Backpack_EP1",
"DZ_LargeGunBag_EP1"
];

///////////////////////////////////////////////////////
/// Skins used when "" for random ///
ai_skin = [
"Bandit1_DZ",
"BanditW1_DZ",
"BanditW2_DZ",
"Camo1_DZ",
"Sniper1_DZ",
"Soldier1_DZ",
"Survivor2_DZ",
"SurvivorW2_DZ",
"GUE_Soldier_MG_DZ",
"GUE_Soldier_Sniper_DZ",
"GUE_Soldier_Crew_DZ",
"GUE_Soldier_2_DZ",
"RU_Policeman_DZ",
"Pilot_EP1_DZ",
"Haris_Press_EP1_DZ",
"Ins_Soldier_GL_DZ",
"GUE_Commander_DZ",
"Functionary1_EP1_DZ",
"Priest_DZ",
"Rocker1_DZ",
"Rocker2_DZ",
"Rocker3_DZ",
"Rocker4_DZ",
"TK_INS_Warlord_EP1_DZ",
"TK_INS_Soldier_EP1_DZ",
"Soldier_Sniper_PMC_DZ",
"Soldier_TL_PMC_DZ",
"FR_OHara_DZ",
"FR_Rodriguez_DZ",
"CZ_Soldier_Sniper_EP1_DZ",
"Graves_Light_DZ",
"Bandit2_DZ",
"SurvivorWcombat_DZ"
];
//////////////////////////////////////////////////////
WAIconfigloaded = True;///////////////////////////////////////////////////////
///Use the built in mission system (config file for mission system in mission folder)
ai_mission_sysyem = True;

///////////////////////////////////////////////////////
/// clears all Weapons and Magazines off body on death
ai_clear_body = False;

/// Clears dead bodies after given time
ai_clean_dead = True;

/// Time (in seconds) after which a dead body will be cleaned up
cleanup_time = 1800;
///////////////////////////////////////////////////////
/// Sets radius for AI patrols (call spawn_group)
ai_patrol_radius = 300;

/// Sets number of waypoints to add in patrol area (call spawn_group)
ai_patrol_radius_wp = 10;

/// Sets behavior of AI groups
ai_combatmode = "RED";
ai_behaviour = "SAFE";

///////////////////////////////////////////////////////
/// Turns on AI info sharing (Makes them very hard even on low skill settings)
ai_ahare_info = True;

/// Distance AI will let other enemies know of your position (currently only on kill)
ai_share_distance = 300;

///////////////////////////////////////////////////////
/// Gain humanity for killing an AI unit (True: is on. False: is off.)
ai_humanity_gain = True;

/// Humanity added for AI kill
ai_add_humanity = 50;

/// Adds bandit kill when killing an AI (True: on. False: off.)
ai_banditkills_gain = True;

///////////////////////////////////////////////////////
/// Allows you to set a custom skill array for units. (True: will use these arrays. False: will use number in spawn array)
ai_custom_skills = True;

/// Custom skill array. Use 0 to use this with ai_custom_skills = True
ai_custom_array1 = [
["aimingAccuracy",0.60],
["aimingShake",0.60],
["aimingSpeed",1.00],
["endurance",1.00],
["spotDistance",1.00],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];

/// Custom skill array. Use 1 to use this with ai_custom_skills = True
ai_custom_array2 = [
["aimingAccuracy",0.15],
["aimingShake",0.20],
["aimingSpeed",1.00],
["endurance",1.00],
["spotDistance",1.00],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];

/// Custom skill array. Use 2 to use this with ai_custom_skills = True
ai_custom_array3 = [
["aimingAccuracy",0.60],
["aimingShake",0.60],
["aimingSpeed",1.00],
["endurance",1.00],
["spotDistance",1.00],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];

/// Arrays used in "Random" custom skill
ai_skill_random = [ai_custom_array1,ai_custom_array2,ai_custom_array3];

///////////////////////////////////////////////////////
/// Allows AI on static guns to have a loadout
ai_static_useweapon = True;

/// Allows you to set custom array for AI on static weapons. (True: On False: Off)
ai_static_skills = True;

/// Custom skill array. Use this with ai_static_skills = True;
ai_static_array = [
["aimingAccuracy",0.15],
["aimingShake",0.20],
["aimingSpeed",0.50],
["endurance",1.00],
["spotDistance",1.00],
["spotTime",1.00],
["courage",1.00],
["reloadSpeed",1.00],
["commanding",1.00],
["general",1.00]
];

///////////////////////////////////////////////////////
/// Gearset arrays for unit Loadouts ///

/// 0 ///
ai_gear0 = [
["ItemBandage","ItemBandage","ItemPainkiller"],
["ItemKnife","ItemFlashlight"]
];

/// 1 ///
ai_gear1 = [
["ItemBandage","ItemBandage","ItemPainkiller"],
["ItemKnife","ItemFlashlight"]
];

/// 2 ///
ai_gear2 = [
["ItemBandage","ItemBandage","ItemPainkiller"],
["ItemKnife","ItemFlashlight"]
];

/// 3 ///
ai_gear3 = [
["ItemBandage","ItemBandage","ItemPainkiller"],
["ItemKnife","ItemFlashlight"]
];

/// 4 ///
ai_gear4 = [
["ItemBandage","ItemBandage","ItemPainkiller"],
["ItemKnife","ItemFlashlight"]
];

/// Gearsets to use if set to "Random" ///
ai_gear_random = [ai_gear0,ai_gear1,ai_gear2,ai_gear3,ai_gear4];

///////////////////////////////////////////////////////
/// Weapon arrays for unit Loadouts ///
/// Format is ["Gun","Ammo"] ///

/// 0 ///
ai_wep0 = [
["AKS_74_UN_kobra","30Rnd_545x39_AKSD"],
["M4A3_CCO_EP1","30Rnd_556x45_Stanag"],
["M4A1_AIM_SD_camo","30Rnd_556x45_StanagSD"],
["M16A4","30Rnd_556x45_Stanag"],
["m8_carbine","30Rnd_556x45_Stanag"],
["BAF_L85A2_RIS_Holo","30Rnd_556x45_Stanag"],
["Sa58V_CCO_EP1","30Rnd_762x39_AK47"]
];

/// 1 ///
ai_wep1 = [
["AK_107_pso","30Rnd_545x39_AK"],
["M16A4_ACG","30Rnd_556x45_Stanag"],
["Sa58V_RCO_EP1","30Rnd_762x39_AK47"],
["SCAR_L_STD_Mk4CQT","30Rnd_556x45_Stanag"],
["BAF_L86A2_ACOG","30Rnd_556x45_Stanag"],
["M4A1_AIM_SD_camo","30Rnd_556x45_StanagSD"],
["M14_EP1","20Rnd_762x51_DMR"],
["M8_sharpshooter","30Rnd_556x45_Stanag"]
];

/// 2 ///
ai_wep2 = [
["AK_107_GL_pso","30Rnd_545x39_AK"],
["AK_107_GL_kobra","30Rnd_545x39_AK"],
["M4A1_HWS_GL","30Rnd_556x45_Stanag"],
["M16A4_ACG_GL","30Rnd_556x45_Stanag"],
["M8_carbineGL","30Rnd_556x45_Stanag"],
["SCAR_L_STD_EGLM_RCO","30Rnd_556x45_Stanag"],
["BAF_L85A2_UGL_Holo","30Rnd_556x45_Stanag"],
["M4A3_RCO_GL_EP1","30Rnd_556x45_Stanag"]
];

/// 3 ///
ai_wep3 = [
["SCAR_H_STD_EGLM_Spect","20rnd_762x51_B_SCAR"],
["M110_NVG_EP1","20rnd_762x51_B_SCAR"],
["SCAR_H_LNG_Sniper_SD","20rnd_762x51_SB_SCAR"],
["SVD_CAMO","10Rnd_762x54_SVD"],
["VSS_Vintorez","20Rnd_9x39_SP5_VSS"],
["DMR","20Rnd_762x51_DMR"],
["M40A3","5Rnd_762x51_M24"]
];

/// 4 ///
ai_wep4 = [
["RPK_74","75Rnd_545x39_RPK"],
["MK_48_DZ","100Rnd_762x51_M240"],
["M249_DZ","200Rnd_556x45_M249"],
["Pecheneg_DZ","100Rnd_762x54_PK"],
["M240_DZ","100Rnd_762x51_M240"]
];

/// Arrays used in "Random" for weapons///
ai_wep_random = [ai_wep0,ai_wep1,ai_wep2,ai_wep3,ai_wep4];

///////////////////////////////////////////////////////
/// Backpacks used when "" for random ///
ai_packs = [
"DZ_Patrol_Pack_EP1",
"DZ_Assault_Pack_EP1",
"DZ_Czech_Vest_Puch",
"DZ_TerminalPack_EP1",
"DZ_ALICE_Pack_EP1",
"DZ_TK_Assault_Pack_EP1",
"DZ_CompactPack_EP1",
"DZ_British_ACU",
"DZ_GunBag_EP1",
"DZ_CivilBackpack_EP1",
"DZ_Backpack_EP1",
"DZ_LargeGunBag_EP1"
];

///////////////////////////////////////////////////////
/// Skins used when "" for random ///
ai_skin = [
"Bandit1_DZ",
"BanditW1_DZ",
"BanditW2_DZ",
"Camo1_DZ",
"Sniper1_DZ",
"Soldier1_DZ",
"Survivor2_DZ",
"SurvivorW2_DZ",
"GUE_Soldier_MG_DZ",
"GUE_Soldier_Sniper_DZ",
"GUE_Soldier_Crew_DZ",
"GUE_Soldier_2_DZ",
"RU_Policeman_DZ",
"Pilot_EP1_DZ",
"Haris_Press_EP1_DZ",
"Ins_Soldier_GL_DZ",
"GUE_Commander_DZ",
"Functionary1_EP1_DZ",
"Priest_DZ",
"Rocker1_DZ",
"Rocker2_DZ",
"Rocker3_DZ",
"Rocker4_DZ",
"TK_INS_Warlord_EP1_DZ",
"TK_INS_Soldier_EP1_DZ",
"Soldier_Sniper_PMC_DZ",
"Soldier_TL_PMC_DZ",
"FR_OHara_DZ",
"FR_Rodriguez_DZ",
"CZ_Soldier_Sniper_EP1_DZ",
"Graves_Light_DZ",
"Bandit2_DZ",
"SurvivorWcombat_DZ"
];
//////////////////////////////////////////////////////
WAIconfigloaded = True;

Link to comment
Share on other sites

private ["_nul","_result","_pos","_wsDone","_dir","_block","_isOK","_countr","_objWpnTypes","_objWpnQty","_dam","_selection","_totalvehicles","_object","_idKey","_type","_ownerID","_worldspace","_intentory","_hitPoints","_fuel","_damage","_date","_key","_outcome","_vehLimit","_hiveResponse","_objectCount","_codeCount","_objectArray","_hour","_minute","_data","_status","_val","_traderid","_retrader","_traderData","_id","_lockable","_debugMarkerPosition","_vehicle_0"];
 
dayz_versionNo = getText(configFile >> "CfgMods" >> "DayZ" >> "version");
dayz_hiveVersionNo = getNumber(configFile >> "CfgMods" >> "DayZ" >> "hiveVersion");
 
if ((count playableUnits == 0) and !isDedicated) then {
isSinglePlayer = true;
};
 
waitUntil{initialized}; //means all the functions are now defined
 
diag_log "HIVE: Starting";
 
waituntil{isNil "sm_done"}; // prevent server_monitor be called twice (bug during login of the first player)
 
// Custom Configs
if(isnil "MaxVehicleLimit") then {
MaxVehicleLimit = 50;
};
if(isnil "MaxHeliCrashes") then {
MaxHeliCrashes = 5;
};
if(isnil "MaxDynamicDebris") then {
MaxDynamicDebris = 100;
};
if(isnil "MaxAmmoBoxes") then {
MaxAmmoBoxes = 3;
};
if(isnil "MaxMineVeins") then {
MaxMineVeins = 50;
};
// Custon Configs End
 
if (isServer and isNil "sm_done") then {
 
serverVehicleCounter = [];
_hiveResponse = [];
 
for "_i" from 1 to 5 do {
diag_log "HIVE: trying to get objects";
_key = format["CHILD:302:%1:", dayZ_instance];
_hiveResponse = _key call server_hiveReadWrite;  
if ((((isnil "_hiveResponse") || {(typeName _hiveResponse != "ARRAY")}) || {((typeName (_hiveResponse select 1)) != "SCALAR")})) then {
diag_log ("HIVE: connection problem... HiveExt response:"+str(_hiveResponse));
_hiveResponse = ["",0];
else {
diag_log ("HIVE: found "+str(_hiveResponse select 1)+" objects" );
_i = 99; // break
};
};
 
_objectArray = [];
if ((_hiveResponse select 0) == "ObjectStreamStart") then {
_objectCount = _hiveResponse select 1;
diag_log ("HIVE: Commence Object Streaming...");
for "_i" from 1 to _objectCount do { 
_hiveResponse = _key call server_hiveReadWriteLarge;
_objectArray set [_i - 1, _hiveResponse];
//diag_log (format["HIVE dbg %1 %2", typeName _hiveResponse, _hiveResponse]);
};
diag_log ("HIVE: got " + str(count _objectArray) + " objects");
};
 
// # START OF STREAMING #
_countr = 0;
_totalvehicles = 0;
{
//Parse Array
_countr = _countr + 1;
 
_idKey = _x select 1;
_type = _x select 2;
_ownerID = _x select 3;
 
_worldspace = _x select 4;
_intentory= _x select 5;
_hitPoints= _x select 6;
_fuel = _x select 7;
_damage = _x select 8;
 
_dir = 0;
_pos = [0,0,0];
_wsDone = false;
if (count _worldspace >= 2) then
{
_dir = _worldspace select 0;
if (count (_worldspace select 1) == 3) then {
_pos = _worldspace select 1;
_wsDone = true;
}
};
if (!_wsDone) then {
if (count _worldspace >= 1) then { _dir = _worldspace select 0; };
_pos = [getMarkerPos "center",0,4000,10,0,2000,0] call BIS_fnc_findSafePos;
if (count _pos < 3) then { _pos = [_pos select 0,_pos select 1,0]; };
diag_log ("MOVED OBJ: " + str(_idKey) + " of class " + _type + " to pos: " + str(_pos));
};
 
if (_damage < 1) then {
//diag_log format["OBJ: %1 - %2", _idKey,_type];
 
//Create it
_object = createVehicle [_type, _pos, [], 0, "CAN_COLLIDE"];
_object setVariable ["lastUpdate",time];
_object setVariable ["ObjectID", _idKey, true];
 
_lockable = 0;
if(isNumber (configFile >> "CfgVehicles" >> _type >> "lockable")) then {
_lockable = getNumber(configFile >> "CfgVehicles" >> _type >> "lockable");
};
 
// fix for leading zero issues on safe codes after restart
if (_lockable == 4) then {
_codeCount = (count (toArray _ownerID));
if(_codeCount == 3) then {
_ownerID = format["0%1", _ownerID];
};
if(_codeCount == 2) then {
_ownerID = format["00%1", _ownerID];
};
if(_codeCount == 1) then {
_ownerID = format["000%1", _ownerID];
};
};
 
if (_lockable == 3) then {
_codeCount = (count (toArray _ownerID));
if(_codeCount == 2) then {
_ownerID = format["0%1", _ownerID];
};
if(_codeCount == 1) then {
_ownerID = format["00%1", _ownerID];
};
};
 
_object setVariable ["CharacterID", _ownerID, true];
 
clearWeaponCargoGlobal  _object;
clearMagazineCargoGlobal  _object;
// _object setVehicleAmmo DZE_vehicleAmmo;
 
if ((typeOf _object) in dayz_allowedObjects) then {
_object addMPEventHandler ["MPKilled",{_this call object_handleServerKilled;}];
// Test disabling simulation server side on buildables only.
_object enableSimulation false;
// used for inplace upgrades and lock/unlock of safe
_object setVariable ["OEMPos", _pos, true];
};
 
_object setdir _dir;
_object setposATL _pos;
_object setDamage _damage;
 
if (count _intentory > 0) then {
if (_type in DZE_LockedStorage) then {
// Fill variables with loot
_object setVariable ["WeaponCargo", (_intentory select 0), true];
_object setVariable ["MagazineCargo", (_intentory select 1), true];
_object setVariable ["BackpackCargo", (_intentory select 2), true];
} else {
 
//Add weapons
_objWpnTypes = (_intentory select 0) select 0;
_objWpnQty = (_intentory select 0) select 1;
_countr = 0;
{
if(_x in (DZE_REPLACE_WEAPONS select 0)) then {
_x = (DZE_REPLACE_WEAPONS select 1) select ((DZE_REPLACE_WEAPONS select 0) find _x);
};
_isOK = isClass(configFile >> "CfgWeapons" >> _x);
if (_isOK) then {
_block = getNumber(configFile >> "CfgWeapons" >> _x >> "stopThis") == 1;
if (!_block) then {
_object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)];
};
};
_countr = _countr + 1;
} forEach _objWpnTypes; 
 
//Add Magazines
_objWpnTypes = (_intentory select 1) select 0;
_objWpnQty = (_intentory select 1) select 1;
_countr = 0;
{
if (_x == "BoltSteel") then { _x = "WoodenArrow" }; // Convert BoltSteel to WoodenArrow
if (_x == "ItemTent") then { _x = "ItemTentOld" };
_isOK = isClass(configFile >> "CfgMagazines" >> _x);
if (_isOK) then {
_block = getNumber(configFile >> "CfgMagazines" >> _x >> "stopThis") == 1;
if (!_block) then {
_object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)];
};
};
_countr = _countr + 1;
} forEach _objWpnTypes;
 
//Add Backpacks
_objWpnTypes = (_intentory select 2) select 0;
_objWpnQty = (_intentory select 2) select 1;
_countr = 0;
{
_isOK = isClass(configFile >> "CfgVehicles" >> _x);
if (_isOK) then {
_block = getNumber(configFile >> "CfgVehicles" >> _x >> "stopThis") == 1;
if (!_block) then {
_object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)];
};
};
_countr = _countr + 1;
} forEach _objWpnTypes;
};
};
 
if (_object isKindOf "AllVehicles") then {
{
_selection = _x select 0;
_dam = _x select 1;
if (_selection in dayZ_explosiveParts and _dam > 0.8) then {_dam = 0.8};
[_object,_selection,_dam] call object_setFixServer;
} forEach _hitpoints;
 
_object setFuel _fuel;
 
if (!((typeOf _object) in dayz_allowedObjects)) then {
 
//_object setvelocity [0,0,1];
_object call fnc_veh_ResetEH;
 
if(_ownerID != "0" and !(_object isKindOf "Bicycle")) then {
_object setvehiclelock "locked";
};
 
_totalvehicles = _totalvehicles + 1;
 
// total each vehicle
serverVehicleCounter set [count serverVehicleCounter,_type];
};
};
 
//Monitor the object
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object];
};
} forEach _objectArray;
// # END OF STREAMING #
 
 
// preload server traders menu data into cache
{
// get tids
_traderData = call compile format["menu_%1;",_x];
if(!isNil "_traderData") then {
{
_traderid = _x select 1;
 
_retrader = [];
 
_key = format["CHILD:399:%1:",_traderid];
_data = "HiveEXT" callExtension _key;
 
//diag_log "HIVE: Request sent";
 
//Process result
_result = call compile format ["%1",_data];
_status = _result select 0;
 
if (_status == "ObjectStreamStart") then {
_val = _result select 1;
//Stream Objects
//diag_log ("HIVE: Commence Menu Streaming...");
call compile format["ServerTcache_%1 = [];",_traderid];
for "_i" from 1 to _val do {
_data = "HiveEXT" callExtension _key;
_result = call compile format ["%1",_data];
call compile format["ServerTcache_%1 set [count ServerTcache_%1,%2]",_traderid,_result];
_retrader set [count _retrader,_result];
};
//diag_log ("HIVE: Streamed " + str(_val) + " objects");
};
 
} forEach (_traderData select 0);
};
} forEach serverTraders;
 
//  spawn_vehicles
_vehLimit = MaxVehicleLimit - _totalvehicles;
diag_log ("HIVE: Spawning # of Vehicles: " + str(_vehLimit));
if(_vehLimit > 0) then {
for "_x" from 1 to _vehLimit do {
[] spawn spawn_vehicles;
};
};
//  spawn_roadblocks
diag_log ("HIVE: Spawning # of Debris: " + str(MaxDynamicDebris));
for "_x" from 1 to MaxDynamicDebris do {
[] spawn spawn_roadblocks;
};
//  spawn_ammosupply at server start 1% of roadblocks
diag_log ("HIVE: Spawning # of Ammo Boxes: " + str(MaxAmmoBoxes));
for "_x" from 1 to MaxAmmoBoxes do {
[] spawn spawn_ammosupply;
};
// call spawning mining veins
diag_log ("HIVE: Spawning # of Veins: " + str(MaxMineVeins));
for "_x" from 1 to MaxMineVeins do {
[] spawn spawn_mineveins;
};
 
if(isnil "dayz_MapArea") then {
dayz_MapArea = 10000;
};
if(isnil "HeliCrashArea") then {
HeliCrashArea = dayz_MapArea / 2;
};
if(isnil "OldHeliCrash") then {
OldHeliCrash = false;
};
 
[] ExecVM "\z\addons\dayz_server\WAI\init.sqf";
allowConnection = true;
 
// [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
if(OldHeliCrash) then {
_nul = [3, 4, (50 * 60), (15 * 60), 0.75, 'center', HeliCrashArea, true, false] spawn server_spawnCrashSite;
};
 
if (isDedicated) then {
// Epoch Events
_id = [] spawn server_spawnEvents;
// server cleanup
_id = [] execFSM "\z\addons\dayz_server\system\server_cleanup.fsm";
 
// spawn debug box
_debugMarkerPosition = getMarkerPos "respawn_west";
_debugMarkerPosition = [(_debugMarkerPosition select 0),(_debugMarkerPosition select 1),1];
_vehicle_0 = createVehicle ["DebugBox_DZ", _debugMarkerPosition, [], 0, "CAN_COLLIDE"];
_vehicle_0 setPos _debugMarkerPosition;
_vehicle_0 setVariable ["ObjectID","1",true];
 
// max number of spawn markers
if(isnil "spawnMarkerCount") then {
spawnMarkerCount = 10;
};
 
actualSpawnMarkerCount = 0;
 
// count valid spawn marker positions
for "_i" from 0 to spawnMarkerCount do {
if (!([(getMarkerPos format["spawn%1", _i]), [0,0,0]] call BIS_fnc_areEqual)) then {
actualSpawnMarkerCount = actualSpawnMarkerCount + 1;
} else {
// exit since we did not find any further markers
_i = spawnMarkerCount + 99;
};
 
};
diag_log format["Total Number of spawn locations %1", actualSpawnMarkerCount];
};
 
sm_done = true;
publicVariable "sm_done";
};
 
 
 
 
 
--the WAI folder is in dayz_server.pbo same place as the compile, init, missions,modules,system,config.bin and Pbo.prefix.txt
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
×
×
  • Create New...