Open gikens opened 2 years ago
Доброго времени суток. Решается всё следующим способом:
ref array<string> patrol_loadouts =
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- English version:
Good daytime. Your situation might be fixed that way:
ref array<string> patrol_loadouts =
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...
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. }
I've been trying to fix this for 2 days now... if you could help me...
// Patrol 1 = Balota strip
ref array
// Patrol 2 = SW Rail Line
ref array
// Patrol 3 = Cherno Port
ref array
// Patrol 4 = Elektro Yard
ref array
// Patrol 5 = Solnechny south
ref array
// Patrol 6 = Rify Trail
ref array
// Patrol 7 = Nizhneye
ref array
// Patrol 8 = NWAF North
ref array
// Patrol 9 = NWAF south
ref array
// Patrol 10 = Tisy
ref array
// If you add another patrol array, add it to this list
ref array<array
// 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
// 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
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); } };
{ "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 }
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 ..
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 ];
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
// 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
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.
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...
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 DayZServerx64*.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...
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 didn't find this other file DayZServerx64*.rpt
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.
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
Where do I see attachments?
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!
I did everything here, the server is online but I can't connect, I'm going to uninstall everything and redo it to see...
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
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...
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!
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
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?
Sorry, I copied it wrong, my head is already spinning here
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..
Sorry, I copied it wrong, my head is already spinning here
How dang I understand you man :)
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...
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
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 2 = SW Rail Line
ref array
// Patrol 3 = Cherno Port
ref array
// Patrol 4 = Elektro Yard
ref array
// Patrol 5 = Solnechny south
ref array
// Patrol 6 = Rify Trail
ref array
// Patrol 7 = Nizhneye
ref array
// Patrol 8 = NWAF North
ref array
// Patrol 9 = NWAF south
ref array
// Patrol 10 = Tisy
ref array
// If you add another patrol array, add it to this list
ref array<array
// 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
// 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
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); } };
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
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...
Now it's working with my loadout, and I only made the name changes, you'll understand... look how it turned out...
// Patrol 1 = Balota strip
ref array
// Patrol 2 = SW Rail Line
ref array
// Patrol 3 = Cherno Port
ref array
// Patrol 4 = Elektro Yard
ref array
// Patrol 5 = Solnechny south
ref array
// Patrol 6 = Rify Trail
ref array
// Patrol 7 = Nizhneye
ref array
// Patrol 8 = NWAF North
ref array
// Patrol 9 = NWAF south
ref array
// Patrol 10 = Tisy
ref array
// If you add another patrol array, add it to this list
ref array<array
// 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
// 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
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); } };
Now it's working with my loadout, and I only made the name changes, you'll understand... look how it turned out...
Mate please don't insert document directly into github. Use attachment system. Rename SomeFile.c into SomeFile.txt and drop onto free space of text message editor. In few seconds will appear the link to the file. In result - you'll able to sent full code without any text correction. And your code will not loose type of brekers and etc special symbols.
Now it's working with my loadout, and I only made the name changes, you'll understand... look how it turned out...
Any way Congratulations with winning in this battle with DayZ.
Knowledges is the power!
Now it's working with my loadout, and I only made the name changes, you'll understand... look how it turned out...
Any way Congratulations with winning in this battle with DayZ.
Knowledges is the power!
Friend, thank you very much for helping me,
Now it's working with my loadout, and I only made the name changes, you'll understand... look how it turned out...
Any way Congratulations with winning in this battle with DayZ.
Knowledges is the power!
Friend, thank you very much for helping me,
Welcome. And I had done nothing.
For something, I gusset you to use Notepad++ for editing JSON & XML files (free and powerful). And before publishing the file updates - validate them with JSON/XML validation sites. That might help you to save your time and find possible mistakes before the server will start to crashing. :-)
Ok, you can leave it... now I'm going to try to put the attachments on the weapons, the clothes, I don't know if it's possible to put the attachments on but I'll see what I can do, Thanks!
Ok, you can leave it... now I'm going to try to put the attachments on the weapons, the clothes, I don't know if it's possible to put the attachments on but I'll see what I can do, Thanks!
You nedd to change some stuff through the eAI_Init.c If you i can attach here the example of equipment of AKM and M4 firearm with attachments.
In this case, I would put the weapons from the snafu mod..
In this case, I would put the weapons from the snafu mod..
Not really I not really wish to messed up with mods that I don't know. I give you an example with comments any already should do it by your hands. To make that live you need to change function OnUnitSpawn(). Here the example: OnUnitSpawn.txt
An example is how can a gun come with a larger magazine?
An example is how can a gun come with a larger magazine?
I never did it before, but you can get current Gun magazine (if it has a mag), get it's class name, search for that item in current unit in OnSpawn function and replace them with mags that you prefer to use.
Ah ok, I'll see if I can
Ah ok, I'll see if I can
Unpack the scrips.pbo (dta\scrips.pbo) it has all ingame classes, that may help you to get required methods and examples.
Class Magazine - in Magazine.c and Class Weapon_Base in Weapon_Base.c may give you some tricks with that.
I have no knowledge of .pbo, aren't they used to make and edit mods?
I have no knowledge of .pbo, aren't they used to make and edit mods?
1st find in network: PBO Manager v 1.4
2nd .pbo is addon file for Arma games: (Arma 2, Arma 2 OA, Arma 3, Take On Helicopters, Take On Mars, Arma Reforger) and DayZ.
Install it and use to view, unpack, pack pbo addons.
Ok, I'll do that but I'll take it easy because my head is already exploding configuring this mod hahaha
Ok, I'll do that but I'll take it easy because my head is already exploding configuring this mod hahaha
Welcome to the Arma world!
I'm using 2 types of weapons on my soldiers, one of them had the accessories for the other, even though the accessory didn't fit into it, did I have to do the same as what you told me? an attachment for each type of weapon?
weapon_Base weapon = Weapon_Base.Cast(unit.GetItemInHands());
weapon.GetInventory().CreateAttachment("SNAFU_AKTango6T_Black");
weapon.GetInventory().CreateAttachment("SNAFU_NPKPBIPOD");
weapon.GetInventory().CreateAttachment("SNAFU_MTango6T_Black");
I'm using 2 types of weapons on my soldiers, one of them had the accessories for the other, even though the accessory didn't fit into it, did I have to do the same as what you told me? an attachment for each type of weapon?
weapon_Base weapon = Weapon_Base.Cast(unit.GetItemInHands());
weapon.GetInventory().CreateAttachment("SNAFU_AKTango6T_Black"); weapon.GetInventory().CreateAttachment("SNAFU_NPKPBIPOD"); weapon.GetInventory().CreateAttachment("SNAFU_MTango6T_Black");
Man you don't get into it. You shall understand, that you have no idea about loadout of unit.
weapon_Base weapon = Weapon_Base.Cast(unit.GetItemInHands()); // is wrong way to make the script without errors.
You trying to get unchecked unit state - unit.GetItemInHands() did you checked that unit isn't NULL to get access to his hands? You didn't. it's a 1st place for error. You trying to operate with variable "weapon" but did you checked that Cast operation is done correctly and ain't equal NULL? You didn't. Any of those errors may crash your server!
2nd you may even use +∞ types of weapons but it shall be slotted correctly and eAI didn't get such awesome stuff.
eAI even not using a pistols why are you think that eAI shall using 2nd firearm? Answer - they will not use it.
I didn't get into slot system of eAI, i know that Player_Base has 2 slots for weapons left & right shoulder.
Need to find names of those slots and then you may take the firearm from that slot or slot there an firearm. I just don't know what are you really intented to do for that case.
Actually it might be a good idea, for example VSS + SVD (if primary weapon is VSS, then on second slot put SVD), If primary weapon is AKM, then Secondary weapon should be Mosin 91/30 or SKS and manually spawn ammo for them.
I'll think how shall i done it... Thank you for an intesting idea.
Привет уважаемый разработчик мода, возникла проблема, в файле 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?