Jump to content
Sign in to follow this  
sputnik monroe

I want to make my own custom config

Recommended Posts

After replacing all infantry and vehicle unit. And it working good. Now i'm try to adding new weapon.

I use this code to add m4_acog_suppressed wepaon as a default sabetour weapon.

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

{

scopeWeapon=2;

scopeMagazine=2;

model="\LSR_uswp\m4\lsr_m4_acog.p3d";

modelOptics="\LSR_uswp\opt\opt_m16.p3d";

reloadMagazineSound[]={"\LSR_uswp\sounds\M16reload.wss",0.010316,1};

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

optics=1;

opticsZoomMin=0.35;

opticsZoomMax=0.35;

opticsFlare="true";

displayName="M4";

uipicture="\LSR_uswp\uipics\ivojak.paa";

magazines[]={"M4"};

modes[]={"Single","FullAuto"};

class Single

{

ammo="BulletSingleW";

multiplier=1;

burst=1;

displayName="M4A1";

dispersion=0.002;

sound[]={"Weapons\M16Single",1.0,1};

soundContinuous=0;

reloadTime=0.07;

ffCount=1;

recoil="riffleSingle";

autoFire=0;

aiRateOfFire=5.0;

aiRateOfFireDistance=500;

useAction=0;

useActionTitle="";

};

class FullAuto

{

ammo="BulletFullAutoW";

multiplier=1;

burst=1;

displayName="$STR_DN_M4_AUTO";

dispersion=0.004;

sound[]={"Weapons\M16Single",1.0,1};

soundContinuous=0;

reloadTime=0.1;

ffCount=30;

recoil="riffleBurst3";

autoFire=1;

aiRateOfFire=5.0;

aiRateOfFireDistance=500;

useAction=0;

useActionTitle="";

};

};

class M4_acog_sd:ar15

{

scopeWeapon=2;

scopeMagazine=0;

reloadMagazineSound[]={"\LSR_uswp\sounds\M16reload.wss",0.010316,1};

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

model="\LSR_uswp\m4\lsr_m4_sopmod_sd.p3d";

modelOptics="\LSR_uswp\opt\opt_acog.p3d";

optics=1;

opticsZoomMin=0.16;

opticsZoomMax=0.16;

opticsFlare="false";

picture="\LSR_uswp\weapics\w_m4sopmodsd.paa";

displayName="M4 SOPMOD SD";

modes[]={"Single","FullAuto"};

};

class m4sdmag:M16

{

scopeWeapon=0;

scopeMagazine=2;

displayNameMagazine="5.56 30 rd. SD Mag";

shortNameMagazine="5.56 30 rd. SD Mag";

picture="\LSR_uswp\weapics\m_ar15sd.paa";

count=30;

initSpeed=874;

modes[]={"Single","FullAuto"};

class Single

{

ammo="LSR_m4_Silenced_Single_Bullet";

multiplier=1;

burst=1;

displayName="5.56x45 SD Semi";

dispersion=0.0003;

sound[]={"\LSR_uswp\sounds\M4fireSD.wss","db0",1};

soundContinuous=0;

reloadTime=0.075;

ffCount=1;

recoil="LSR_m4Recoil";

autoFire=0;

aiRateOfFire=0.85;

aiRateOfFireDistance=500;

useAction=0;

useActionTitle="";

};

class FullAuto

{

ammo="LSR_m4_Silenced_Full_Bullet";

multiplier=1;

burst=1;

displayName="5.56x45 SD Auto";

dispersion=0.0008;

sound[]={"\LSR_uswp\sounds\M4fireSD.wss","db0",1};

soundContinuous=0;

reloadTime=0.075;

ffCount=30;

recoil="LSR_m4FullRecoil";

autoFire=1;

aiRateOfFire=0.85;

aiRateOfFireDistance=500;

useAction=0;

useActionTitle="";

};

};

And for the bullet i used this code

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

{

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

soundfly[]={"soundfly1",0.2,"soundfly2",0.2,"soundfly3",0.2,"soundfly4",0.2,"soundfly5",0.2};

hitGround[]={"soundHit1",0.125,"soundHit2",0.125,"soundHit3",0.125,"soundHit4",0.125,"soundHit5",

0.125,"soundHit6",0.125,"soundHit7",0.125,"soundHit8",0.125};

hitMan[]={"soundHitMan1",0.166667,"soundHitMan2",0.166667,"soundHitMan3",0.166667,"soundHitMan4",

0.166667,"soundHitMan5",0.166667,"soundHitMan6",0.166667};

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

0.125,"soundHitArmor4",0.125,"soundHitArmor5",0.125,"soundHitArmor6",

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

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

0.076,"soundHitBuilding4",0.076,"soundHitBuilding5",0.076,"soundHitBuilding6",

0.076,"soundHitBuilding7",0.076,"soundHitBuilding8",0.076,"soundHitBuilding10",

0.076,"soundHitBuilding11",0.076,"soundHitBuilding12",0.076,"soundHitBuilding13",0.076};

};

class LSR_m4_Silenced_Single_Bullet : LSR_Bullet

{

hit=8;indirectHit=2;indirectHitRange=0.1;

visibleFire=0.035; // how much is visible when this weapon is fired

audibleFire=0.035;

visibleFireTime=2; // how long is it visible

minRange=0.5;minRangeProbab=0.10;

midRange=150;midRangeProbab=0.38;

maxRange=300;maxRangeProbab=0.04;

cost = 0.7;

};

class LSR_m4_Silenced_Full_Bullet: LSR_Bullet

{

hit=8;indirectHit=2;indirectHitRange=0.1;

visibleFire=0.035;

audibleFire=0.035;

visibleFireTime=2;

minRange=0.5;minRangeProbab=0.25;

midRange=150;midRangeProbab=0.50;

maxRange=300;maxRangeProbab=0.08;

cost = 2.1;

};

In the unit class i change the line

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

{

scope=1;

picture="\misc\meciky.paa";

accuracy=3.5;

cost=400000;

nameSound="blackOp";

displayName="$STR_DN_BLACKOP";

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

magazines[]={"m4sdmag","m4sdmag","m4sdmag","m4sdmag","TimeBomb","TimeBomb","TimeBomb"};

camouflage=0.7;

threat[]={1,0.5,0.1};

model="\HYK_USsol\wl\HYK_USsfc_wl.p3d";

canHideBodies=1;

canDeactivateMines=1;

nightVision=1;

};

class SoldierWSaboteurPipe:SoldierWSaboteur

{

scope=2;

displayName="$STR_DN_BLACKOP";

weapons[]={"M4_acog_sd","NVGoggles","Throw","Put"};

magazines[]={"m4sdmag","m4sdmag","m4sdmag","m4sdmag","PipeBomb","PipeBomb","PipeBomb"};

};

class SoldierWSaboteurDay:SoldierWSaboteurPipe

{

scope=2;

model="mc saboteurday.p3d";

displayName="$STR_DN_BLACKOPDAY";

weapons[]={"M4_acog_sd","Binocular","Throw","Put"};

magazines[]={"m4sdmag","m4sdmag","m4sdmag","m4sdmag","PipeBomb","PipeBomb","PipeBomb"};

};

The game run normal, in the briefing screen i have the waeapon i need, and the M4 Acog Suppressed magazine clip is full (and one HK mag??). But when i play the game, i have no ammo at all, i can't reload, or shot a fire. Then the game is exit to windows with error messeges. What is wrong with the code?

Share this post


Link to post
Share on other sites

I notice for your 2 saboteurs :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> weapons[]={"M4_acog_sd","NVGoggles","Throw","Put"};

magazines[]={"m4sdmag","m4sdmag","m4sdmag","m4sdmag","PipeBomb","PipeBomb","PipeBomb"};

then i notice that the class M4_acog_sd has no magazine defined for it

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

And it is inheriting from the ar15.

Then , the class ar15 has a magazine defined for it , let's see what you have :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">magazines[]={"M4"};

And there is your problem, the M4_acog_sd in fact use the magazine named M4 defined for your ar15 , and so the game does not consider the m4sdmag as the real ammo for your M4 acog sd

To make sure the M4_acog_sd use the m4sdmag like you want for your saboteur, be sure to add the line

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">magazines[]={"m4sdmag"};

inside of the class M4_acog_sd:ar15 , so it will stop to use the M4 magazine it inherits from the class ar15

Share this post


Link to post
Share on other sites

Thank you for the correction.....it working very well.

Hmmm...Ternyata hal yg membuat frustasi hanya satu baris saja.

magazines[]={"m4sdmag"};

stupid me

banghead.gif

Just another frustating problem..why my unit when they ordered to drive (or get in) ural truck they just hop in but then get out again and said that they're ready. I use SFM Urals Truck Addons.

Thank you for your patience answering all my question.

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  

×