eai icon indicating copy to clipboard operation
eai copied to clipboard

how to equip bots?/Как снарядить ботов?

Open gikens opened this issue 3 years ago • 75 comments

Привет уважаемый разработчик мода, возникла проблема, в файле HumanLoadout.json и прочих подобных файлов поменял снаряжение для ботов, но они все также спавняться со своим старндартным снаряжением, как исправить?

Hello dear mod developer, there is a problem in the HumanLoadout file.json and other similar files have changed the equipment for bots, but they still spawn with their stardart equipment, how can I fix it?

gikens avatar Dec 30 '21 11:12 gikens

Доброго времени суток. Решается всё следующим способом:

  1. Вставляй вместо своего - вставляй этот файл: HumanLoadout.txt
  2. Направляемся в: Server\mpmissions\dayzOffline.ChernarusPlus\eAI\AI_init.c
  3. Находим строку: ref array<string> patrol_loadouts =
  4. Сверяем каждую строку с списком патрулей (т.е. по дефолту 10 патрулей и можно сделать уникальную разгрузку для каждого патруля ArrayExample.txt
  5. Необходимо доукомплектовать метод: OnUnitSpawn(eAIBase unit), в нём можно накрутить обвесы AiLoadoutExample.txt
  6. PROFIT!!!!!!

//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- English version:

Good daytime. Your situation might be fixed that way:

  1. Replace yours HumanLoadout.json with mine (rename from .txt to .json: HumanLoadout.txt
  2. Get to the path: Server\mpmissions\dayzOffline.ChernarusPlus\eAI\AI_init.c
  3. Find the line like: ref array<string> patrol_loadouts =
  4. Check amount of patrols and amount of loadouts THEY MUST BE EQUAL! ArrayExample.txt
  5. You need to override method: OnUnitSpawn(eAIBase unit), there you may set additional attachments for yours AI firearm AiLoadoutExample.txt
  6. PROFIT!!!!!!

griha41 avatar Aug 25 '23 23:08 griha41

I made a new file for the loadout and in no way do the bots come with the equipment I selected, and every time it creates a new SoldierLoadout.json file, I can edit this new file but within the game it doesn't change anything, and if I delete it it comes back appear next...

fiber1985 avatar Sep 12 '23 17:09 fiber1985

I made a new file for the loadout and in no way do the bots come with the equipment I selected, and every time it creates a new SoldierLoadout.json file, I can edit this new file but within the game it doesn't change anything, and if I delete it it comes back appear next...

Please read my answer carefully. It contains everything to not to be ****ed up. If write simply - checkout array of loadouts, items count in array MUST BE qual to ammount of patrols.

And try to not make any single mistake in loadout coz it might brake the loading of json file and everything went to trash.

Also there's one way where you may make a mistake is the function void InitDynamicPatrols()

There there's if statement like if (i< patrol_loadouts.Count()) { loadout = patrol_loadouts[i]; } else { loadout = "HumanLoadout.json"; // Here you may set any other loadout, but keep in mind that state will submitted if made a mistake with count of loadouts (less then) and patrols count. }

griha41 avatar Sep 12 '23 17:09 griha41

I've been trying to fix this for 2 days now... if you could help me...

// Patrol 1 = Balota strip ref array patrol_1 = {"5237.821777 9.568775 2157.804199", "4887.835449 9.560701 2578.265625", "4917.622559 9.539299 2599.980469"};

// Patrol 2 = SW Rail Line ref array patrol_2 = {"41.383652 6.637133 1568.725464", "167.029785 6.660925 1589.156372", "399.000854 6.637136 1605.268677", "450.407135 6.660660 1618.758667", "482.006226 6.711864 1632.124023", "799.668762 6.740325 1846.262695", "847.898071 5.795653 1886.695801", "923.040100 5.795653 1959.974121", "976.875427 5.795653 2031.899414", "1050.173218 6.664209 2158.251709", "1157.952637 5.795209 2307.297119", "1187.608032 6.407721 2340.853271", "1259.927368 6.011772 2363.105225", "1333.362915 6.637136 2342.896973", "1469.527222 6.721370 2247.018555", "1514.207764 5.795653 2222.483398", "1572.351074 6.581270 2193.880371", "1639.594482 6.438149 2169.135010", "1696.991211 5.795653 2156.455811", "1763.947998 6.373237 2143.247314", "1889.594116 6.014451 2166.340820", "2079.179688 6.529642 2219.987549", "2176.673584 6.011375 2196.734375", "2244.440430 5.995491 2087.459229", "2348.422119 5.795653 2048.190186", "2641.000000 6.692032 1985.662354", "2772.157471 6.697611 1985.912354", "3044.920166 5.795653 2044.465820", "2772.157471 6.697611 1985.912354", "2641.000000 6.692032 1985.662354", "2348.422119 5.795653 2048.190186", "2244.440430 5.995491 2087.459229", "2176.673584 6.011375 2196.734375", "2079.179688 6.529642 2219.987549", "1889.594116 6.014451 2166.340820", "1763.947998 6.373237 2143.247314", "1696.991211 5.795653 2156.455811", "1639.594482 6.438149 2169.135010", "1572.351074 6.581270 2193.880371", "1514.207764 5.795653 2222.483398", "1469.527222 6.721370 2247.018555", "1333.362915 6.637136 2342.896973", "1259.927368 6.011772 2363.105225", "1187.608032 6.407721 2340.853271", "1157.952637 5.795209 2307.297119", "1050.173218 6.664209 2158.251709", "976.875427 5.795653 2031.899414", "923.040100 5.795653 1959.974121", "847.898071 5.795653 1886.695801", "799.668762 6.740325 1846.262695", "482.006226 6.711864 1632.124023", "450.407135 6.660660 1618.758667"};

// Patrol 3 = Cherno Port ref array patrol_3 = {"7332.387695 5.712450 2651.121338", "7632.803223 5.507639 3075.661865", "7621.013184 5.892049 3083.053223", "7321.484375 5.448769 2658.244141"};

// Patrol 4 = Elektro Yard ref array patrol_4 = {"10825.153320 5.894602 2555.271240", "10853.957031 6.433348 2635.236816", "10889.441406 5.977321 2749.464111", "10852.090820 6.012342 2760.362793", "10828.861328 6.012496 2730.357910", "10794.523438 6.012444 2636.897705", "10779.160156 6.012487 2593.712158", "10781.082031 6.004701 2574.147949"};

// Patrol 5 = Solnechny south ref array patrol_5 = {"13392.708984 5.809348 5952.577637", "13369.891602 6.012489 5624.214844", "13373.618164 5.943049 5486.794434", "13369.891602 6.012489 5624.214844"};

// Patrol 6 = Rify Trail ref array patrol_6 = {"13342.375977 27.020344 11228.225586", "13469.069336 11.282786 11163.261719", "13567.762695 6.128973 11127.067383", "13620.910156 8.011324 11244.537109", "13567.762695 6.128973 11127.067383", "13469.069336 11.282786 11163.261719"};

// Patrol 7 = Nizhneye ref array patrol_7 = {"12879.688477 5.743166 8590.398438", "12983.769531 6.060859 8323.492188", "13000.213867 6.062475 8330.422852", "12967.809570 5.781274 8447.635742"};

// Patrol 8 = NWAF North ref array patrol_8 = {"4078.499268 339.012421 10802.854492", "4277.165039 339.012360 10922.452148", "4271.527832 339.008148 10938.139648", "4064.494385 339.012421 10818.675781"};

// Patrol 9 = NWAF south ref array patrol_9 = {"4772.428711 338.964355 9583.963867", "4639.255859 339.012390 9815.970703", "4978.569336 339.012451 10004.463867", "4639.255859 339.012390 9815.970703"};

// Patrol 10 = Tisy ref array patrol_10 = {"1724.632080 451.730408 14298.412109", "1681.035522 451.784302 14278.791016", "1668.385742 451.730408 14268.739258", "1653.012695 451.784302 14245.443359", "1662.009521 451.784302 14220.044922", "1668.885010 451.730408 14177.100586", "1678.905029 451.784302 14134.460938", "1687.656250 451.784302 14097.293945", "1691.055054 451.728760 14072.710938", "1697.563721 450.094635 14019.088867", "1701.266235 448.636108 13981.079102", "1709.151733 448.368225 13969.950195", "1726.191772 447.882568 13954.740234", "1734.303101 447.342072 13945.562500", "1736.849487 447.158569 13939.061523", "1803.257568 436.318970 13812.399414", "1802.478149 435.682281 13794.238281", "1764.742676 434.271759 13667.715820", "1753.983521 434.111572 13660.847656", "1697.765381 433.031982 13621.431641", "1625.751953 437.192169 13583.775391", "1615.443726 437.193420 13582.367188", "1586.155762 439.010864 13609.286133", "1566.816040 441.081787 13643.261719", "1554.550049 441.587372 13645.919922", "1533.254028 440.683624 13646.856445", "1470.583130 444.685120 13679.353516", "1448.422729 446.229736 13681.502930", "1397.534424 448.255707 13663.409180", "1377.747681 448.799530 13661.333984", "1356.402222 451.658264 13669.961914", "1339.632813 454.855988 13690.362305", "1311.232178 457.548615 13730.733398", "1368.332275 455.560181 13762.721680", "1389.098022 453.795563 13785.572266", "1394.411499 451.237183 13801.572266", "1398.934204 451.644989 13828.162109", "1419.962524 456.061951 13891.482422", "1409.579224 458.430359 13947.408203", "1421.006104 459.254517 13993.981445", "1422.121094 459.807831 14022.114258", "1388.509277 462.222443 14044.217773", "1388.548340 462.354797 14044.183594", "1333.772217 463.948151 14062.096680", "1350.346069 465.658081 14107.701172", "1461.509521 459.874268 14133.793945", "1503.123291 455.995056 14137.425781", "1554.196045 452.867004 14107.243164", "1574.911743 452.540283 14100.198242", "1629.664673 451.792175 14197.793945", "1636.238647 451.792175 14221.260742", "1671.278564 451.792175 14275.020508", "1645.910522 451.807617 14315.247070", "1669.397339 451.792175 14331.668945", "1685.370361 451.792175 14341.243164"};

// If you add another patrol array, add it to this list ref array<array> patrol_list = { patrol_1, patrol_2, patrol_3, patrol_4, patrol_5, patrol_6, patrol_7, patrol_8, patrol_9, patrol_10 };

// IMPORTANT: If you add an entry to the above list, pick the loadout for it by adding the loadout filename to this list ref array patrol_loadouts = { "SoldadosBlack.json", // patrol_1 "SoldadosBlack.json", // patrol_2 "SoldadosBlack.json", // patrol_3 "SoldadosBlack.json", // patrol_4 "SoldadosBlack.json", // patrol_5 "SoldadosBlack.json", // patrol_6 "SoldadosBlack.json", // patrol_7 "SoldadosBlack.json", // patrol_8 "SoldadosBlack.json", // patrol_9 "SoldadosBlack.json" // patrol_10 };

// you may change these quantities const int NUMBER_PER_PATROL = 5; // Number of AI per patrol const int MAXR = 800; // This is the main spawn radius- how close a player needs to be to spawn them in. const int MINR = 250; // If a player is this close to the patrol start point, it is too close for them to spawn const int DESPAWNR = 1000; // If all players are this far away, they despawn. const int RESPAWN_SECONDS = 300; // The amount of seconds before a new patrol will spawn, after they both die

class CustomPatrol : eAIDynamicPatrol { override void OnPatrolSpawn(eAIGroup patrol) { // Uncomment this line to change the faction of the patrol from Raiders (default) // eAIFactionGuards for example is a faction which only kills players who have their weapons out // patrol.SetFaction(new eAIFactionGuards());

	// Uncomment this line to slow down or speed up the patrol (1.0 to 3.0)
patrol.SetSpeedLimit(1.0);
}
override void OnUnitSpawn(eAIBase unit) {
	// Uncomment this to give the AI unlimited magazines (new one is added on reload)
unit.SetUnlimitedMags(true);
	
	// You can also do anything you would do in the StartingEquipSetup() for players here
	
	// These lines will add attachments the same way you would for a player. However, the AI must have the M4A1 class in the Loadout.json file already for it to work.
	//Weapon_Base weapon = Weapon_Base.Cast(unit.GetItemInHands());
	//weapon.GetInventory().CreateAttachment("M4_PlasticHndgrd");
	//weapon.GetInventory().CreateAttachment("M4_OEBttstck");
	//weapon.GetInventory().CreateAttachment("M4_CarryHandleOptic");
}

};

autoptr array<autoptr eAIDynamicPatrol> patrols = {};

void InitDynamicPatrols() { for (int i = 0; i < patrol_list.Count(); i++) { string loadout = "SoldadosBlack.json"; // default if (i < patrol_loadouts.Count()) loadout = patrol_loadouts[i]; autoptr CustomPatrol pat = new CustomPatrol(patrol_list[i][0], patrol_list[i], loadout, NUMBER_PER_PATROL, MINR, MAXR, DESPAWNR, RESPAWN_SECONDS); patrols.Insert(pat); pat.UpdateTriggers(); } }

void SpawnSentry(vector pos, string loadout = "SoldadosBlack.json") { eAIGame game = MissionServer.Cast(GetGame().GetMission()).GetEAIGame(); eAIBase ai = game.SpawnAI_Sentry(pos, loadout); }

modded class CustomMission { void StartingEquipSetup(PlayerBase player, bool clothesChosen) { m_eaiGame.GetGroupByLeader(player); super.StartingEquipSetup(player, clothesChosen); } };

fiber1985 avatar Sep 12 '23 17:09 fiber1985

{ "Shirts": [ "MMG_combatshirt_dark_woodland" ], "Pants": [ "MMG_combatpants_dark_woodland" ], "Shoes": [ "MMG_boots_dark_woodland" ], "BackPacks": [ "MMG_camelback_dark_woodland" ], "Vests": [ "MMG_MK_V_Armor_dark_woodland" ], "Headgear": [ "MMG_striker_helmet_dark_woodland" ], "Gloves": [ "mmg_tactical_gloves_dark_woodland" ], "Misc": [ "MMG_balaclava_dark_woodland" ], "ClothesHealth": [ 70, 100 ], "WeaponMelee": [ "MeleeBat" ], "WeaponRifle": [ "Snafu_ScarH_DKMC_GUN", "GCGN_M11_Barret", "Snafu_pkp_Black_GUN" ], "WeaponRifleMagCount": [ 1, 3 ], "WeaponHandgun": [ "SN_Glock19" ], "WeaponHandgunMagCount": [ 1, 3 ], "WeaponHealth": [ 70, 100 ], "Loot": [ "SodaCan_Cola", ], "LootRandom": [ "SodaCan_Cola" ], "LootChance": [ 50, 50, 50, 50, 50, 50, 50, 50 ], "LootHealth": [ 70, 100 ], "Locked": 0 }

fiber1985 avatar Sep 12 '23 17:09 fiber1985

Even if I edit the default SoldierLoadout.json file it doesn't load, if I just change the weapon, it continues to come with the default weapon, if I delete the SoldierLoadout.json file the system creates another file... I don't know what to do anymore ..

fiber1985 avatar Sep 12 '23 17:09 fiber1985

First point is the your JSON: "Loot": [ "SodaCan_Cola", ], "LootChance": [ 50, 50, 50, 50, 50, 50, 50, 50 ];

Loot has 1 item, when LootChance has 8 items 1 not equal to 8, so correct way should be

"Loot": [ "SodaCan_Cola", ], "LootRandom": [ "SodaCan_Cola" ], "LootChance": [ 50 ];

griha41 avatar Sep 12 '23 17:09 griha41

Even if I edit the default SoldierLoadout.json file it doesn't load, if I just change the weapon, it continues to come with the default weapon, if I delete the SoldierLoadout.json file the system creates another file... I don't know what to do anymore ..

To the hell I made some changes based on my file Mission\eAI\eAI_Init.c:

`ref array patrol_loadouts = { "SoldadosBlack.json", // 1 "SoldadosBlack.json", // 2 "SoldadosBlack.json", // 3 "SoldadosBlack.json", // 4 "SoldadosBlack.json", // 5 "SoldadosBlack.json", // 6 "SoldadosBlack.json", // 7 "SoldadosBlack.json", // 8 "SoldadosBlack.json", // 9 "SoldadosBlack.json" // 10 };

// you may change these quantities const int NUMBER_PER_PATROL = 10; // Number of AI per patrol const int MAXR = 1200; // This is the main spawn radius- how close a player needs to be to spawn them in. const int MINR = 400; // If a player is this close to the patrol start point, it is too close for them to spawn const int DESPAWNR = 1400; // If all players are this far away, they despawn. const int RESPAWN_SECONDS = 900; // The amount of seconds before a new patrol will spawn, after they both die

autoptr array<autoptr eAIDynamicPatrol> patrols = {};

class CustomPatrol : eAIDynamicPatrol { override void OnPatrolSpawn(eAIGroup patrol) { // Uncomment this line to change the faction of the patrol from Raiders (default) // eAIFactionGuards for example is a faction which only kills players who have their weapons out // patrol.SetFaction(new eAIFactionGuards()); // Uncomment this line to slow down or speed up the patrol (1.0 to 3.0) // patrol.SetSpeedLimit(1.0); } override void OnUnitSpawn(eAIBase unit) { // Uncomment this to give the AI unlimited magazines (new one is added on reload) unit.SetUnlimitedMags(true); // You can also do anything you would do in the StartingEquipSetup() for players here // These lines will add attachments the same way you would for a player. However, the AI must have the M4A1 class in the Loadout.json file already for it to work. //Weapon_Base weapon = Weapon_Base.Cast(unit.GetItemInHands()); //weapon.GetInventory().CreateAttachment("M4_PlasticHndgrd"); //weapon.GetInventory().CreateAttachment("M4_OEBttstck"); //weapon.GetInventory().CreateAttachment("M4_CarryHandleOptic"); } }; void InitDynamicPatrols() { for (int i = 0; i < patrol_list.Count(); i++) { string loadout = "SoldadosBlack.json"; if (i < patrol_loadouts.Count()) { loadout = patrol_loadouts[i]; } else { loadout = "SoldadosBlack.json"; } autoptr CustomPatrol pat = new CustomPatrol(patrol_list[i][0], patrol_list[i], loadout, NUMBER_PER_PATROL, MINR, MAXR, DESPAWNR, RESPAWN_SECONDS); patrols.Insert(pat); pat.UpdateTriggers(); } } void SpawnSentry(vector pos, string loadout = "SoldadosBlack.json") { eAIGame game = MissionServer.Cast(GetGame().GetMission()).GetEAIGame(); eAIBase ai = game.SpawnAI_Sentry(pos, loadout); } modded class CustomMission { override void StartingEquipSetup(PlayerBase player, bool clothesChosen) { m_eaiGame.GetGroupByLeader(player); super.StartingEquipSetup(player, clothesChosen); } };`

Paste it after ending of the ref array<array> patrol_list = and I hope it will help you to fix your mission.

griha41 avatar Sep 12 '23 17:09 griha41

Friend, unfortunately it didn't work, I changed the amount of drop chance, and also the entire modified list that you envied, and now you can't access the server, it's online but you can't connect...

fiber1985 avatar Sep 12 '23 18:09 fiber1985

First point is the your JSON: "Loot": [ "SodaCan_Cola", ], "LootChance": [ 50, 50, 50, 50, 50, 50, 50, 50 ];

Loot has 1 item, when LootChance has 8 items 1 not equal to 8, so correct way should be

"Loot": [ "SodaCan_Cola", ], "LootRandom": [ "SodaCan_Cola" ], "LootChance": [ 50 ];

Dang it. May you chekout the logs you need to checkout the crash_ file and DayZServer_x64_*.rpt, there should be a reason why the server is kicked down.

Any way I'll try to attach the .txt file with full version of that script, maybe it will help you...

griha41 avatar Sep 12 '23 18:09 griha41

SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,297": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,311": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,325": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaidynamicpatrol.c,66": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (E): @"$CurrentDir:mpmissions/dayzOffline.chernarusplus/eAI/AI_init.c,46": Wrong number of template parameters SCRIPT (E): Can't compile mission init script'!

fiber1985 avatar Sep 12 '23 18:09 fiber1985

I didn't find this other file DayZServer_x64_*.rpt

fiber1985 avatar Sep 12 '23 18:09 fiber1985

SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,297": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,311": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,325": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaidynamicpatrol.c,66": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (E): @"$CurrentDir:mpmissions/dayzOffline.chernarusplus/eAI/AI_init.c,46": Wrong number of template parameters SCRIPT (E): Can't compile mission init script'!

I'd found that githab had had been fu**ed up my code. I'd rewritten it under your solutions and will sent you as text file attachment.

griha41 avatar Sep 12 '23 18:09 griha41

SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,297": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,311": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,325": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaidynamicpatrol.c,66": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (E): @"$CurrentDir:mpmissions/dayzOffline.chernarusplus/eAI/AI_init.c,46": Wrong number of template parameters SCRIPT (E): Can't compile mission init script'!

I'd found that githab had had been fu**ed up my code. I'd rewritten it under your solutions and will sent you as text file attachment.

ok, thanks

fiber1985 avatar Sep 12 '23 18:09 fiber1985

Where do I see attachments?

fiber1985 avatar Sep 12 '23 18:09 fiber1985

SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,297": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,311": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaigame.c,325": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (W): @"eAI/Scripts/5_Mission/eai\eaidynamicpatrol.c,66": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting SCRIPT (E): @"$CurrentDir:mpmissions/dayzOffline.chernarusplus/eAI/AI_init.c,46": Wrong number of template parameters SCRIPT (E): Can't compile mission init script'!

I'd found that githab had had been fu**ed up my code. I'd rewritten it under your solutions and will sent you as text file attachment.

ok, thanks

Done.

Please be careful, don't direct copy the json file from here or attachments. Was error in json code: Line 55, there's ',' in array with one single item.

Was: "Loot": [ "SodaCan_Cola", ],

Correct is:

"Loot": [ "SodaCan_Cola" ], eAI_Init.txt SoldadosBlack.txt

Wish you luck!

griha41 avatar Sep 12 '23 19:09 griha41

I did everything here, the server is online but I can't connect, I'm going to uninstall everything and redo it to see...

fiber1985 avatar Sep 12 '23 19:09 fiber1985

I did everything here, the server is online but I can't connect, I'm going to uninstall everything and redo it to see...

Let's try in other way.

1st close the DayZ Launcher 2nd - Open windows CMD

And one by one enter next commands: ipconfig /release ipconfig /flushdns ipconfig /renew

And star over the launcher

griha41 avatar Sep 12 '23 19:09 griha41

My server is on gportal, funny that yesterday it was working normally, and out of nowhere the bot mod stopped working, but any equipment I want to put on the bot doesn't work...

fiber1985 avatar Sep 12 '23 19:09 fiber1985

My server is on gportal, funny that yesterday it was working normally, and out of nowhere the bot mod stopped working, but any equipment I want to put on the bot doesn't work...

That's really odd. About that you could not connect:

1st check versions of server mods and client mods 2 ways to solve it: A) Clear cash of dns for windows (previous CMD commands) B) In launcher select Direct Connection and input IP amd Port - that's actually working!

griha41 avatar Sep 12 '23 19:09 griha41


Log D:\home\sid_1167897\dayz\config\crash_2023-09-12_15-38-20.log started at 12.09. 15:38:39


M22685, 12.09 2023 15:38:39 Can't compile mission init script'!

$CurrentDir:mpmissions\dayzOffline.chernarusplus\init.c(1): Can't find file '$CurrentDir:mpmissions/dayzOffline.chernarusplus/eAI/AI_init.c'

Runtime mode CLI params: config config\server.cfg cfg config\basic.cfg profiles config cpuCount 1 ip 194.140.197.85 port 28000 mod @zSpawnSelectionFixed;@VanillaPlusPlusMap;@Cabin_Mod_RaGed;@Cabin_Mod_CodeLock_RaGed;@CodeLock;@CodeLockCraft;@DayZ-Dog;@FlyingBirds!;@MMGBaseStorage;@MuchCarKey;@DurableToolsPlus;@Ear-Plugs;@BuildingFortifications;@AmmoStackBullet;@BuildEverywhere;@PristineRepair;@SchanaModParty;@ZensTireRack;@PVEZReloaded;@PVEZMarkersOnVPPMap;@VPPAdminTools;@CF;@Community-Online-Tools;@MMG-MightysMilitaryGear;@SNAFUWeapons;@BuilderItems;@DabsFramework;@AirRaid;@GAREA_Leaderboard;@LootBarrelTransfer;@RepairAttachments;@FuelConsumption;@VanillaCarsUp;@ZombieRunOverSound;@BlackoutsScorpion;@InediaStamina;@InediaInfectedAI;@eAI_Reloaded servermod @SurvivorMissions loadMissionToMemory enableHT

fiber1985 avatar Sep 12 '23 19:09 fiber1985


Log D:\home\sid_1167897\dayz\config\crash_2023-09-12_15-38-20.log started at 12.09. 15:38:39


M22685, 12.09 2023 15:38:39 Can't compile mission init script'!

$CurrentDir:mpmissions\dayzOffline.chernarusplus\init.c(1): Can't find file '$CurrentDir:mpmissions/dayzOffline.chernarusplus/eAI/AI_init.c'

Runtime mode CLI params: config config\server.cfg cfg config\basic.cfg profiles config cpuCount 1 ip 194.140.197.85 port 28000 mod @zSpawnSelectionFixed;@VanillaPlusPlusMap;@Cabin_Mod_RaGed;@Cabin_Mod_CodeLock_RaGed;@CodeLock;@CodeLockCraft;@DayZ-Dog;@FlyingBirds!;@MMGBaseStorage;@MuchCarKey;@DurableToolsPlus;@Ear-Plugs;@BuildingFortifications;@AmmoStackBullet;@BuildEverywhere;@PristineRepair;@SchanaModParty;@ZensTireRack;@PVEZReloaded;@PVEZMarkersOnVPPMap;@VPPAdminTools;@CF;@Community-Online-Tools;@MMG-MightysMilitaryGear;@SNAFUWeapons;@BuilderItems;@DabsFramework;@AirRaid;@GAREA_Leaderboard;@LootBarrelTransfer;@RepairAttachments;@FuelConsumption;@VanillaCarsUp;@ZombieRunOverSound;@BlackoutsScorpion;@InediaStamina;@InediaInfectedAI;@eAI_Reloaded servermod @SurvivorMissions loadMissionToMemory enableHT

Dang... Are you just copied the .txt not even renamed from .txt into .c am I right?

griha41 avatar Sep 12 '23 19:09 griha41

Sorry, I copied it wrong, my head is already spinning here

fiber1985 avatar Sep 12 '23 19:09 fiber1985

Ok, I managed to enter the game and the bots spawned in the default settings, 2 default bots appeared, now I'm going to copy the files and edit, let's see..

fiber1985 avatar Sep 12 '23 19:09 fiber1985

Sorry, I copied it wrong, my head is already spinning here

How dang I understand you man :)

griha41 avatar Sep 12 '23 19:09 griha41

Ok, I managed to enter the game and the bots spawned in the default settings, 2 default bots appeared, now I'm going to copy the files and edit, let's see..

Wait if i understood you right then your new settings already shall working. But instead of 2 units shall be 4 if i didn't miss anything...

griha41 avatar Sep 12 '23 20:09 griha41

Yes, if I install the mod, and I enter the server and go to the air base, the default bots, which are 2, appear normal, but if I apply your configuration the server comes online but I can't enter the server... it's as if there was something wrong with the configuration

fiber1985 avatar Sep 12 '23 20:09 fiber1985

So, I can enter the server, but the bots I configured do not work, only the default one, which is SoldierLoadout.json or HumanLoadout.json

// Patrol 1 = Balota strip ref array patrol_1 = {"5237.821777 9.568775 2157.804199", "4887.835449 9.560701 2578.265625", "4917.622559 9.539299 2599.980469"};

// Patrol 2 = SW Rail Line ref array patrol_2 = {"41.383652 6.637133 1568.725464", "167.029785 6.660925 1589.156372", "399.000854 6.637136 1605.268677", "450.407135 6.660660 1618.758667", "482.006226 6.711864 1632.124023", "799.668762 6.740325 1846.262695", "847.898071 5.795653 1886.695801", "923.040100 5.795653 1959.974121", "976.875427 5.795653 2031.899414", "1050.173218 6.664209 2158.251709", "1157.952637 5.795209 2307.297119", "1187.608032 6.407721 2340.853271", "1259.927368 6.011772 2363.105225", "1333.362915 6.637136 2342.896973", "1469.527222 6.721370 2247.018555", "1514.207764 5.795653 2222.483398", "1572.351074 6.581270 2193.880371", "1639.594482 6.438149 2169.135010", "1696.991211 5.795653 2156.455811", "1763.947998 6.373237 2143.247314", "1889.594116 6.014451 2166.340820", "2079.179688 6.529642 2219.987549", "2176.673584 6.011375 2196.734375", "2244.440430 5.995491 2087.459229", "2348.422119 5.795653 2048.190186", "2641.000000 6.692032 1985.662354", "2772.157471 6.697611 1985.912354", "3044.920166 5.795653 2044.465820", "2772.157471 6.697611 1985.912354", "2641.000000 6.692032 1985.662354", "2348.422119 5.795653 2048.190186", "2244.440430 5.995491 2087.459229", "2176.673584 6.011375 2196.734375", "2079.179688 6.529642 2219.987549", "1889.594116 6.014451 2166.340820", "1763.947998 6.373237 2143.247314", "1696.991211 5.795653 2156.455811", "1639.594482 6.438149 2169.135010", "1572.351074 6.581270 2193.880371", "1514.207764 5.795653 2222.483398", "1469.527222 6.721370 2247.018555", "1333.362915 6.637136 2342.896973", "1259.927368 6.011772 2363.105225", "1187.608032 6.407721 2340.853271", "1157.952637 5.795209 2307.297119", "1050.173218 6.664209 2158.251709", "976.875427 5.795653 2031.899414", "923.040100 5.795653 1959.974121", "847.898071 5.795653 1886.695801", "799.668762 6.740325 1846.262695", "482.006226 6.711864 1632.124023", "450.407135 6.660660 1618.758667"};

// Patrol 3 = Cherno Port ref array patrol_3 = {"7332.387695 5.712450 2651.121338", "7632.803223 5.507639 3075.661865", "7621.013184 5.892049 3083.053223", "7321.484375 5.448769 2658.244141"};

// Patrol 4 = Elektro Yard ref array patrol_4 = {"10825.153320 5.894602 2555.271240", "10853.957031 6.433348 2635.236816", "10889.441406 5.977321 2749.464111", "10852.090820 6.012342 2760.362793", "10828.861328 6.012496 2730.357910", "10794.523438 6.012444 2636.897705", "10779.160156 6.012487 2593.712158", "10781.082031 6.004701 2574.147949"};

// Patrol 5 = Solnechny south ref array patrol_5 = {"13392.708984 5.809348 5952.577637", "13369.891602 6.012489 5624.214844", "13373.618164 5.943049 5486.794434", "13369.891602 6.012489 5624.214844"};

// Patrol 6 = Rify Trail ref array patrol_6 = {"13342.375977 27.020344 11228.225586", "13469.069336 11.282786 11163.261719", "13567.762695 6.128973 11127.067383", "13620.910156 8.011324 11244.537109", "13567.762695 6.128973 11127.067383", "13469.069336 11.282786 11163.261719"};

// Patrol 7 = Nizhneye ref array patrol_7 = {"12879.688477 5.743166 8590.398438", "12983.769531 6.060859 8323.492188", "13000.213867 6.062475 8330.422852", "12967.809570 5.781274 8447.635742"};

// Patrol 8 = NWAF North ref array patrol_8 = {"4078.499268 339.012421 10802.854492", "4277.165039 339.012360 10922.452148", "4271.527832 339.008148 10938.139648", "4064.494385 339.012421 10818.675781"};

// Patrol 9 = NWAF south ref array patrol_9 = {"4772.428711 338.964355 9583.963867", "4639.255859 339.012390 9815.970703", "4978.569336 339.012451 10004.463867", "4639.255859 339.012390 9815.970703"};

// Patrol 10 = Tisy ref array patrol_10 = {"1724.632080 451.730408 14298.412109", "1681.035522 451.784302 14278.791016", "1668.385742 451.730408 14268.739258", "1653.012695 451.784302 14245.443359", "1662.009521 451.784302 14220.044922", "1668.885010 451.730408 14177.100586", "1678.905029 451.784302 14134.460938", "1687.656250 451.784302 14097.293945", "1691.055054 451.728760 14072.710938", "1697.563721 450.094635 14019.088867", "1701.266235 448.636108 13981.079102", "1709.151733 448.368225 13969.950195", "1726.191772 447.882568 13954.740234", "1734.303101 447.342072 13945.562500", "1736.849487 447.158569 13939.061523", "1803.257568 436.318970 13812.399414", "1802.478149 435.682281 13794.238281", "1764.742676 434.271759 13667.715820", "1753.983521 434.111572 13660.847656", "1697.765381 433.031982 13621.431641", "1625.751953 437.192169 13583.775391", "1615.443726 437.193420 13582.367188", "1586.155762 439.010864 13609.286133", "1566.816040 441.081787 13643.261719", "1554.550049 441.587372 13645.919922", "1533.254028 440.683624 13646.856445", "1470.583130 444.685120 13679.353516", "1448.422729 446.229736 13681.502930", "1397.534424 448.255707 13663.409180", "1377.747681 448.799530 13661.333984", "1356.402222 451.658264 13669.961914", "1339.632813 454.855988 13690.362305", "1311.232178 457.548615 13730.733398", "1368.332275 455.560181 13762.721680", "1389.098022 453.795563 13785.572266", "1394.411499 451.237183 13801.572266", "1398.934204 451.644989 13828.162109", "1419.962524 456.061951 13891.482422", "1409.579224 458.430359 13947.408203", "1421.006104 459.254517 13993.981445", "1422.121094 459.807831 14022.114258", "1388.509277 462.222443 14044.217773", "1388.548340 462.354797 14044.183594", "1333.772217 463.948151 14062.096680", "1350.346069 465.658081 14107.701172", "1461.509521 459.874268 14133.793945", "1503.123291 455.995056 14137.425781", "1554.196045 452.867004 14107.243164", "1574.911743 452.540283 14100.198242", "1629.664673 451.792175 14197.793945", "1636.238647 451.792175 14221.260742", "1671.278564 451.792175 14275.020508", "1645.910522 451.807617 14315.247070", "1669.397339 451.792175 14331.668945", "1685.370361 451.792175 14341.243164"};

// If you add another patrol array, add it to this list ref array<array> patrol_list = {patrol_1, patrol_2, patrol_3, patrol_4, patrol_5, patrol_6, patrol_7, patrol_8, patrol_9, patrol_10};

// IMPORTANT: If you add an entry to the above list, pick the loadout for it by adding the loadout filename to this list ref array patrol_loadouts = {"HumanLoadout.json", "HumanLoadout.json", "HumanLoadout.json", "HumanLoadout.json", "HumanLoadout.json", "HumanLoadout.json", "HumanLoadout.json", "HumanLoadout.json", "HumanLoadout.json", "HumanLoadout.json"};

// you may change these quantities const int NUMBER_PER_PATROL = 2; // Number of AI per patrol const int MAXR = 800; // This is the main spawn radius- how close a player needs to be to spawn them in. const int MINR = 250; // If a player is this close to the patrol start point, it is too close for them to spawn const int DESPAWNR = 1000; // If all players are this far away, they despawn. const int RESPAWN_SECONDS = 300; // The amount of seconds before a new patrol will spawn, after they both die

class CustomPatrol : eAIDynamicPatrol { override void OnPatrolSpawn(eAIGroup patrol) { // Uncomment this line to change the faction of the patrol from Raiders (default) // eAIFactionGuards for example is a faction which only kills players who have their weapons out // patrol.SetFaction(new eAIFactionGuards());

	// Uncomment this line to slow down or speed up the patrol (1.0 to 3.0)
	// patrol.SetSpeedLimit(1.0);
}
override void OnUnitSpawn(eAIBase unit) {
	// Uncomment this to give the AI unlimited magazines (new one is added on reload)
	// unit.SetUnlimitedMags(true);
	
	// You can also do anything you would do in the StartingEquipSetup() for players here
	
	// These lines will add attachments the same way you would for a player. However, the AI must have the M4A1 class in the Loadout.json file already for it to work.
	//Weapon_Base weapon = Weapon_Base.Cast(unit.GetItemInHands());
	//weapon.GetInventory().CreateAttachment("M4_PlasticHndgrd");
	//weapon.GetInventory().CreateAttachment("M4_OEBttstck");
	//weapon.GetInventory().CreateAttachment("M4_CarryHandleOptic");
}

};

autoptr array<autoptr eAIDynamicPatrol> patrols = {};

void InitDynamicPatrols() { for (int i = 0; i < patrol_list.Count(); i++) { string loadout = "SoldierLoadout.json"; // default if (i < patrol_loadouts.Count()) loadout = patrol_loadouts[i]; autoptr CustomPatrol pat = new CustomPatrol(patrol_list[i][0], patrol_list[i], loadout, NUMBER_PER_PATROL, MINR, MAXR, DESPAWNR, RESPAWN_SECONDS); patrols.Insert(pat); pat.UpdateTriggers(); } }

void SpawnSentry(vector pos, string loadout = "SoldierLoadout.json") { eAIGame game = MissionServer.Cast(GetGame().GetMission()).GetEAIGame(); eAIBase ai = game.SpawnAI_Sentry(pos, loadout); }

modded class CustomMission { void StartingEquipSetup(PlayerBase player, bool clothesChosen) { m_eaiGame.GetGroupByLeader(player); super.StartingEquipSetup(player, clothesChosen); } };

fiber1985 avatar Sep 12 '23 20:09 fiber1985

Look what I did, I took all the information in the SoldadosBlack.json file, opened the HumanLoadout.json file, deleted everything inside and replaced it... and it worked... but I wanted the name of my file to work to put it different patrols across the map.. but if I use the term SoldadosBlack.json it doesn't work

fiber1985 avatar Sep 12 '23 20:09 fiber1985

Look what I did, I took all the information in the SoldadosBlack.json file, opened the HumanLoadout.json file, deleted everything inside and replaced it... and it worked... but I wanted the name of my file to work to put it different patrols across the map.. but if I use the term SoldadosBlack.json it doesn't work

Loadouts are described in eAI-Init.c, you shall there replace the names and please use only English letters in names. One before i got the same error with Russian names of files.

That could be a possible issue why it's not working...

griha41 avatar Sep 12 '23 20:09 griha41