Author Topic: Laser Sights + Projectile  (Read 632 times)

I'm attempting to create a new weapon with Laser Sights.

Everyone knows that the Laser Sights is a RayCasting thing, I want to use it, but instead of it fires raycasts, it fires Projectiles.

Can someone help me? I've tried a lot of ways, and it's not working.

Look at the laser pointer.


It doesn't have a projectile.

I need something like:

Code: [Select]
AddDamageType("M16",   '<bitmap:add-ons/Weapon_Package_L4B/M16/CI_M16> %1',    '%2 <bitmap:add-ons/Weapon_Package_L4B/M16/CI_M16> %1',0.75,1);
datablock ProjectileData(M16Projectile1)
{
   projectileShapeName = "add-ons/Weapon_Gun/bullet.dts";
   directDamage        = ($BushidoL4DGuns::UsingRotZombies ? 25 : 31);
   directDamageType    = $DamageType::M16;
   radiusDamageType    = $DamageType::m16;

   brickExplosionRadius = 0;
   brickExplosionImpact = true;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 10;
   brickExplosionMaxVolume = 1;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloating = 2;  //max volume of bricks that we can destroy if they aren't connected to the ground

   impactImpulse      = 20;
   verticalImpulse     = 10;
   explosion           = gunExplosion;

   muzzleVelocity      = 120;
   velInheritFactor    = 1;

   armingDelay         = 0;
   lifetime            = 4000;
   fadeDelay           = 3500;
   bounceElasticity    = 0.5;
   bounceFriction      = 0.20;
   isBallistic         = true;
   gravityMod = 0;

   hasLight    = false;
   lightRadius = 3.0;
   lightColor  = "0 0 0.5";
};

Combined with

Code: [Select]
   raycastWeaponRange = 3000;
   raycastWeaponTargets =
                   $TypeMasks::PlayerObjectType |    //AI/Players
                   $TypeMasks::StaticObjectType |    //Static Shapes
                   $TypeMasks::TerrainObjectType |    //Terrain
                   $TypeMasks::VehicleObjectType |    //Terrain
                   $TypeMasks::FXBrickObjectType;    //Bricks
   raycastExplosionProjectile = LaserPointProjectileA;
   raycastExplosionBrickSound = "";
   raycastExplosionPlayerSound = "";
   raycastDirectDamage = 0.5;
   raycastDirectDamageType = $DamageType::EightEightyRifle;

But instead of firing the raycast, it should fire the projectile, and the raycast would stay as the LaserSights.

We need a Space Guy here!  :cookieMonster:

You aren't trying very hard... All you would do is edit the laser pointer, basically. Look again.

You aren't trying very hard... All you would do is edit the laser pointer, basically. Look again.
Fu.. :x Noticed it. Thank Amade.