BadHabitz 235 Posted March 19, 2019 I'm trying to make a tripwire mine that has the sound/smoke/noise effect that the LoW training mine has. I've gotten 99% of it to work, but that last thing I need help with. In the mission editor I can see my new explosive, and it's in the explosive category. It also fires properly and has the desired effects. That's the good. What's not working is that I can't defuse the mine. In the arsenal it shows up in magazines and not explosives. I believe these two symptoms are related. If I can just figure out how to get this to show up in the explosives tab of the arsenal I think it will fix my lack of ability to defuse. I'm inheriting from stuff that already works, and I don't think I've changed anything that would cause my problem. So I'm here to see if anyone can find what I've missed. Thanks. class CfgPatches { class BHZ_TrainingTripMine { units[]= {}; weapons[]={}; requiredVersion=1; requiredAddons[]={}; }; }; class CfgAmmo { class APERSTripMine_Wire_Ammo; class BHZ_TrainingTripMine_Ammo: APERSTripMine_Wire_Ammo { _generalMacro = "BHZ_TrainingTripMine_Ammo"; model = "\A3\Weapons_F\explosives\mine_AP_tripwire"; defaultMagazine = "BHZ_TrainingTripMine_Mag"; hit = 1; indirectHit = 0; indirectHitRange = 0; suppressionRadiusHit = 0; mineInconspicuousness = 30; mineCanBeReactivated = 0; mineModelDisabled = "\A3\Weapons_F\explosives\mine_AP_tripwire_d"; minDamageForCamShakeHit = 1.55; explosionEffects = "BHZ_TrainingTripMine_Effect"; effectsSmoke = "SmokeShellOrange"; CraterEffects = "IEDMineSmallLandCrater"; picture = "\A3\Weapons_F\Data\UI\gear_mine_AP_tripwire_CA.paa"; class CamShakeExplode { power = 0; duration = 0.2; frequency = 20; distance = 0; }; class CamShakeHit { power = 0; duration = 0.2; frequency = 20; distance = 1; }; soundTrigger[] = {""}; soundActivation[] = {"A3\Sounds_F_Orange\arsenal\explosives\TrainingMine\TrainingMine_Placement_01",1.9952624,1,20}; soundDeactivation[] = {"A3\Sounds_F_Orange\arsenal\explosives\TrainingMine\TrainingMine_Deactivate_01",1.9952624,1,20}; SoundSetExplosion[] = {"TrainingMine_Exp_SoundSet","TrainingMine_Report_SoundSet"}; }; class BHZ_TrainingTripMine_Ammo_Scripted: APERSTripMine_Wire_Ammo { triggerWhenDestroyed = 1; }; }; class CfgMagazines { class APERSTripMine_Wire_Mag; class BHZ_TrainingTripMine_Mag: APERSTripMine_Wire_Mag { _generalMacro = "BHZ_TrainingTripMine_Mag"; count = 1; scope = 2; mass = 15; ammo = "BHZ_TrainingTripMine_Ammo"; picture = "\A3\Weapons_F\Data\UI\gear_mine_AP_tripwire_CA.paa"; model = "\A3\Weapons_F\explosives\mine_AP_tripwire_i"; displayName = "Training Trip Mine"; }; }; class CfgVehicles { class APERSTripMine; class BHZ_TrainingTripMine: APERSTripMine { _generalMacro = "BHZ_TrainingTripMine"; scope = 2; ammo = "BHZ_TrainingTripMine_Ammo"; displayName = "Training Tripwire Mine"; picture = "\A3\Weapons_F\Data\UI\gear_mine_AP_tripwire_CA.paa"; vehicleClass = "Mines"; editorPreview = "\A3\EditorPreviews_F\Data\CfgVehicles\APERSTripMine.jpg"; }; }; class BHZ_TrainingTripMine_Effect { class LightTTM { intensity = 1; interval = 1; lifeTime = 14; position[] = {-1.65,0.15,0.1}; simulation = "light"; type = "TrainingMine_light"; }; class Smoke { intensity = 0.1; interval = 1; lifeTime = 14; position[] = {-1.65,0.15,0.1}; simulation = "particles"; type = "TrainingMine_smoke"; }; class Sparks { intensity = 1; interval = 1; lifeTime = 14; position[] = {-1.65,0.15,0.1}; simulation = "particles"; type = "TrainingMine_FireSparks"; }; }; Share this post Link to post Share on other sites
Dedmen 2705 Posted March 19, 2019 4 hours ago, BadHabitz said: requiredAddons[]={}; That's invalid. You are trying to inherit vanilla items, but you are also saying you don't require anything from vanilla. You are contradicting yourself. Add "A3_Data_F_Tank_Loadorder" to your requiredAddons. 4 hours ago, BadHabitz said: units[]= {}; That's invalid too. You are adding a new unit/vehicle here: 4 hours ago, BadHabitz said: class BHZ_TrainingTripMine: APERSTripMine But your CfgPatches is telling the Engine that you aren't adding anything. Again contradicting yourself. Share this post Link to post Share on other sites
BadHabitz 235 Posted March 19, 2019 11 minutes ago, Dedmen said: That's invalid. You are trying to inherit vanilla items, but you are also saying you don't require anything from vanilla. You are contradicting yourself. Add "A3_Data_F_Tank_Loadorder" to your requiredAddons. That's invalid too. You are adding a new unit/vehicle here: But your CfgPatches is telling the Engine that you aren't adding anything. Again contradicting yourself. Thanks. I was under the impression that I only needed requiredAddons if I was overwriting pre-existing classes. Since all of my code is inheriting and not overwriting I didn't think I needed it. But looking into it I see it's also for load order, so I can see how that would help. I added "A3_Data_F_Tank_Loadorder", which didn't work. I also added "A3_Weapons_F_Explosives" since it's inheriting from that CfgPatches and I added "A3_Weapons_F" for good measure. Then I tried adding my CfgVehicles entry "BHZ_TrainingTripMine" into units[]={}; When that didn't work I also added the magazine and ammo entry as well. I don't think I needed those, wasn't sure if I should try to put them in weapons or not. Either way I feel like I was just throwing everything at the problem and nothing has worked yet. Share this post Link to post Share on other sites
Dedmen 2705 Posted March 19, 2019 3 minutes ago, BadHabitz said: When that didn't work I also added the magazine and ammo entry as well. Units are vehicles. Magazines and Ammo aren't vehicles. Putting them in the units array causes nothing but errors. 3 minutes ago, BadHabitz said: I also added "A3_Weapons_F_Explosives" since it's inheriting from that CfgPatches and I added "A3_Weapons_F" for good measure. The tank loadorder already contains all vanilla pbo's and all DLC's. Let's just look at a example of what another mod does when adding mines. https://github.com/acemod/ACE3/tree/master/addons/explosives https://github.com/acemod/ACE3/blob/master/addons/explosives/CfgWeapons.hpp#L7 You are missing that. You need to add a muzzle to the "Put" weapon. To be able to "Put" the mine down. Quite sure that's also required for it to show in Arsenal then. class CfgWeapons { class Default; class Put: Default { muzzles[] += {"BHE_TrainingTripMine"}; class PutMuzzle: Default{}; class BHE_TrainingTripMine: PutMuzzle { magazines[] = {"BHZ_TrainingTripMine_Mag"}; }; }; }; Share this post Link to post Share on other sites
BadHabitz 235 Posted March 20, 2019 Thanks. This last bit pretty much did the trick. Coupled with configuring my mod for ACE and your advice here I got it to work, so thanks for that. And thanks for the bit of knowledge as well. Semi-related questions, if you have a minute, looking at the community page for CfgPatches it says that CfgVehicle entries go in 'units' and CfgWeapons go in 'weapons', would I also include classes that are scope=0 or scope=1? And I've also seen mods having a line for ammo and magazines in CfgPatches in the past, but that's not in the documentation, so is that just not documented or is it people that didn't know any better? Thanks again. 13 hours ago, Dedmen said: Units are vehicles. Magazines and Ammo aren't vehicles. Putting them in the units array causes nothing but errors. The tank loadorder already contains all vanilla pbo's and all DLC's. Let's just look at a example of what another mod does when adding mines. https://github.com/acemod/ACE3/tree/master/addons/explosives https://github.com/acemod/ACE3/blob/master/addons/explosives/CfgWeapons.hpp#L7 You are missing that. You need to add a muzzle to the "Put" weapon. To be able to "Put" the mine down. Quite sure that's also required for it to show in Arsenal then. class CfgWeapons { class Default; class Put: Default { muzzles[] += {"BHE_TrainingTripMine"}; class PutMuzzle: Default{}; class BHE_TrainingTripMine: PutMuzzle { magazines[] = {"BHZ_TrainingTripMine_Mag"}; }; }; }; Share this post Link to post Share on other sites
Dedmen 2705 Posted March 20, 2019 13 hours ago, BadHabitz said: would I also include classes that are scope=0 or scope=1? No. Only things that you actually want to show to the public. 13 hours ago, BadHabitz said: so is that just not documented or is it people that didn't know any better It doesn't exist, the engine doesn't read the entry and doesn't care if it exists or what it contains. So.. The second part. 1 Share this post Link to post Share on other sites