Results 1 to 9 of 9

Thread: Is my cpp right?

  1. #1
    is this ok?

    // some basic defines
    #define TEast 0
    #define TWest 1
    #define TGuerrila 2
    #define TCivilian 3
    #define TSideUnknown 4
    #define TEnemy 5
    #define TFriendly 6
    #define TLogic 7

    #define true 1
    #define false 0

    #define DefaultManWeapons Throw,Put

    // type scope
    #define private 0
    #define protected 1
    #define public 2

    #define WeaponNoSlot 0// dummy
    weapons
    #define WeaponSlotPrimary 1// primary weapons
    #define WeaponSlotSecondary 16// secondary weapons
    #define WeaponSlotItem 256// items
    #define WeaponSlotBinocular 4096// binocular
    #define WeaponHardMounted 65536

    class CfgPatches
    {
    class plasmarifle
    {
    units[] = {SoldierWSaboteurPlasma};
    weapons[] = {plasmarifle};
    requiredVersion = 1.20;
    };
    };

    class CfgAmmo
    {

    class default {};

    class LAW : Default
    { };

    class plasmaammo : LAW
    {
    hit=1520;indirectHit=1520;indirectHitRange=10;
    };

    };

    class CfgVehicles
    {
    class Man:Land{};
    class Soldier:Man{};
    classSoldierWB:Soldier
    class SoldierWSaboteur: SoldierWB
    class SoldierWSaboteurPipe: SoldierWSaboteur

    classSoldierWSaboteurplasma: SoldierWSaboteurPipe

    STR_DN_ADD_PLASMA_SOLDIER_Soldier (plasma)
    }:

    class CfgWeapons
    {
    class default {};
    class LAWLauncher : Default {};

    class plasmarifle : LAWLauncher
    {

    ammo=plasma;

    displayName = $STR_DN_ADD_plasma;
    displayNameMagazine = $STR_DN_ADD_PLASMA_AMMO_plasma;
    shortNameMagazine = $STR_DN_ADD_PLASMA_AMMO_SHORT_plasma;
    count=2;
    magazineReloadTime=1
    reloadTime=0.5;
    initSpeed=500

    aiRateOfFire=5.0; // delay between shots at given
    distance
    aiRateOfFireDistance=1000; // at shorter distance delay
    goes lineary to zero
    };

    class plasma
    {
    weaponType = WeaponSlotPrimary;
    magazineType 6*WeaponSlotItem;
    displayName = $STR_DN_plasma
    model="\plasma\plasma.paa";
    }
    }:

    class CfgNonAIVehicles
    {
    class ProxyWeapon{};
    class Proxyplasma: ProxyWeapon {};
    };

  2. #2
    Owww...found alot of mistakes there...well here's waht you need:

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    // some basic defines
    //edited by SOul_Assassin
    #define TEast 0
    #define TWest 1
    #define TGuerrila 2
    #define TCivilian 3
    #define TSideUnknown 4
    #define TEnemy 5
    #define TFriendly 6
    #define TLogic 7

    #define true 1
    #define false 0

    #define DefaultManWeapons Throw,Put

    // type scope
    #define private 0
    #define protected 1
    #define public 2

    #define WeaponNoSlot 0// dummy
    weapons
    #define WeaponSlotPrimary 1// primary weapons
    #define WeaponSlotSecondary 16// secondary weapons
    #define WeaponSlotItem 256// items
    #define WeaponSlotBinocular 4096// binocular
    #define WeaponHardMounted 65536

    class CfgPatches
    {
    class plasmarifle
    {
    units&#91;&#93; = {SoldierWSaboteurPlasma};
    weapons&#91;&#93; = {plasmarifle};
    requiredVersion = 1.20;
    };
    };

    class CfgAmmo
    {
    class Default {};
    class AT3 &#58; Default {}; //This is important
    class LAW &#58; AT3 {}; //as you have to keep hierarchy structure
    class plasmaammo &#58; LAW
    {
    hit=1520;
    indirectHit=1520;
    indirectHitRange=10;
    };
    };


    class CfgWeapons
    {
    class Default {};
    class LAWLauncher &#58; Default {};
    class plasmarifle &#58; LAWLauncher
    {

    ammo = &#34;plasmaammo&#34;; // has to be the same as defined in the CfgAmmo

    displayName = &#34;Plasma Rifle&#34;; //dont bother with string tables yet
    displayNameMagazine = &#34;Plasma mag&#34;;
    shortNameMagazine = &#34;plasmamag&#34;;
    count=2;
    magazineReloadTime=1
    reloadTime=0.5;
    initSpeed=500

    aiRateOfFire=5.0; // delay between shots at given
    distance
    aiRateOfFireDistance=1000; // at shorter distance delay
    goes lineary to zero

    weaponType = WeaponSlotPrimary;
    magazineType=6*WeaponSlotItem;
    model=&#34;&#92;plasma&#92;plasma.p3d&#34;; // why did u have .paa here?? model means it has
    }; // to be a p3d file
    }&#58;

    class CfgVehicles
    {
    class All {}; // again keep the official hierarchy
    class AllVehicles &#58; All {};
    class Land &#58; AllVehicles {};
    class Man &#58; Land {};
    class Soldier &#58; Man {};
    class SoldierWB &#58; Soldier {}; //dont forget the {}; every time you define a sub-class
    class SoldierWSaboteur &#58; SoldierWB {};
    class SoldierWSaboteurPipe &#58; SoldierWSaboteur {};
    class SoldierWSaboteurPlasma&#58; SoldierWSaboteurPipe
    {
    displayName = &#34;Saboteur &#40;plasma&#41;&#34;;
    weapons&#91;&#93;={&#34;plasmarifle&#34;,&#34;Thro w&#34;,&#34;Binocular&#34;};
    magazines&#91;&#93;={&#34;plasmarifle&#34;};

    };
    };



    class CfgNonAIVehicles
    {

    class ProxyWeapon{};
    class Proxyplasma&#58; ProxyWeapon {};
    };
    [/QUOTE]<span id='postcolor'>

    Hope that helps

  3. #3
    Please read more on coding configs at InternalEditing site

    And download game config.cpp files in InternalEditng download section

  4. #4
    Private First Class
    Join Date
    Oct 18 2002
    Posts
    22
    Author of the Thread
    thx SA
    for the help and the webpage&#39;s

  5. #5
    Private First Class
    Join Date
    Oct 18 2002
    Posts
    22
    Author of the Thread
    i&#39;ve stuffed into a pbo and put in the addons folder in ofp but i cant find it ingame&#33;&#33; where would it be?

  6. #6
    havnt tried but should be under West>Man>Saboteur (plasma)

  7. #7
    Private First Class
    Join Date
    Oct 18 2002
    Posts
    22
    Author of the Thread
    it isn&#39;t there. i cpoied the cpp that you did and put it in the plasma folder but i still cant find it in game
    is there a mistake in the cpp??

  8. #8
    What did u name the pbo?

  9. #9
    Private First Class
    Join Date
    Oct 18 2002
    Posts
    22
    Author of the Thread
    plasma.pbo

Posting Permissions

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