Author Topic: Invisible?  (Read 1656 times)

 Hi for some reason when i shoot my biorifle and my c-d weapons after like 2 secounds of seeing the projectile when i shoot they disaper but when i move up a couple of steps i can see the projectile agin anyone know whats wrong?

yea me too... it seems theres a range where you can see your projectile...

someone knows this... once i learn the solution.. i'll release my weapons...


EDIT: i made a temporary solution: i made a big invisible sphere around the projectile... Up close i can see it  and far too... But there's a bug: I tried spawning bots and let them fight each other... But.. the spheres appear in color white when your far... so far so... uhh... dunno
« Last Edit: April 17, 2008, 02:19:52 PM by jaydee0004 »

How can we help you without your code?

How can we help you without your code?

well.. here's mine:

Quote
//   XM72.cs
//    A powerful grenade launcher that can clear a room. (lol)
//    Model by: jaydee004 Scripting: jaydee0004
//   A 3.50 second delay and the damage is 75

//audio
datablock AudioProfile(XM72Shot1Sound)
{
   filename    = "./sound/rocketFire.wav";
   description = AudioClose3d;
   preload = true;
};
datablock AudioProfile(XM72ExplodeSound)
{
   filename    = "./sound/tntExplode.wav";
   description = AudioDefault3d;
   preload = true;
};

//muzzle flash effects
datablock ParticleData(XM72FlashParticle)
{
   dragCoefficient      = 3;
   gravityCoefficient   = -0.5;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 25;
   lifetimeVarianceMS   = 15;
   textureName          = "base/data/particles/star1";
   spinSpeed      = 10.0;
   spinRandomMin      = -500.0;
   spinRandomMax      = 500.0;
   colors[0]     = "0.9 0.9 0.0 0.9";
   colors[1]     = "0.9 0.5 0.0 0.0";
   sizes[0]      = 0.5;
   sizes[1]      = 1.0;

   useInvAlpha = false;
};
datablock ParticleEmitterData(XM72FlashEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 1.0;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "XM72FlashParticle";
};

datablock ParticleData(XM72SmokeParticle)
{
   dragCoefficient      = 3;
   gravityCoefficient   = -0.5;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 525;
   lifetimeVarianceMS   = 55;
   textureName          = "base/data/particles/cloud";
   spinSpeed      = 10.0;
   spinRandomMin      = -500.0;
   spinRandomMax      = 500.0;
   colors[0]     = "0.5 0.5 0.5 0.9";
   colors[1]     = "0.5 0.5 0.5 0.0";
   sizes[0]      = 0.15;
   sizes[1]      = 0.15;

   useInvAlpha = false;
};
datablock ParticleEmitterData(XM72SmokeEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 1.0;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "XM72SmokeParticle";
};


//bullet trail effects
datablock ParticleData(XM72TrailParticle)
{
   dragCoefficient      = 3;
   gravityCoefficient   = -0.0;
   inheritedVelFactor   = 0.15;
   constantAcceleration = 0.0;
   lifetimeMS           = 2500;
   lifetimeVarianceMS   = 805;
   textureName          = "base/data/particles/thinRing";
   spinSpeed      = 10.0;
   spinRandomMin      = -500.0;
   spinRandomMax      = 500.0;
   colors[0]     = "0.3 0.3 0.9 0.4";
   colors[1]     = "0.5 0.5 0.5 0.0";
   sizes[0]      = 0.15;
   sizes[1]      = 0.25;

   useInvAlpha = false;
};
datablock ParticleEmitterData(XM72TrailEmitter)
{
   ejectionPeriodMS = 3;
   periodVarianceMS = 0;
   ejectionVelocity = 0.0;
   velocityVariance = 0.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "XM72TrailParticle";
};


datablock ParticleData(XM72ExplosionParticle)
{
   dragCoefficient      = 8;
   gravityCoefficient   = -0.5;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 700;
   lifetimeVarianceMS   = 400;
   textureName          = "base/data/particles/cloud";
   spinSpeed      = 10.0;
   spinRandomMin      = -50.0;
   spinRandomMax      = 50.0;
   colors[0]     = "0.9 0.9 0.6 0.9";
   colors[1]     = "0.9 0.5 0.6 0.0";
   sizes[0]      = 15.0;
   sizes[1]      = 20.0;

   useInvAlpha = true;
};
datablock ParticleEmitterData(XM72ExplosionEmitter)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 5;
   velocityVariance = 1.0;
   ejectionOffset   = 0.0;
   thetaMin         = 89;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "XM72ExplosionParticle";
};


datablock ParticleData(XM72ExplosionRingParticle)
{
   dragCoefficient      = 8;
   gravityCoefficient   = -0.5;
   inheritedVelFactor   = 0.2;
   constantAcceleration = 0.0;
   lifetimeMS           = 300;
   lifetimeVarianceMS   = 100;
   textureName          = "base/data/particles/star1";
   spinSpeed      = 10.0;
   spinRandomMin      = -50.0;
   spinRandomMax      = 50.0;
   colors[0]     = "1 1 0.0 0.9";
   colors[1]     = "0.9 0.0 0.0 0.0";
   sizes[0]      = 0.5;
   sizes[1]      = 0.0;

   useInvAlpha = false;
};
datablock ParticleEmitterData(XM72ExplosionRingEmitter)
{
   lifeTimeMS = 150;

   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 5;
   velocityVariance = 0.0;
   ejectionOffset   = 0.0;
   thetaMin         = 89;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "XM72ExplosionRingParticle";
};

datablock ExplosionData(XM72Explosion)
{
   //explosionShape = "";
   explosionShape = "./shapes/explosionSphere1.dts";
   soundProfile = XM72ExplodeSound;

   lifeTimeMS = 150;

   particleEmitter = XM72ExplosionEmitter;
   particleDensity = 25;
   particleRadius = 5.2;

   emitter[0] = XM72ExplosionRingEmitter;

   faceViewer     = true;
   explosionScale = "2 2 2";

   shakeCamera = true;
   camShakeFreq = "10.0 11.0 10.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   // Dynamic light
   lightStartRadius = 0;
   lightEndRadius = 2;
   lightStartColor = "0.3 0.6 0.7";
   lightEndColor = "0 0 0";

   damageRadius = 10;
   radiusDamage = 150;

   impulseRadius = 15;
   impulseForce = 5500;
};


AddDamageType("XM72",   '<bitmap:add-ons/ci/gun> %1',    '%2 <bitmap:add-ons/ci/gun> %1',0.5,1);
datablock ProjectileData(XM72Projectile)
{
   projectileShapeName = "./shapes/testload.dts";
   directDamage        = 75;
   directDamageType = $DamageType::XM72Direct;
   radiusDamageType = $DamageType::XM72Radius;
   impactImpulse      = 2800;
   verticalImpulse      = 2800;
   explosion           = XM72Explosion;
   particleEmitter     = XM72TrailEmitter;

   brickExplosionRadius = 3;
   brickExplosionImpact = false;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 30;             
   brickExplosionMaxVolume = 30;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloati ng = 60;  //max volume of bricks that we can destroy if they aren't connected to the ground (should always be >= brickExplosionMaxVolume)

   sound = XM72LoopSound;

   muzzleVelocity      = 35;
   velInheritFactor    = 1.0;


   armingDelay         = 3000;                    //Time before the projectile Arms itself, i.e. explodes when it hits something.
                                                       //Set it to some number and it will wait for that amount of time before it can Explode.

   lifetime            = 4000;                     //Lifetime of the Projectile

   fadeDelay           = 3500;                  //Time before the projectile start's fading away

   bounceElasticity    = 0.99;                   //This determines how much of the projectile's Velocity is Kept when bouncing

   bounceFriction      = 0.00;                 //This will Substract from the bounceElasticity value,

   isBallistic         = true;                       //This part here, set it to True or else nothing will work.

   gravityMod = 1.0;                              //Gravity value

   hasLight    = false;
   lightRadius = 5.0;
   lightColor  = "1 0.5 0.0";

   explodeOnDeath = true;                 //YOU NEED TO ADD THIS. This will allow the projectile to explode once it's lifeTime runs out.
};

//////////
// item //
//////////
datablock ItemData(XM72Item)
{
   category = "Weapon";  // Mission editor category
   className = "Weapon"; // For inventory system

    // Basic Item Properties
   shapeFile = "./shapes/xm72glauncher.dts";
   rotate = false;
   mass = 1;
   density = 0.2;
   elasticity = 0.2;
   friction = 0.6;
   emap = true;

   //gui stuff
   uiName = "XM72 G-Launcher";
   iconName = "./ItemIcons/none";
   doColorShift = true;
   colorShiftColor = "0.25 0.25 0.25 1.000";

    // Dynamic properties defined by the scripts
   image = XM72Image;
   canDrop = true;
};

//function BowItem::onUse(%this, %player, %InvPosition)
//{
//   //check for quiver
//   //if you dont have it, regular bow
//   //if you do, super bow
//
//   %client = %player.client;
//
//   %mountPoint = %this.image.mountPoint;
//   %mountedImage = %player.getMountedImage(%mountPoint);
//
//
//   if(%mountedImage)
//   {
//      if(%mountedImage == bowImage.getId() || %mountedImage == superbowImage.getId())
//      {
//         //some kind of bow mounted so, unmount it
//         %player.unMountImage(%mountPoint);
//         messageClient(%client, 'MsgHilightInv', '', -1);
//         %player.currWeaponSlot = -1;
//      }
//      else
//      {
//         //something other than bow mounted, so do bow selection and mount
//         if(%player.getMountedImage($BackSlot))
//         {
//            if(%player.getMountedImage($BackSlot) == quiverImage.getId())
//            {
//               %player.mountimage(superBowImage, $RightHandSlot, 1, %skin);
//               messageClient(%client, 'MsgHilightInv', '', %InvPosition);
//               %player.currWeaponSlot = %invPosition;
//            }
//            else
//            {
//               %player.mountimage(bowImage, $RightHandSlot, 1, %skin);
//               messageClient(%client, 'MsgHilightInv', '', %InvPosition);
//               %player.currWeaponSlot = %invPosition;
//            }
//         }
//         else
//         {
//            %player.mountimage(bowImage, $RightHandSlot, 1, %skin);
//            messageClient(%client, 'MsgHilightInv', '', %InvPosition);
//            %player.currWeaponSlot = %invPosition;
//         }
//      }
//      
//   }
//   else
//   {
//      //nothing mounted so do bow selection and mount
//      //something other than bow mounted, so do bow selection and mount
//      if(%player.getMountedImage($BackSlot))
//      {
//         if(%player.getMountedImage($BackSlot) == quiverImage.getId())
//         {
//            %player.mountimage(superBowImage, $RightHandSlot, 1, %skin);
//            messageClient(%client, 'MsgHilightInv', '', %InvPosition);
//            %player.currWeaponSlot = %invPosition;
//         }
//         else
//         {
//            %player.mountimage(bowImage, $RightHandSlot, 1, %skin);
//            messageClient(%client, 'MsgHilightInv', '', %InvPosition);
//            %player.currWeaponSlot = %invPosition;
//         }
//      }
//      else
//      {
//         %player.mountimage(bowImage, $RightHandSlot, 1, %skin);
//         messageClient(%client, 'MsgHilightInv', '', %InvPosition);
//         %player.currWeaponSlot = %invPosition;
//      }
//   }
//}

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(XM72Image)
{
   // Basic Item properties
   shapeFile = "./shapes/xm72glauncher.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = 0; //"0.7 1.2 -0.5";
   rotation = eulerToMatrix( "0 0 0" );

   // When firing from a point offset from the eye, muzzle correction
   // will adjust the muzzle vector to point to the eye LOS point.
   // Since this weapon doesn't actually fire from the muzzle point,
   // we need to turn this off. 
   correctMuzzleVector = true;

   // Add the WeaponImage namespace as a parent, WeaponImage namespace
   // provides some hooks into the inventory system.
   className = "WeaponImage";

   // Projectile && Ammo.
   item = BowItem;
   ammo = " ";
   projectile = XM72Projectile;
   projectileType = Projectile;

   casing = XM72ShellDebris;
   shellExitDir        = "1.0 -1.3 1.0";
   shellExitOffset     = "0 0 0";
   shellExitVariance   = 15.0;   
   shellVelocity       = 7.0;

   //melee particles shoot from eye node for consistancy
   melee = false;
   //raise your arm up or not
   armReady = true;

   doColorShift = true;
   colorShiftColor = XM72Item.colorShiftColor;//"0.400 0.196 0 1.000";

   //casing = " ";

   // Images have a state system which controls how the animations
   // are run, which sounds are played, script callbacks, etc. This
   // state system is downloaded to the client so that clients can
   // predict state changes and animate accordingly.  The following
   // system supports basic ready->fire->reload transitions as
   // well as a no-ammo->dryfire idle state.

   // Initial start up state
   stateName[0]                     = "Activate";
   stateTimeoutValue[0]             = 0.15;
   stateTransitionOnTimeout[0]       = "Ready";
   stateSound[0]               = weaponSwitchSound;

   stateName[1]                     = "Ready";
   stateTransitionOnTriggerDown[1]  = "Fire";
   stateAllowImageChange[1]         = true;
   stateSequence[1]   = "Ready";

   stateName[2]                    = "Fire";
   stateTransitionOnTimeout[2]     = "Smoke";
   stateTimeoutValue[2]            = 0.14;
   stateFire[2]                    = true;
   stateAllowImageChange[2]        = false;
   stateSequence[2]                = "Fire";
   stateScript[2]                  = "onFire";
   stateWaitForTimeout[2]         = true;
   stateEmitter[2]               = XM72FlashEmitter;
   stateEmitterTime[2]            = 0.05;
   stateEmitterNode[2]            = "muzzleNode";
   stateSound[2]               = XM72Shot1Sound;
   stateEjectShell[2]       = true;

   stateName[3] = "Smoke";
   stateEmitter[3]               = XM72SmokeEmitter;
   stateEmitterTime[3]            = 2.75;
   stateEmitterNode[3]            = "muzzleNode";
   stateTimeoutValue[3]            = 3.50;
   stateTransitionOnTimeout[3]     = "Reload";

   stateName[4]         = "Reload";
   stateSequence[4]                = "Reload";
   stateTransitionOnTriggerUp[4]     = "Ready";
   stateSequence[4]   = "Ready";

};

function XM72Image::onFire(%this,%obj,%slot)
{
   if(%obj.getDamagePercent() < 1.0)
      %obj.playThread(2, shiftAway);
   Parent::onFire(%this,%obj,%slot);   
}




youd didn't need to post the whole thing.

youd didn't need to post the whole thing.

nvm i solved the problem myself though... just do the sphere thing and make it transparent (its the right slider on materials) and assign a texture that is included in BL named blank.png

Make sure it goes invisible

Set its LOD to 0 and assign a new material to it and change the detail to 0, both of those options are on the Torque DTS Plus exporter, on the EDIT buttons on the materials and groups....

Then export it... im sure the white sphere would'nt appear anymore