Results 1 to 3 of 3

Thread: Adding a Weapon

  1. #1

    Adding a Weapon

    I'm taking the plunge from scripting/mission-making, and trying to do some basic add-on related stuff. I've read a bunch of tutorials, etc. but I can't make my 'sample' work... I wonder if anyone can give me a hand. I'm simply PBO'ing this config.cpp, and dropping it in a modfolder's addons folder, and loading that mod.

    The properties are rather 'random' at the moment, so I don't expect the weapon to actually do anything useful - I just would like it to appear in a unit's loadout.

    I've fixed all of the errors I was getting in the RPT file, and now when I do
    Code:
    this addWeapon "TestWeapon";
    no errors occur (either on-screen or in the loadout), etc. but the weapon doesn't show in the unit's loadout.

    Would someone mind taking a look and let me know what I'm doing wrong? Additionally, can anyone point me in the direction of a good tutorial... I'd rather have something that explains the format a bit better than the Biki (which is very vague in this area), or a bunch of non-specific/too-specific forum threads.

    Thanks in advance:

    Code:
    class CfgPatches
    {
    	class TestWeapon
    	{
    		units[] = {};
    		weapons[] = {"TestWeapon"};
    		requiredVersion = 0.1;
    		requiredAddons[] = {"CAData","CA_Anims_Char"};
    	};
    };
    class cfgRecoils
    {
    	ATest_Recoil[] = {0,0,0};
    };
    class cfgAmmo
    {
    	class Default;
    	class ATestAmmo: Default
    	{
    		hit = 500;
    		indirectHit = 150;
    		indirectHitRange = 2.5;
    		model = "\ca\weapons\empty";
    		simulation = "laserDesignate";
    		simulationStep = 0.1;
    		cost = 5000;
    		timeToLive = 0;
    		soundHit[] = {"Ca\sounds\Weapons\explosions\explosion_mega_09",19.9526,1,1500};
    		soundFly[] = {"Ca\sounds\Weapons\explosions\rocket_fly1",0.0001,4};
    		maxSpeed = 350;
    		irLock = 0;
    		manualControl = 1;
    		maxControlRange = 0;
    		aiRateOfFire = 0;
    		aiRateOfFireDistance = 500;
    		initTime = 0;
    	  maneuvrability = 0;
    	 };
    };
    class cfgMagazines
    {
    	class CA_Magazine;
    	class ATestMagazine: CA_Magazine
    	{
    		scope = 2;
    		displayName = "Testing!";
    		picture = "\CA\weapons\data\equip\m_battery_CA.paa";
    		ammo = "ATestAmmo";
    		count = 1;
    		initSpeed = 30;
    		nameSound = "laserdesignator";
    		descriptionShort = "Testing!";
    	};
    };
    class cfgWeapons
    {
    	class LauncherCore;
    	class TestWeapon: LauncherCore
    	{
    		cursor = "Missile";
    		cursorAim = "\ca\Weapons\Data\clear_empty";
    		cursorSize = 0;
    		descriptionShort = "A test.";
    		displayName = "Test!";
    		fireLightDuration = 0;
    		fireLightIntensity = 0;
    		forceOptics = 0;
    		Laser = 1;
    		magazines[] = {"ATestMagazine"};
    		model = "\ca\weapons\soflam";
    		modelOptics = "\ca\weapons\optika_SOFLAM";
    		muzzles[] = {};
    		nameSound = "laserdesignator";
    		opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"};
    		picture = "\CA\weapons\data\equip\m_satchel_CA.paa";
    		primary = 0;
    		recoil = "ATest_Recoil";
    		scope = 1;
    		selectionFireAnim = "zasleh";
    		showSwitchAction = 1;
    		simulation = "weapon";
    		type = 0;
    		value = 10;
    		class Library
    		{
    			libTextDesc = "A test!";
    		};
    	};
    };
    Last edited by JamesF1; Jun 30 2009 at 20:01.
    Want a casual but realistic Arma experience? Join HMM Squad!
    OFPEC - The Editing Center
    JamesBurgess.co.uk

  2. #2

  3. #3
    Corporal Worldeater's Avatar
    Join Date
    Jan 23 2009
    Location
    some weird prison planet full of apes
    Posts
    88
    Don't we all love crossposting?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •