Home   Help Search Login Register  

Author Topic: question: zoom on weapons  (Read 2700 times)

0 Members and 1 Guest are viewing this topic.

sniper_04

  • Guest
question: zoom on weapons
« on: 26 Nov 2005, 18:50:09 »
i am planning to make my first addon, and its going to be a sniper rifle. i know how to make it and all the nesesarry things, but is it possible to make the scope zoom more, so i can see and hit enemies from very long range (further than the basic snipers on the game). and how can i make the scope so you can zoom in/out?
and is it possible to make your weapon more powerful?

thanks, hope someone will answer me :)

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:question: zoom on weapons
« Reply #1 on: 27 Nov 2005, 08:37:06 »
To make your rifle more powerfull you need to increase the hit, indirectHit and indirectHitRange values in the weapons ammo class..
Hit = the amount of damage inflicted upon the impact point
indirectHit = the amount of damage caused around the impact point
indirectHitRange = the diameter of the area (in meters) the indirectHit will be applied to..

Then, to get the AI to engage targets at further distances (this has nothing to do with the optics zoom) alter the ammo class again, now the maxRange and maxRangeProbab values.. It may help..

(afaik, if I'm wrong, please correct me :P )

So, the basic sniper rifle ammo class would look like this:
Code: [Select]
   class BulletSniper:BulletSingle
      {
      hit=10;
      indirectHit=2;
      indirectHitRange=0.1;
      minRange=1;
      minRangeProbab=0.1;
      midRange=200;
      midRangeProbab=0.8;
      maxRange=900;
      maxRangeProbab=0.05;
      cost=2;
      tracerColor[]={0,0,0,0.05};
      tracerColorR[]={0,0,0,0.05};
      };

And your altered ammo would look something like:
Code: [Select]
   class my_bullet:BulletSniper
      {
      hit=20;
      indirectHit=6;
      indirectHitRange=0.3;
      minRange=1;
      minRangeProbab=0.1;
      midRange=200;
      midRangeProbab=0.8;
      maxRange=1500;
      maxRangeProbab=0.15;
      cost=2;
      tracerColor[]={0,0,0,0.05};
      tracerColorR[]={0,0,0,0.05};
      };
I'm not sure about the maxRangeProbab though.. It may need to be lowered to be more effective..
Also lowering the cost may help as AI will not think the ammo is too expensive to waste.. Although the cost is quite low already..

To make your rifle optics zoom, alter at least the opticsZoomMax and opticsZoomMin values..

Default BIS M21:
Code: [Select]
   class M21:SniperRiffle
      {
      scopeWeapon=2;
      scopeMagazine=2;
      model="M21_proxy";
      modelOptics="optika_snpierw";
      sound[]={"Weapons\m21",1.0,1};
      count=20;
      ammo="BulletSniperW";
      opticsZoomMin=0.04;
      opticsZoomMax=0.12;
      distanceZoomMin=400;
      distanceZoomMax=80;
      displayName="$STR_DN_M21";
      displayNameMagazine="$STR_MN_M21";
      shortNameMagazine="$STR_SN_M21";
      };
distanceZoomXXX values may also play some part in this, can't really remember..

Your sniper riffle
Code: [Select]
   class myrifle:SniperRiffle
      {
      scopeWeapon=2;
      scopeMagazine=2;
      model="M21_proxy";
      modelOptics="optika_snpierw";
      sound[]={"Weapons\m21",1.0,1};
      count=20;
      ammo="BulletSniperW";
      opticsZoomMin=0.04;
      opticsZoomMax=0.50;
      distanceZoomMin=400;
      distanceZoomMax=80;
      displayName="$STR_DN_M21";
      displayNameMagazine="$STR_MN_M21";
      shortNameMagazine="$STR_SN_M21";
      };

I hope I'm at least partly right, it has been ages since I've been meddling with weapon configs.. :P
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

sniper_04

  • Guest
Re:question: zoom on weapons
« Reply #2 on: 27 Nov 2005, 12:38:06 »
thanks mate this was really helpfull, cheers :)

LoTekK

  • Guest
Re:question: zoom on weapons
« Reply #3 on: 28 Nov 2005, 13:59:13 »
One really really important thing to keep in mind. If you want to engage at very long distances, you'll have to crank up the visibility setting (under the graphics options) to sometimes-unreasonable values. Reason being that objects and units show up at a much shorter distance than you might expect with the specified viewdistance.

In fact, based on some tests I just did, the difference between terrain viewdistance and object/unit viewdistance actually increases with higher viewdistance settings. For example, setting myself up as a sniper and placing a loon about 550m away from my position (using a distance check), I started decreasing the viewdistance until he disappeared. Viewdistance was about 650. Next, I placed a guy a little under 900m rom my position. He disappeared once my viewdistance dropped below 1350. With a loon placed 1300m from my position, I had to crank up the viewdistance to about 2100 before he popped into view.

nochmehr

  • Guest
Re:question: zoom on weapons
« Reply #4 on: 02 Jan 2006, 19:24:15 »
how do I increase the viewdistance?

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re:question: zoom on weapons
« Reply #5 on: 02 Jan 2006, 21:32:49 »
Quote
(under the graphics options)
... or by adding setviewdistance 2000 in some init field in the mission editor. this has actually nothing to do with the addon itself.
all lotekk wanted to say is that if you want to aim&shoot at targets that are 2000m away for example, you must be able to see that far in the first place ;) the tricky thing is (as lotekk said) that the set viewdistance value and the real viewdistance vary in fact, so that you have to set the viewdistance to a higher value if you want a given real distance.

as for the zoom: selectthis wrote a calculation sheet for the settings of the zoomfactors.... here: http://www.ofpec.com/yabbse/index.php?board=13;action=display;threadid=16121;start=0
« Last Edit: 02 Jan 2006, 21:33:40 by remcen »
we're looking for members: IM:UC MOD

Skaircro

  • Guest
Re:question: zoom on weapons
« Reply #6 on: 09 Jan 2006, 06:27:03 »
I'm not sure about the maxRangeProbab though.. It may need to be lowered to be more effective..

I'm not entirely sure on this but this is what I've noticed,
I think the min/mid/max RangeProbab is the probability of a direct hit at that range,
so going off your modified ammo details above:
There is a 10% chance of a direct hit at min range(1m)
A 80% chance of a direct hit at mid range (200m)
And a 15% chance of a direct hit at max range (1500m)

Therefore increasing the min/mid/max RangeProbab number will increase the chance of a direct hit.
(i.e. A value of "RangeProbab=1.0;" will mean a 100% chance of a direct hit. Though I dont think this includes the variability caused by the "dispersion" value in the weapon config.)

I'm not sure if this is the way it works for rifle ammo, but I have noticed this with aircraft bombs.
A bomb example:
minRange=500;   minRangeProbab=0.40;
midRange=1000;   midRangeProbab=0.55;
maxRange=2500;   maxRangeProbab=0.85;

If a tank is targeted and a bomb is dropped at 500 metres from the tank there is a 40% chance of a direct hit on the targeted tank.
If the bomb is dropped at 1000 metres from the tank then there is a 55% chance of a direct hit.
And if it is dropped at 2500 metres from the tank there is a 85% chance of a direct hit.


I could be entirely wrong on this, but this is how I've always interpreted min/mid/max RangeProbab values.
I hope this helps and I hope I'm right..  ;)

LoTekK

  • Guest
Re:question: zoom on weapons
« Reply #7 on: 09 Jan 2006, 16:42:59 »
As far as I'm aware, the probability isn't an actual hit probability for the ammo (remember that this isn't a game with RPG-type dice-roll combat). What it represents, as far as I'm aware, is the probability that the AI will pick that weapon/ammo to engage a target within those ranges.