Jump to content
Sign in to follow this  
sander

Seeing double: take and drop weapon error

Recommended Posts

Hi,

There is an odd bug with an addon that I am currently working on where the displayname of the weapon that the player wishes to drop as he takes another weapon from a dead body is displayed twice (Take Minimi Para (Drop Minimi Para Elcan, Minimi Para Elcan)). The config cpp definition seems to be the likely culprit, but I have not been able to figure out what setting(s) cause this double display of the displayname. Has anyone encountered a similar problem before and been able to fix this kind of bug?

The config cpp file:

Quote[/b] ]// Addon based on Earl's work for the excellent Marine Assault Pack, with the original creator's permission.

// Thanks from the Lowlands Warrior team.

// Changes: models with plastic 200 round magazines, extended bipods and Elcan Hi-Mag and model used by the FAV

// 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

#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

#define TracerEColor 0.2,0.8,0.1

#define TracerWColor 0.8,0.5,0.1

#define TracerGColor 0.7,0.7,0.5

#define TracerNColor 0,0,0 // used for sniper / silenced rifles

#define TracerEColorF {TracerEColor,0.040}

#define TracerWColorF {TracerWColor,0.040}

#define TracerGColorF {TracerGColor,0.040}

#define TracerNColorF {TracerNColor,0.005}

#define TracerSEColorF {TracerEColor,0.25}

#define TracerSWColorF {TracerWColor,0.25}

#define TRACER_W_ALWAYS tracerColor[]=TracerWColorF;tracerColorR[]=TracerWColorF

#define TRACER_W_OPTIONAL tracerColor[]=TracerWColorF;tracerColorR[]=TracerNColorF

#define TRACER_W_STRONG tracerColor[]=TracerSWColorF;tracerColorR[]=TracerSWColorF

#define TRACER_E_ALWAYS tracerColor[]=TracerEColorF;tracerColorR[]=TracerEColorF

#define TRACER_E_OPTIONAL tracerColor[]=TracerEColorF;tracerColorR[]=TracerNColorF

#define TRACER_E_STRONG tracerColor[]=TracerSEColorF;tracerColorR[]=TracerSEColorF

#define TRACER_G_ALWAYS tracerColor[]=TracerGColorF;tracerColorR[]=TracerGColorF

#define TRACER_G_OPTIONAL tracerColor[]=TracerGColorF;tracerColorR[]=TracerNColorF

//#define kmm_TracerWColor 0.8,0.5,0.1

#define kmm_TracerWColor 0.8,0.2,0.0

#define kmm_TracerWColorF {kmm_TracerWColor,0.25}

#define kmm_TracerSWColorF {kmm_TracerWColor,0.35}

#define kmm_TracerEColor 0.2,0.8,0.1

#define kmm_TracerEColorF {kmm_TracerEColor,0.25}

#define kmm_TracerSEColorF {kmm_TracerEColor,0.35}

#define kmm_TracerNColorF {TracerNColor,0.005}

#define kmm_TRACER_W_ALWAYS tracerColor[]=kmm_TracerWColorF;tracerColorR[]=kmm_TracerWColorF

#define kmm_TRACER_W_OPTIONAL tracerColor[]=kmm_TracerWColorF;tracerColorR[]=kmm_TracerNColorF

#define kmm_TRACER_W_STRONG tracerColor[]=kmm_TracerSWColorF;tracerColorR[]=kmm_TracerSWColorF

#define kmm_TRACER_E_ALWAYS tracerColor[]=kmm_TracerEColorF;tracerColorR[]=kmm_TracerEColorF

#define kmm_TRACER_E_OPTIONAL tracerColor[]=kmm_TracerEColorF;tracerColorR[]=kmm_TracerNColorF

#define kmm_TRACER_E_STRONG tracerColor[]=kmm_TracerSEColorF;tracerColorR[]=kmm_TracerSEColorF

#define kmm_TRACER_N_ALWAYS tracerColor[]=TracerNColorF;tracerColorR[]=TracerNColorF

class CfgPatches

{

class kmm_Magazines

{

units[] = {};

weapons[] = {KMMm249mag};

requiredVersion = 1.90;

requiredAddons[] = {"BIS_Resistance"};

};

class kmm_para

{

units[] = {};

weapons[] = { "KMMM249PARA","KMMM249PARAcco",

"KMM_PARA_BOX","KMM_PARA_BIPOD", "KMM_MINIMI_FAV",

"KMM_PARA_HIMAG","KMM_PARA_HIMAG_BOx","KMM_PARA_HIMAG_BIPOD"

};

requiredaddons[] = {BIS_Resistance};

requiredVersion = 1.90;

};

};

class CfgModels

{

class default {};

class Weapon: default {};

class KMMM249PARA: Weapon {};

class KMMM249PARAcco: Weapon {};

class KMM_MINIMI_FAV: Weapon {};

class KMM_PARA_BOX: Weapon {};

class KMM_PARA_BIPOD: Weapon {};

class KMM_PARA_HIMAG: Weapon {};

class KMM_PARA_HIMAG_BIPOD: Weapon {};

class KMM_PARA_HIMAG_BOX: Weapon {};

};

class CfgRecoils

{

KMMm249Recoil[]= {0.015,0.015,0.015, 0.015,0.025,0.02, 0.015,0.15,0.01, 0.015,0,0};

};

class CfgAmmo

{

class Default {};

class BulletSingle : Default {};

class BulletBurst: BulletSingle {};

class BulletFullAuto: BulletBurst {};

class BulletSilencedSingle: BulletSingle {};

class BulletSilencedBurst: BulletBurst {};

class BulletSniper : BulletSingle {};

class Bullet7_6: BulletSingle {};

class Bullet12_7: Bullet7_6 {};

class kmm_Bullet: BulletSingle

{

soundHit1[]={"\kmm_para\soundhit\hit_ground1.wss",0.031623,1};

soundHit2[]={"\kmm_para\soundhit\hit_ground2.wss",0.031623,1};

soundHit3[]={"\kmm_para\soundhit\hit_ground3.wss",0.031623,1};

soundHit4[]={"\kmm_para\soundhit\hit_ground4.wss",0.031623,1};

soundHit5[]={"\kmm_para\soundhit\hit_ground5.wss",0.031623,1};

soundHit6[]={"\kmm_para\soundhit\hit_ground6.wss",0.031623,1};

soundHit7[]={"\kmm_para\soundhit\hit_ground7.wss",0.031623,1};

soundHit8[]={"\kmm_para\soundhit\hit_ground8.wss",0.031623,1};

soundHitMan1[]={"\kmm_para\soundhit\hit_man1.wss",0.012589,1};

soundHitMan2[]={"\kmm_para\soundhit\hit_man2.wss",0.012589,1};

soundHitMan3[]={"\kmm_para\soundhit\hit_man4.wss",0.012589,1};

soundHitMan4[]={"\kmm_para\soundhit\hit_man5.wss",0.012589,1};

soundHitMan5[]={"\kmm_para\soundhit\hit_man6.wss",0.012589,1};

soundHitMan6[]={"\kmm_para\soundhit\hit_man7.wss",0.012589,1};

soundHitArmor1[]={"\kmm_para\soundhit\hit_metal1.wss",0.031623,1};

soundHitArmor2[]={"\kmm_para\soundhit\hit_metal2.wss",0.031623,1};

soundHitArmor3[]={"\kmm_para\soundhit\hit_metal3.wss",0.031623,1};

soundHitArmor4[]={"\kmm_para\soundhit\hit_metal4.wss",0.031623,1};

soundHitArmor5[]={"\kmm_para\soundhit\hit_metal5.wss",0.031623,1};

soundHitArmor6[]={"\kmm_para\soundhit\hit_metal6.wss",0.031623,1};

soundHitArmor7[]={"\kmm_para\soundhit\hit_metal7.wss",0.031623,1};

soundHitArmor8[]={"\kmm_para\soundhit\hit_metal8.wss",0.031623,1};

soundHitBuilding1[]={"\kmm_para\soundhit\ric1.wss",0.031623,1};

soundHitBuilding2[]={"\kmm_para\soundhit\ric2.wss",0.031623,1};

soundHitBuilding3[]={"\kmm_para\soundhit\ric3.wss",0.031623,1};

soundHitBuilding4[]={"\kmm_para\soundhit\ric4.wss",0.031623,1};

soundHitBuilding5[]={"\kmm_para\soundhit\ric5.wss",0.031623,1};

soundHitBuilding6[]={"\kmm_para\soundhit\ric6.wss",0.031623,1};

soundHitBuilding7[]={"\kmm_para\soundhit\ric7.wss",0.031623,1};

soundHitBuilding8[]={"\kmm_para\soundhit\ric8.wss",0.031623,1};

soundHitBuilding9[]={"\kmm_para\soundhit\ric9.wss",0.031623,1};

soundHitBuilding10[]={"\kmm_para\soundhit\ric10.wss",0.031623,1};

soundHitBuilding11[]={"\kmm_para\soundhit\ric11.wss",0.031623,1};

soundHitBuilding12[]={"\kmm_para\soundhit\ric12.wss",0.031623,1};

soundHitBuilding13[]={"\kmm_para\soundhit\ric13.wss",0.031623,1};

soundfly1[]={"\kmm_para\soundhit\fly1.wss",0.031623,1};

soundfly2[]={"\kmm_para\soundhit\fly2.wss",0.031623,1};

soundfly3[]={"\kmm_para\soundhit\fly3.wss",0.031623,1};

soundfly4[]={"\kmm_para\soundhit\fly4.wss",0.031623,1};

soundfly5[]={"\kmm_para\soundhit\fly4.wss",0.031623,1};

soundfly[]={"soundfly1",0.2,"soundfly2",0.2,"soundfly3",0.2,"sound

fly4",0.2,"soundfly5",0.2};

hitGround[]={"soundHit1",0.125,"soundHit2",0.125,"soundHit3",0.125,&quot

;soundHit4",0.125,"soundHit5",0.125,"soundHit6",0.125,"sound

Hit7",0.125,"soundHit8",0.125};

hitMan[]={"soundHitMan1",0.166667,"soundHitMan2",0.166667,"soundHitMan3&qu

ot;,0.166667,"soundHitMan4",0.166667,"soundHitMan5",0.166667,"sou

ndHitMan6",0.166667};

hitArmor[]={"soundHitArmor1",0.125,"soundHitArmor2",0.125,"soundHitArmor3&qu

ot;,0.125,"soundHitArmor4",0.125,"soundHitArmor5",0.125,"soundHit

Armor6",0.125,"soundHitArmor7",0.125,"soundHitArmor8",0.125};

hitBuilding[]={"soundHitBuilding1",0.076,"soundHitBuilding2",0.076,"soundHitBui

lding3",0.076,"soundHitBuilding4",0.076,"soundHitBuilding5",0.076

,"soundHitBuilding6",0.076,"soundHitBuilding7",0.076,"soundHitBui

lding8",0.076,"soundHitBuilding10",0.076,"soundHitBuilding11",0.0

76,"soundHitBuilding12",0.076,"soundHitBuilding13",0.076};

};

//m249 bullet

class KMMSAW_mg_Bullet: kmm_Bullet

{

airLock=true;

hit=9.5;indirectHit=2;indirectHitRange=0.1;

minRange=1;minRangeProbab=0.90;

midRange=100;midRangeProbab=0.50;

maxRange=450;maxRangeProbab=0.05;

cost=4;

};

class kmm_SAW_mg_Bullet: KMMSAW_mg_Bullet{kmm_TRACER_W_OPTIONAL;};

};

class CfgWeapons

{

class Default {};

class MGun: Default {};

class MachineGun7_6: MGun {};

class MachineGun7_6Manual: MachineGun7_6 {};

class Riffle: MGun {};

class M16: Riffle {};

class M4 : Riffle{};

class AK47: Riffle {};

class AK74: Riffle {};

class HKG3Base: M16{};

class FALBase: HKG3Base{};

// M249

class KMMm249mag : MachineGun7_6Manual

{

scopeWeapon = 0;

scopeMagazine = 2;

magazineType = 2 * WeaponSlotItem;

displayNameMagazine = "Minimi Mag";

shortNameMagazine = "Minimi Mag";

picture="\kmm_para\pics\M249mag.paa";

ammo=kmm_SAW_mg_Bullet;

count=200;

dispersion=0.0034;

initSpeed=874;

sound[]={"\kmm_para\sounds\M249Fire.wss",db7,1};

reloadMagazineSound[]={"\kmm_para\sounds\M249Reload.wss",0.010316,1};

soundContinuous=0;

reloadTime=0.06;

maxLeadSpeed=300;

ffCount=6;

aiDispersionCoefX=5;

ffMagnitude=0.500000;

ffFrequency=11;

recoil=KMMm249Recoil;

autoFire=true;

aiRateOfFire=0.50000;

aiRateOfFireDistance=1000;

useAction=0;

useActionTitle="";

canDrop = true;

};

class KMMM16Base: Riffle {};

class KMMM249PARA: KMMM16Base {

scopeWeapon=2;

scopeMagazine=0;

reloadMagazineSound[]={"\kmm_para\sounds\M249reload.wss",0.010316,1};

drySound[]={"weapons\M16dry",db-40,1};

weaponType = WeaponSlotPrimary + WeaponSlotSecondary;

model="\kmm_para\KMMM249PARA.p3d";

picture="\kmm_para\inv_pics\M249para.paa";

modelOptics="\kmm_para\optic_m249.p3d";

optics=1;

opticsZoomMin=0.20;

opticsZoomMax=0.20;

distanceZoomMin=300;

distanceZoomMax=300;

opticsFlare = false;

displayName="Minimi Para";

// uipicture="\kmm_para\icons\m249para.paa";

uiPicture = ismg;

magazineReloadTime=20;

modes[]={"Burst"};

magazines[]={"KMMm249mag"};

dexterity=0.60;

canDrop = true;

};

class KMMM249PARAcco: KMMM16Base {

scopeWeapon=2;

scopeMagazine=0;

reloadMagazineSound[]={"\kmm_para\sounds\M249reload.wss",0.010316,1};

drySound[]={"weapons\M16dry",db-40,1};

weaponType = WeaponSlotPrimary + WeaponSlotSecondary;

model="\kmm_para\KMMM249PARAcco.p3d";

picture="\kmm_para\inv_pics\M249paracco.paa";

modelOptics="\kmm_para\optic_m68.p3d";

optics=1;

opticsZoomMin=0.330;

opticsZoomMax=0.330;

distanceZoomMin=150;

distanceZoomMax=150;

opticsFlare = false;

displayName="Minimi Para Aimpoint";

// uipicture="\kmm_para\icons\m249paracco.paa";

uiPicture = ismg;

magazineReloadTime=20;

modes[]={"Burst"};

magazines[]={"KMMm249mag"};

dexterity=0.5;

canDrop = true;

};

// Plastic ammobox

class KMM_PARA_BOX: KMMM16Base {

scopeWeapon=2;

scopeMagazine=0;

reloadMagazineSound[]={"\kmm_para\sounds\M249reload.wss",0.010316,1};

drySound[]={"weapons\M16dry",db-40,1};

weaponType = WeaponSlotPrimary + WeaponSlotSecondary;

uiPicture = ismg;

model="\kmm_para\KMM_PARA_BOX.p3d";

displayName="Minimi Para";

picture="\kmm_para\inv_pics\M249para.paa";

modelOptics="\kmm_para\optic_m249.p3d";

optics=1;

opticsZoomMin=0.20;

opticsZoomMax=0.20;

distanceZoomMin=300;

distanceZoomMax=300;

opticsFlare = false;

magazineReloadTime=20;

modes[]={"Burst"};

magazines[]={"KMMm249mag"};

dexterity=0.60;

canDrop = true;

};

// Plastic ammobox and bipod

class KMM_PARA_BIPOD: KMMM16Base {

scopeWeapon=2;

scopeMagazine=0;

reloadMagazineSound[]={"\kmm_para\sounds\M249reload.wss",0.010316,1};

drySound[]={"weapons\M16dry",db-40,1};

weaponType = WeaponSlotPrimary + WeaponSlotSecondary;

uiPicture = ismg;

model="\kmm_para\KMM_PARA_BIPOD.p3d";

displayName="Minimi Para";

picture="\kmm_para\inv_pics\M249para.paa";

modelOptics="\kmm_para\optic_m249.p3d";

optics=1;

opticsZoomMin=0.20;

opticsZoomMax=0.20;

distanceZoomMin=300;

distanceZoomMax=300;

opticsFlare = false;

magazineReloadTime=20;

modes[]={"Burst"};

magazines[]={"KMMm249mag"};

dexterity=0.60;

canDrop = true;

};

// Minimi version in use with Venezuelan armed forces

class KMM_MINIMI_FAV: KMMM16Base {

scopeWeapon=2;

scopeMagazine=0;

reloadMagazineSound[]={"\kmm_para\sounds\M249reload.wss",0.010316,1};

drySound[]={"weapons\M16dry",db-40,1};

weaponType = WeaponSlotPrimary + WeaponSlotSecondary;

uiPicture = ismg;

model="\kmm_para\KMM_MINIMI_FAV.p3d";

displayName="Minimi";

picture="\kmm_para\inv_pics\M249.paa";

modelOptics="\kmm_para\optic_m249.p3d";

optics=1;

opticsZoomMin=0.20;

opticsZoomMax=0.20;

distanceZoomMin=300;

distanceZoomMax=300;

opticsFlare = false;

magazineReloadTime=20;

modes[]={"Burst"};

magazines[]={"KMMm249mag"};

dexterity=0.60;

canDrop = true;

};

// Elcan Himag optics

class KMM_PARA_HIMAG: KMMM16Base {

scopeWeapon=2;

scopeMagazine=0;

reloadMagazineSound[]={"\kmm_para\sounds\M249reload.wss",0.010316,1};

drySound[]={"weapons\M16dry",db-40,1};

weaponType = WeaponSlotPrimary + WeaponSlotSecondary;

uiPicture = ismg;

model="\kmm_para\KMM_PARA_HIMAG.p3d";

displayName="Minimi Para Elcan";

picture="\kmm_para\inv_pics\M249himag.paa";

modelOptics="\kmm_para\optic_elcan.p3d";

optics=1;

opticsZoomMin=0.055;

opticsZoomMax=0.055;

distanceZoomMin=400;

distanceZoomMax=400;

opticsFlare = false;

magazineReloadTime=20;

modes[]={"Burst"};

magazines[]={"KMMm249mag"};

dexterity=0.5;

canDrop = true;

};

// Elcan Himag optics and plastic ammobox

class KMM_PARA_HIMAG_BOX: KMMM16Base {

scopeWeapon=2;

scopeMagazine=0;

reloadMagazineSound[]={"\kmm_para\sounds\M249reload.wss",0.010316,1};

drySound[]={"weapons\M16dry",db-40,1};

weaponType = WeaponSlotPrimary + WeaponSlotSecondary;

uiPicture = ismg;

model="\kmm_para\KMM_PARA_HIMAG_BOX.p3d";

displayName="Minimi Para Elcan";

picture="\kmm_para\inv_pics\M249himag.paa";

modelOptics="\kmm_para\optic_elcan.p3d";

optics=1;

opticsZoomMin=0.055;

opticsZoomMax=0.055;

distanceZoomMin=400;

distanceZoomMax=400;

opticsFlare = false;

magazineReloadTime=20;

modes[]={"Burst"};

magazines[]={"KMMm249mag"};

dexterity=0.5;

canDrop = true;

};

// Elcan Himag optics, plastic ammobox and bipod

class KMM_PARA_HIMAG_BIPOD: KMMM16Base {

scopeWeapon=2;

scopeMagazine=0;

reloadMagazineSound[]={"\kmm_para\sounds\M249reload.wss",0.010316,1};

drySound[]={"weapons\M16dry",db-40,1};

weaponType = WeaponSlotPrimary + WeaponSlotSecondary;

uiPicture = ismg;

model="\kmm_para\KMM_PARA_HIMAG_BIPOD.p3d";

displayName="Minimi Para Elcan";

picture="\kmm_para\inv_pics\M249himag.paa";

modelOptics="\kmm_para\optic_elcan.p3d";

optics=1;

opticsZoomMin=0.055;

opticsZoomMax=0.055;

distanceZoomMin=400;

distanceZoomMax=400;

opticsFlare = false;

magazineReloadTime=20;

modes[]={"Burst"};

magazines[]={"KMMm249mag"};

dexterity=0.5;

canDrop = true;

};

};

class CfgNonAIVehicles

{

class ProxyWeapon {};

class ProxyKMMM249PARA: ProxyWeapon {};

class ProxyKMMM249PARAcco: ProxyWeapon {};

class ProxyKMM_MINIMI_FAV: ProxyWeapon {};

class ProxyKMM_PARA_BOX: ProxyWeapon {};

class ProxyKMM_PARA_BIPOD: ProxyWeapon {};

class ProxyKMM_PARA_HIMAG: ProxyWeapon {};

class ProxyKMM_PARA_HIMAG_BOX: ProxyWeapon {};

class ProxyKMM_PARA_HIMAG_BIPOD: ProxyWeapon {};

};

Regards,

Sander

Share this post


Link to post
Share on other sites

I have had this problem while using ORCS weapons but I have no idea of the cause.

Share this post


Link to post
Share on other sites

Kinda old thread, sorry. Just curious. What happens if you use the default line:

weaponType="1 + 16";

instead of:

"weaponslotprimary + weaponslotsecondary"

...and perhaps alter the displaynames somewhat so they all have unique ones.

Share this post


Link to post
Share on other sites
Just curious. What happens if you use the default line:

weaponType="1 + 16";

instead of:

"weaponslotprimary + weaponslotsecondary"

it does exactly the same thing

at the begining of the config you will find :

#define WeaponSlotPrimary 1// primary weapons

#define WeaponSlotSecondary 16// secondary weapons

which defines the value 1 and 16 for WeaponSlotPrimary and WeaponSlotSecondary respectively... so everytime you write WeaponSlotSecondary in your config, the precompiler or whatever it is you want to call it will replace that constant by its value 16.

so basically you could also do :

#define flyingpotatoe 1

#define supermushroom 16

flyingpotatoe+supermushroom in the config will then return 1+16 = 17..

its just a way to make config writing friendlier by using understable names instead of values you would have to know by heart..

so from that config, i would say that when he sees "Drop Minimi Para Elcan, Minimi Para Elcan" its not the same weapon displayed twice, but two different weapons from the same displayname... what he could do for a start is change the display name of each classes so he can differentiate them ingame and check that it is indeed two different weapons... (as you said)

cant be sure thats teh actual problem, its hard to tell just from that config - there's prolly some script involved to "mount" and and dismount the bipods etc... via the action menu ? (which would just be swapping a weapon from another) so it might also come from the script if there is one somewhere

cheers

fab

Share this post


Link to post
Share on other sites

Thanks for the response. The addon has in the meantime been released, but without a fix for this odd problem. Varying the displayname did not affect the 'feature', nor did defining it as only a primary weapon rather than one taking up two slots. There is no fancy deploying bipod, there are simply two different models to give some variation.

Regards,

Sander

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  

×