Author Topic: Making a weapon so you cant put it away  (Read 437 times)

So like you cant put it away it.
Need help on where to put it.
Its a gun
here is the server.cs
Code: [Select]
//lasergunvest.cs
datablock AudioProfile(lasergunvestFireSound)
{
   filename = "./lazshot.wav";
   description = AudioClosest3d;
   preload = true;
};
datablock AudioProfile(lasergunvestHitSound)
{
   filename    = "./lazhit.wav";
   description = AudioClose3d;
   preload = true;
};

//effects
datablock ParticleData(lasergunvestTrailParticle)
{
 gravityCoefficient   = 0;
dragCoefficient = 0;
windCoefficient = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 300;
lifetimeVarianceMS = 0;
spinSpeed = 0.0;
spinRandomMin = 0.0;
spinRandomMax = 0.0;
useInvAlpha = false;
animateTexture = false;
textureName = "base/data/particles/dot";

//Interpolation variables
colors[0] = "1 0 0 0.5";
colors[1] = "1 0 0 0.6";
colors[2] = "1 0 0 0.3";
sizes[0] = 0.7;
sizes[1] = 0.7;
sizes[2] = 0.0;
times[0] = 0.0;
times[1] = 0.1;
times[2] = 1.0;
};

datablock ParticleEmitterData(lasergunvestTrailEmitter)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 1;
   ejectionVelocity = 1;
   ejectionOffset   = 0.4;
   velocityVariance = 1;
   thetaMin         = 0;
   thetaMax         = 30;
   phiReferenceVel  = 42000;
   phiVariance      = 0;
   overrideAdvance = false;
   particles = "lasergunvestTrailParticle";
   uiName = "lasergunvestTrail";

};

datablock ParticleData(lasergunvestExplosionParticle)
{
dragCoefficient = 5;
windCoefficient = 0.0;
gravityCoefficient = 0;
inheritedVelFactor = 0;
constantAcceleration = 10.0;
lifetimeMS = 600;
lifetimeVarianceMS = 0;
spinSpeed = 0.0;
spinRandomMin = 0.0;
spinRandomMax = 0.0;
useInvAlpha = false;
animateTexture = false;

textureName = "base/data/particles/dot";
//Interpolation variables
colors[0] = "225 0 0 0.5";
colors[1] = "255 0 0 0.6";
colors[2] = "255 0 0 0.3";

sizes[0] = 1;
sizes[1] = 1;
sizes[2] = 0.00;
times[0] = 0.0;
times[1] = 0.1;
times[2] = 1.0;
};

datablock ParticleEmitterData(lasergunvestExplosionEmitter)
{
   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   lifetimeMS       = 7;
   ejectionVelocity = 1;
   velocityVariance = 5.0;
   ejectionOffset   = 0.0;
   thetaMin         = 0;
   thetaMax         = 90;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;
   particles = "lasergunvestExplosionParticle";

   useEmitterColors = true;
   uiName = "lasergunvestExplode";
};

datablock ExplosionData(lasergunvestExplosion)
{
   //explosionShape = "";
   soundProfile = lasergunvestHitSound;

lifeTimeMS = 150;

soundProfile = lasergunvestExplodeSound;
   emitter[0] = lasergunvestExplosionEmitter;
   particleDensity = 1000;
   particleRadius = 1.0;

   faceViewer     = true;
   explosionScale = "1 1 1";

   shakeCamera = true;
   camShakeFreq = "7.0 8.0 7.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.0;
   camShakeRadius = 0.0;

   // Dynamic light
   lightStartRadius = 5;
   lightEndRadius = 1;
   lightStartColor = "1 0 0.0";
   lightEndColor = "0 0 0";

   //impulse
   impulseRadius = 3.5;
   impulseForce = 500;

   //radius damage
   radiusDamage        = 1;
   damageRadius        = 0.5;
};


datablock ProjectileData(lasergunvestProjectile)
{
   projectileShapeName ="base/data/shapes/empty.dts";
   directDamage        = 15;
 //  directDamageType  = $DamageType::lasergunvestDirect;
   impactImpulse   = 10;
   verticalImpulse   = 10;
   explosion           = lasergunvestExplosion;
   particleEmitter     = lasergunvestTrailEmitter;

   brickExplosionRadius = 0.1;
   brickExplosionImpact = false; //destroy a brick if we hit it directly?
   brickExplosionForce  = 0.1;
   brickExplosionMaxVolume = 20;
   brickExplosionMaxVolumeFloating = 20;

   muzzleVelocity      = 90;
   velInheritFactor    = 1;

   armingDelay         = 0;
   lifetime            = 5000;
   fadeDelay           = 4750;
   bounceElasticity    = 0;
   bounceFriction      = 0;
   isBallistic         = true;
   gravityMod = 0;

   hasLight    = true;
   lightRadius = 3.0;
   lightColor  = "1 1 0";

   uiName = "lasergunvest Projectile";
};


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

// Basic Item Properties
shapeFile = "./lasgunvest.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "Laser Gun Vest";
doColorShift = true;
colorShiftColor = "1 1 0 1";

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



////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(lasergunvestImage)
{
   // Basic Item properties
 shapeFile = "./lasgunvest.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.1 0.2 -0.55";



   // 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 = lasergunvestItem;
   ammo = " ";
   projectile = lasergunvestProjectile;
   projectileType = Projectile;

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

   //casing = " ";
   doColorShift = true;
   colorShiftColor = "1 1 0 1";

   // Initial start up state
stateName[0]                    = "Activate";
stateTimeoutValue[0]            = 0.1;
stateTransitionOnTimeout[0]     = "Ready";
stateAllowImageChange[0] = true;

stateName[1]                     = "Ready";
stateSequence[1]                = "Fire";

stateTransitionOnTriggerDown[1]  = "Fire";
stateAllowImageChange[1]         = true;
stateEmitter[1]                = lasergunvestAmbientEmitter;
stateEmitterNode[1]                = MuzzlePoint;
stateEmitterTime[1]            = 300;




stateName[2]                    = "Fire";
stateTransitionOnTimeout[2]     = "StopFire";
stateSequence[2]                = "PreFire";
stateTimeoutValue[2]            = 0.3;

stateFire[2]                    = true;
stateAllowImageChange[2]        = true;
stateScript[2]                  = "onFire";
stateWaitForTimeout[2] = true;
stateSound[2] = lasergunvestFireSound;



stateName[3]                    = "StopFire";
stateTransitionOnTimeout[3]     = "Ready";
stateTimeoutValue[3]            = 3;
stateAllowImageChange[3]        = true;
stateWaitForTimeout[3] = true;
stateSequence[3]                = "Prefire";
stateScript[3]                  = "onStopFire";



};


function lasergunvestImage::onFire(%this, %obj, %slot)
{
%obj.playthread(2, plant);
Parent::onFire(%this, %obj, %slot);

}

function lasergunvestImage::onStopFire(%this, %obj, %slot)
{
%obj.playthread(2, root);
}

function lasergunvestprojectile::Damage(%this,%obj,%col,%fade,%pos,%normal)
{
   if(%col.getType() & $TypeMasks::PlayerObjectType)
        tumble(%col,10000);
}

Uhh why would you


People will complain about how you can't dismount

Uhh why would you


People will complain about how you can't dismount
he asked about it, not for opinions about it.

In all the states
stateAllowImageChange[statenum] = false;

and pakage servercmdunusetool so it does nothing if they have the weapon out