Home   Help Search Login Register  

Author Topic: Question on cfgRecoils:HELP  (Read 1223 times)

0 Members and 1 Guest are viewing this topic.

CAT_SHIT_ONE_MM

  • Guest
Question on cfgRecoils:HELP
« on: 02 Nov 2002, 14:31:46 »
Hi, I have a question on the class cfgrecoils....  First of all I have to know the exact discription of each numbers in the recoil.

I wanted to know if there is a way to "NOT" make the gun come back to the original position.  I mean, I want to know how to give the soldiers the effect of not bringing back the rifle to the original position.  I want to know how to do the same thing when you're a leader and press the "Del" key on the number pad on the right side of the key board then fire a round then you will realise that the rifle just keeps on going up and doesn't come back to the original position.

If I could do this.  It means that the players must bring back the rifle to the original position manually then it will be hard for the players to rapidly fire at enemy target accurately and it will also increase the realism of firing your weapon in automatic mode by making the player bring down and adjust the weapon position manually.  By doing this he or she will not be able to fire the weapons for ever (use up the entire 200 rounds.... for the minimi...), since the weapon fires so fast and moves up so fast, you won't be able to aim at the enemy accurately and obviously, you won't want to waste your ammunitions.

So, how do I do it?  Thanks.

major asshole

  • Guest
Re:Question on cfgRecoils:HELP
« Reply #1 on: 02 Nov 2002, 22:28:34 »

G'day

This is from Snypir's Config.cpp File Tutorial:

The pre-defined CfgRecoils class looks as follows:

class CfgRecoils
{
     empty[]={};
     impulse[]={0.050000,0.020000,0.200000,0.100000,0.030000,-0.100000,0.300000,0,0};
     riffleSingle[]={0.050000,0.020000,0.040000,0.050000,0,0};
     riffleSilenced[]={0.010000,0.004000,0.010000,0.050000,0,0};
     LAWSingle[]={0.020000,0,0,0.050000,0.080000,0.030000,0.100000,0.030000,0.015000,0.200000,0,0};
     sniperSingle[]={0.020000,0,0,0.050000,0.010000,0.020000,0.100000,0.008000,0.018000,0.200000,0,0};
     riffleBurst3[]={0.050000,0.020000,0.040000,0.050000,0,0};
    mgunBurst3[]={0.050000,0.020000,"0.04*1.35",0.050000,0.010000,"0.01*1.35",0.050000,0.030000,"0.04*1.35",0.050000,0.020000,"0.02*1.35",0.050000,0.040000,"0.04*1.35",0.010000,0,0};
};

In your addons you can make new recoils for your weapons!

The basics is this:

class CfgRecoils
{
    MyRecoil[]={1.00,0.5,0.7};
};

That creates a new recoild named MyRecoil, that moves the weapon 0.5 units backwards and 0.7 units upwards, and doest that in 1 second. So the first number is how long the movement takes, the second is the amout of kickback and the third is the amout of upwards movement. But, thats not all. You can put many of those in a row, example:

class CfgRecoils
{
    shotgun[]={0.02,0,0.01,0.05,0.05,0.15,0.4,0,0};
};

That does a recoil that first does a 0.02 second movement that moves the gun 0.01 units up (very little). Then it does a 0.05 second movement that does a small kickback (0.05 units) and a nice 0.15 units kick upwards. Then, in 0.4 seconds it moves everything back to the normal pos (0,0). That last 0,0 transform is necessary to make it look good.

Then, to use this recoil, put these to the CfgWeapons class:

recoil=shotgun;
recoilFixed=shotgun;

The 'recoil' is apparently the recoil used when standing/walkin/running and fixed is for when you are lying on the ground.

hope this helps

L8R

CAT_SHIT_ONE_MM

  • Guest
Re:Question on cfgRecoils:HELP
« Reply #2 on: 03 Nov 2002, 11:25:03 »
hi thanks dude.  I'll try it out.  But is there a way to "KEEP" the rifle at the position the thing kicked back? I mean, is there a way to not make the rifle come back to the original position.  Thanks.

sussmori

  • Guest
Re:Question on cfgRecoils:HELP
« Reply #3 on: 04 Nov 2002, 04:56:47 »
I don't think this is possible. I tried to get this system going for I44 bolt action rifles and it didn't work.

The thing with recoil, is that the rifle always comes back to the original position. Even if you don't manually do it via "0.5, 0, 0}" at the end of the recoil line (for example), OFP will do it anyway, instantaneously. It's the equivalent of OFP always adding "0, 0, 0}" to the end of any recoil string.

I also tried making the return to original position really slow like 20 sec, ie. adding "20, 0 ,0}" at the end of the recoil string. This kinda works, but the prob is that when u shoot while the rifle is still up in the air, it will not add cumilative rise (like DoD for example), and will still keep coming down even after u manually reaim.