Jump to content
Sign in to follow this  
Doppe

Chainsaw config.cpp help

Recommended Posts

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgPatches

{

class chainsaw

{

units[]={"chainsawCivilian6"};

weapons[]={"chainsawBase","chainsaw","chainsawMag"};

requiredVersion=1.750000;

};

};

class CfgModels

{

class default {};

class Weapon: default {};

class chainsaw: Weapon {};

};

class CfgAmmo

{

class default {};

class BulletSingle: default {}

class chainsawAmmo: BulletSingle

{

hit=6;

indirectHit=0;

indirectHitRange=0.000000;

simulationStep=0.1;

tracerColor[]={0,0,0,0.0};

tracerColorR[]={0,0,0,0.0};

soundFly[]={"",1,1};

soundEngine[]={"",1,1};

minRange=0.000000;

minRangeProbab=1.000000;

midRange=1;

midRangeProbab=1.000000;

maxRange=1;

maxRangeProbab=1.00000;

maxControlRange=0;

visibleFire=0;

audibleFire=0;

visibleFireTime=0;

initTime=1.0;

};

};

class CfgWeapons

{

class Default{};

class MGun: Default{};

class MachineGun7_6: MGun{};

class MachineGun7_6Manual: MachineGun7_6{};

class PK: MachineGun7_6Manual{};

class chainsawBase: PK

{

access=2;

scopeWeapon=2;

scopeMagazine=0;

model="\chainsaw\chainsaw";

modelOptics="empty";

displayName="Chainsaw";

displayNameMagazine="Chainsaw Gasoline";

shortNameMagazine="Gasoline";

count=10000;

weaponType=1;

magazineType="256";

reloadTime=0.000000000000000000000000000000000001;

magazineReloadTime=5;

autoFire=1;

sound[]={""};

autoReload=0;

magazines[]={"chainsawMag"};

backgroundReload=0;

ammo="chainsawAmmo";

multiplier=1;

initSpeed=900;

aiRateOfFire=1.0; // delay between shots at given distance

aiRateOfFireDistance=2; // at shorter distance delay goes lineary to zero

};

class chainsaw: chainsawBase

{

picture="\chainsaw\chainsaw.paa";

scopeWeapon=2;

scopeMagazine=0;

};

class chainsawMag: chainsawBase

{

scopeWeapon=0;

scopeMagazine=2;

displayNameMagazine="Chainsaw Gasoline";

shortNameMagazine="Gasoline";

picture="\chainsaw\gear2.paa";

};

};

class CfgVehicles

{

class All {};

class AllVehicles: All {};

class Land: AllVehicles {};

class Man: Land {};

class Civilian: Man {};

class Civilian6: Civilian {}

class chainsawCivilian6: Civilian6

{

access=2

displayName="Man (Chainsaw)";

weapons[]={"Throw","Put","Chainsaw"};

magazines[]={"chainsawMag","chainsawMag","chainsawMag","chainsawMag","chainsawMag","chainsawMag","chainsawMag","chainsawMag","chainsawMag"};

};

}

Ok, there is my Chainsaw's config.cpp, and i need to get work the ammo range problem. When i try to fire gun the bullet will reach even 500 meters. I want that the range is (MaxRange) about 2 meters. Any help? help.gif

Share this post


Link to post
Share on other sites

Does anyone know?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

minRange=0.000000;

minRangeProbab=1.000000;

midRange=1;

midRangeProbab=1.000000;

maxRange=1;

maxRangeProbab=1.00000;

I think that it should be in that part, but i'm not sure. maxRange is 1 but it still can reach over 300 meters!!

Share this post


Link to post
Share on other sites

Instead of inheriting your chainsaw ammo from a bullet class, it should be better to get it from the BIS "stroke" class as it is using a simulation="shotStroke"; that may limit the range.

So it should be

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgAmmo

{

class default {};

class StrokeFistHit:Default {}

class chainsawAmmo: StrokeFistHit

{

hit=6;

indirectHit=0;

indirectHitRange=0.000000;

simulation="shotStroke";

simulationStep=0.1;

tracerColor[]={0,0,0,0.0};

tracerColorR[]={0,0,0,0.0};

soundFly[]={"",1,1};

soundEngine[]={"",1,1};

minRange=0.000000;

minRangeProbab=1.000000;

midRange=1;

midRangeProbab=1.000000;

maxRange=1;

maxRangeProbab=1.00000;

maxControlRange=0;

visibleFire=0;

audibleFire=0;

visibleFireTime=0;

initTime=1.0;

};

};

For the record, the StrokeFistHit class is

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class StrokeFistHit:Default

{

hit=2;

indirectHit=0.5;

indirectHitRange=0.2;

minRange=0;

minRangeProbab=0.3;

midRange=0.5;

midRangeProbab=0.8;

maxRange=1;

maxRangeProbab=0.0;

model="granat";

simulation="shotStroke";

cost=1;

simulationStep=0.05;

soundHit[]={"",0.0000316,1};

soundFly[]={"objects\noise",0.0000316,4};

soundEngine[]={"",0.0001,4};

visibleFire=2;

audibleFire=0.25;

visibleFireTime=1;

};

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  

×