Jump to content
Sign in to follow this  
Silverguy82

Config Changes Name Of Gun

Recommended Posts

Hi everyone...me and a friend are working on a gun for OFP. We released 1 version of the gun already (M40A3 sniper rifle). But we are releasing a new version with the M40A1 as well as the M40A3.

The problem is....when my other guy tried to create a new config for the different guns, it lists the M40A3 as "M40A3" in the config for the weapon class name. But when we go ingame the game changes the weapon class name back to M40A1

We believe it might be because he copied the old config from the previous release and made alterations from that for the new version.

configProb.jpg

here is what the config looks like right now.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// 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

// type scope

#define private 0

#define protected 1

#define public 2

class CfgPatches

{

   class ck_M40_sniper

   {

         units[] = {ck_M40a1sniper_grass, ck_M40a1sniper_grass_full, ck_M40a1sniper_desert, ck_M40a1sniper_desert_full, ck_M40a3sniper_grass, ck_M40a3sniper_grass_full, ck_M40a3sniper_desert, ck_M40a3sniper_desert_full, ck_m40a3sniper_standard};

         weapons[] = {ck_M40a1_grass, ck_M40a1_grass_full, ck_M40a1_desert, ck_M40a1_desert_full, ck_M40a3_grass, ck_M40a3_grass_full, ck_M40a3_desert, ck_M40a3_desert_full, ck_m40a3_standard};

         requiredVersion = 1.01;

   };

};

class CfgRecoils

{

ck_M40Recoil[]={0.02,0.05,0.01,0.05,0.02,0.02,0.075,0.01,0.015,0.2,0,0};

};

class CfgModels

{

class Default{};

class Weapon: Default{};

class ck_M40A1_grass : Weapon{};

class ck_M40A1_grass_full : ck_M40A1_grass{};

class ck_M40A1_desert : ck_M40A1_grass{};

class ck_M40A1_desert_full : ck_M40A1_grass{};

class ck_M40A3_grass : ck_M40A1_grass{};

class ck_M40A3_grass_full : ck_M40A1_grass{};

class ck_M40A3_desert : ck_M40A1_grass{};

class ck_M40A3_desert_full : ck_M40A1_grass{};

class ck_M40A3_standard : ck_M40A1_grass{};

};

class CfgAmmo

{

class default {};

class BulletSingle: default {};

class BulletSniper: BulletSingle {};

class ck_M40mag: BulletSniper

{

hit=12;

indirectHit=2;

indirectHitRange=0.1;

minRange=1;

minRangeProbab=0.04;

midRange=200;

midRangeProbab=0.15;

maxRange=900;

maxRangeProbab=0.02;

};

};

class CfgWeapons

{

class default{};

class MGun: default {};

class Riffle: MGun {};

class sniperriffle: Riffle{};

class m21:sniperriffle{};

class ck_m40a1_grass: m21

{

model="\ck_m40\ck_m40a1_grass";

displayName="M40A1 (grass)";

displayNameMagazine="7.62x51mm rounds";

magazines[]={"ck_M40mag"};

ammo=ck_M40mag;

modelOptics="\ck_m40\ck_optics_oval.p3d";

opticsZoomMin=0.023;

opticsZoomMax=0.023;

picture="\ck_m40\m40a1_side_icon.paa";

count=5;

reloadTime=3;

recoil = ck_M40Recoil;

reloadMagazineSound[]={"\ck_m40\reload.wav",0.05,1};

sound[]={"\ck_m40\shot.wav",db0,1};

drySound[]={"\ck_m40\dry.wav",db0,1};

reloadSound[] = {"\ck_m40\reload_M40A3.wav",db0,1};

distanceZoomMin=750;

distanceZoomMax=750;

};

class ck_M40a1_grass_full: ck_M40a1_grass

{

    model="\ck_m40\ck_m40a1_grass_full.p3d";

displayName="M40A1 (grass cammo)";

};

class ck_M40a1_desert: ck_M40a1_grass

{

    model="\ck_m40\ck_m40a1_desert.p3d";

displayName="M40A1 (desert)";

};

class ck_M40a1_desert_full: ck_M40a1_grass

{

    model="\ck_m40\ck_m40a1_desert_full.p3d";

displayName="M40A1 (desert cammo)";

};

class ck_M40a3_grass: ck_M40a1_grass

{

    picture="\ck_m40\m40a3_side_icon.paa";

model="\ck_m40\ck_m40a3_grass.p3d";

displayName="M40A3 (grass)";

};

class ck_M40a3_grass_full: ck_M40a1_grass

{

    picture="\ck_m40\m40a3_side_icon.paa";

model="\ck_m40\ck_m40a3_grass_full.p3d";

displayName="M40A3 (grass cammo)";

};

class ck_M40a3_desert: ck_M40a1_grass

{

    picture="\ck_m40\m40a3_side_icon.paa";

model="\ck_m40\ck_m40a3_desert.p3d";

displayName="M40A3 (desert)";

};

class ck_M40a3_desert_full: ck_M40a1_grass

{

    picture="\ck_m40\m40a3_side_icon.paa";

model="\ck_m40\ck_m40a3_desert_full.p3d";

displayName="M40A3 (desert cammo)";

};

class ck_M40a3_standard: ck_M40a1_grass

{

    picture="\ck_m40\m40a3_side_icon.paa";

model="\ck_m40\ck_m40a3_standard.p3d";

displayName="M40A3 (standard)";

};

class ck_M40mag: ck_M40a1_grass

{

scopeWeapon=0;

picture="\Kurtz_M40A3\ammoicon.paa";

scopemagazine=2;

displayNameMagazine = "7.62x51mm rounds";

shortNameMagazine = "7.62mm";

};

};

class CfgVehicles

{

    class All{};

    class AllVehicles:All{};

    class Land:AllVehicles{};

    class Man:Land{};

    class Soldier:Man{};

    class SoldierWB:Soldier{};

    class SoldierWSniper:SoldierWB{};

    class ck_M40a1sniper_grass:SoldierWSniper

{      

      side=TWest;

  displayName="Sniper (M40A1 - grass)";

  weapons[]={ck_M40a1_grass,Binocular,Throw,Put};

    magazines[]={ck_m40mag, ck_m40mag, ck_m40mag, ck_m40mag, ck_m40mag, ck_m40mag, ck_m40mag, ck_m40mag};

  };

class ck_M40a1sniper_grass_full:ck_M40a1sniper_grass

{      

  displayName="Sniper (M40A1 - grass full)";

  weapons[]={ck_M40a1_grass_full,Binocular,Throw,Put};

  };

class ck_M40a1sniper_desert:ck_M40a1sniper_grass

{      

  displayName="Sniper (M40A1 - desert)";

  weapons[]={ck_M40a1_desert,Binocular,Throw,Put};

  };

class ck_M40a1sniper_desert_full:ck_M40a1sniper_grass

{      

  displayName="Sniper (M40A1 - desert full)";

  weapons[]={ck_M40a1_desert_full,Binocular,Throw,Put};

  };

class ck_M40a3sniper_grass:ck_M40a1sniper_grass

{      

  displayName="Sniper (M40A3 - grass)";

  weapons[]={ck_M40a3_grass,Binocular,Throw,Put};

  };

class ck_M40a3sniper_grass_full:ck_M40a1sniper_grass

{      

  displayName="Sniper (M40A3 - grass full)";

  weapons[]={ck_M40a3_grass_full,Binocular,Throw,Put};

  };

class ck_M40a3sniper_desert:ck_M40a1sniper_grass

{      

  displayName="Sniper (M40A3 - desert)";

  weapons[]={ck_M40a3_desert,Binocular,Throw,Put};

  };

class ck_M40a3sniper_desert_full:ck_M40a1sniper_grass

{      

  displayName="Sniper (M40A3 - desert full)";

  weapons[]={ck_M40a3_desert_full,Binocular,Throw,Put};

  };

class ck_M40a3sniper_standard:ck_M40a1sniper_grass

{      

  displayName="Sniper (M40A3 - standard)";

  weapons[]={ck_M40a3_standard,Binocular,Throw,Put};

  };

};

class CfgNonAIVehicles

{

class ProxyWeapon {};

class Proxyck_M40a1sniper_grass : ProxyWeapon {};

class Proxyck_M40a1sniper_grass_full : ProxyWeapon {};

class Proxyck_M40a1sniper_desert : ProxyWeapon {};

class Proxyck_M40a1sniper_desert_full : ProxyWeapon {};

class Proxyck_M40a3sniper_grass : ProxyWeapon {};

class Proxyck_M40a3sniper_grass_full : ProxyWeapon {};

class Proxyck_M40a3sniper_desert : ProxyWeapon {};

class Proxyck_M40a3sniper_desert_full : ProxyWeapon {};

class Proxyck_M40a3sniper_standard : ProxyWeapon {};

};

anyone got a suggestion on what we can do to fix this? Thanks.

Share this post


Link to post
Share on other sites

Just replace

Quote[/b] ] displayName="M40A1 (grass)";

by

Quote[/b] ] displayName="M40A3";

in your

Quote[/b] ]class ck_m40a1_grass: m21

regards,

TB84

Share this post


Link to post
Share on other sites

The problem here is that the .pbo file doesn't recognise the the different display names for each of the individual weapons.

It simply applys the display name for the original M40A1 (grass) to all of them, when it shouldn't.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×