Home   Help Search Login Register  

Author Topic: 2 weapon problems  (Read 1817 times)

0 Members and 1 Guest are viewing this topic.

DaveE

  • Guest
2 weapon problems
« on: 20 Jul 2006, 19:59:19 »
Hey
First, I'm new to this forum so hello to all of you guys :)

I've got two huge problems about my new sniper unit:
1. If the magazine has still x bullets left, the weapon is located behind the player and if the magazine is empty, the weapon is correctly positioned in the model's hands.
2. My idea was to create a sniper unit with a spotter and a sniper. The spotter got a LaserDesignator, the sniper of course a sniper rifle :) And I want the sniper's bullets to hit exactly into the laser dot of the LD. But how can I realise this or is it even impossible? I tried to pick the LDB Launcher and it's ammunition and change it to fit to a rifle but that didn't really work.

Please help me, I've been trying to fix these two problems for about 2 weeks and I'm getting more and more frustrated, but I like the idea so much :(
Dave

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re: 2 weapon problems
« Reply #1 on: 20 Jul 2006, 21:05:06 »
1. if you're using a custom-made rifle in two version (model=yxz1; modelspecial=xyz2;) then these gun models might be the
problem (well, it's not a problem actually, there's only a trick to it ;) )
so.. does this problem also occur with standard BIS weapons?

2. that's an interesting question. it's a matter of the ammo of  your rifle. try adding laserlock=1 in the cfgammo subclass of your sniper rifle ammo. maybe it has to be kind of steerable... maybe it's hardcoded that laserlock is not a valid variable for bullet-subclasses. so in fact it requires a bit of experimenting. if i were you i would download CoC Binview and take a look into the config.bin of resistance, how laserguided bombs and guided missiles are coded (if you haven't already ;) )

if it doesn't work with bullets i would code the bullets as very fast very small non-explosive laser guided bomb... or as rocket ;D well, as i said: experiment!
we're looking for members: IM:UC MOD

DaveE

  • Guest
Re: 2 weapon problems
« Reply #2 on: 20 Jul 2006, 21:50:54 »
Well, I solved the first problem:
I had no special model for modelSpecial, so I left it empty and it worked.

But I've got a dumb question:
How do I code a bullet as a rocket or non explosive LGB?
Anyway, I hope if I poste the code of the Weapon and Ammo I've got so far, anyone could help me at least with my new question. So here it is:

Code: [Select]
[...]
class CfgAmmo
{

class Default{};
class BulletSingle:Default{};
class ExplosiveBullet:BulletSingle{};
class BulletSilencedSingle:BulletSingle{};

class AmrStdMuni:BulletSilencedSingle
{
hit=100;
indirectHit=50;
indirectHitRange=5;
minRange=1;
minRangeProbab=1;
midRange=1000;
midRangeProbab=1;
maxRange=4000;
maxRangeProbab=1;
maxSpeed=100000;
irLock=0;
laserLock=1;
manualControl=true;
maxControlRange=100000;
sideAirFriction=0.1;
maneuvrability=16.0;
initTime=0;
thrustTime=10.5;
thrust=100000;
cost=0.7;
explosive=0;
};

class AmrExpMuni:ExplosiveBullet
{
hit=500;
indirectHit=250;
indirectHitRange=2.5;
minRange=20;
minRangeProbab=1;
midRange=500;
midRangeProbab=1;
maxRange=2000;
maxRangeProbab=1;
maxSpeed=100000;
cost=1;
explosive=1;
irLock=0;
laserLock=1;
maxControlRange=100000;
maneuvrability=16.0;
sideAirFriction=0.1;
};
};
[...]
class CfgWeapons
{

class Default{};
class MGun : Default{};
class Riffle : MGun{};
class SniperRIffle : Riffle{};

class HkAmr2:SniperRiffle
{
scopeWeapon=2;
scopeMagazine=0;

model="\hkamr2\hkamr2.p3d";
modelSpecial="";
picture="\hkamr2\gunphoto.pac";

optics=1;
modelOptics="\hkamr2\visier.p3d";
opticsZoomMin=0.04;
opticsZoomMax=0.8;
distanceZoomMin=800;
distanceZoomMax=10;

ammo="AmrStdMuni";
count=10;
multiplier=1;
division=0;
burst=1;
initSpeed=870;
maxLeadSpeed=870;

soundContinuous=0;
reloadTime=1.7;
magazineReloadTime=2.5;
magazines[]={"AmrStd_MAG","AmrExp_MAG"};
recoil="riffleSilenced";
autoFire=0;
autoReload=0;

displayName="HK AMR2";
sound="\hkamr2\hk_singleshot";
drySound[]={"\sound\AK74dry",0.01,1};

ffCount=1;

aiRateOfFire=5.0;
aiRateOfFireDistance=800;
aiDispersionCoefX=0.000009;
aiDispersionCoefY=0.000007;
threat[]={1,0.5,0.1};
enableAttack=1;

useAction=0;
useActionTitle="";

canLock=1;
};

class AmrStd_MAG:HkAmr2
{
displayNameMagazine = "762NATO Muni";
shortNameMagazine = HKAMR2NATO_MAG;
picture="\hkamr2\gunphoto.pac";
scopeWeapon=0;
      scopeMagazine=2;
canlock=1;
};

class AmrExp_MAG:HkAmr2
{
displayNameMagazine = "Explosive Muni";
shortNameMagazine = HKAMR2EXP_MAG;
picture="\hkamr2\gunphoto.pac";
ammo="AmrExpMuni";
dispersion=0.0001;
scopeWeapon=0;
      scopeMagazine=2;
canLock=2;
};
};

So far,
Dave

Offline remcen

  • Contributing Member
  • **
  • a.k.a. hottentotten_mike
    • IM:UC
Re: 2 weapon problems
« Reply #3 on: 24 Jul 2006, 01:31:32 »
have you looked into the commented configs yet?
as a start i would simply copy the code of a zuni rocket and change the values.

something like this:

Quote
class cfgammo
{
class default {};
class at3: default {};
class hellfire: at3{};
class Zuni:Hellfire {};
class smallbullet: zuni
   {

                hit=15;
      indirectHit=2;
      indirectHitRange=0.1;
      minRange=1;
      minRangeProbab=0.1;
      midRange=200;
      midRangeProbab=0.8;
      maxRange=900;
      maxRangeProbab=0.05;

      cost=2;
      maxSpeed=0;
      simulation="shotbullet";
      simulationStep=0.05;
      cost=2000;
      soundHit[]={"Explosions\expl1",100.0000076,1};
      model="shell";             
      irLock=0;
      laserLock=1;
      maneuvrability=0.0;
      maxControlRange=0;
                explosive=0;
                cartridge="FxCartridge";

      initTime=0;
      thrustTime=1.5;
      thrust=210;
   };
};
i simply took the rocket57 config, and added the sniperbullet values for the hit stuff (top) and the trajectory stuff (bottom). plus some additions like explosive and laserlock. dunno if it works right, maybe you still get the smoketrail. if this doesn't work out right i would go for the scripted solution with invisible targets as suggested in the mapfact forum.

and as a hint: look into the default class in cfgammo, there you find all values your ammo can have
we're looking for members: IM:UC MOD