Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- datablock AudioProfile(R101CEquipSound)
- {
- filename = "./sound/R101CEquip.wav";
- description = AudioClose3d;
- preload = true;
- };
- datablock AudioProfile(R101CFire1Sound)
- {
- filename = "./sound/R101CFire1.wav";
- description = AudioClose3d;
- preload = true;
- };
- datablock AudioProfile(R101CFire2Sound)
- {
- filename = "./sound/R101CFire2.wav";
- description = AudioClose3d;
- preload = true;
- };
- datablock AudioProfile(R101CFire3Sound)
- {
- filename = "./sound/R101CFire3.wav";
- description = AudioClose3d;
- preload = true;
- };
- datablock AudioProfile(R101CBoltSound)
- {
- filename = "./sound/R101CBolt.wav";
- description = AudioClose3d;
- preload = true;
- };
- datablock AudioProfile(R101CInSound)
- {
- filename = "./sound/R101CIn.wav";
- description = AudioClose3d;
- preload = true;
- };
- datablock AudioProfile(R101COutSound)
- {
- filename = "./sound/R101COut.wav";
- description = AudioClose3d;
- preload = true;
- };
- // particles
- datablock ParticleData(R101CFireParticle)
- {
- dragCoefficient = 0;
- gravityCoefficient = 0;
- inheritedVelFactor = 0;
- constantAcceleration = 0.0;
- lifetimeMS = 50;
- lifetimeVarianceMS = 0;
- textureName = "./materials/flash0";
- spinSpeed = 9000.0;
- spinRandomMin = -5000.0;
- spinRandomMax = 5000.0;
- colors[0] = "1.0 0.5 0 0.9";
- colors[1] = "0.9 0.4 0 0.8";
- colors[2] = "1 0.5 0.2 0.6";
- colors[3] = "1 0.5 0.2 0.4";
- sizes[0] = 1.75;
- sizes[1] = 0.4;
- sizes[2] = 0.10;
- sizes[3] = 0.0;
- times[0] = 0.0;
- times[1] = 0.1;
- times[2] = 0.5;
- times[3] = 1.0;
- useInvAlpha = false;
- };
- datablock ParticleEmitterData(R101CFireEmitter)
- {
- ejectionPeriodMS = 1;
- periodVarianceMS = 0;
- ejectionVelocity = 64.0;
- velocityVariance = 0.0;
- ejectionOffset = 0.0;
- thetaMin = 0;
- thetaMax = 1;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "R101CFireParticle";
- };
- datablock ParticleData(R101CSmokeParticle)
- {
- dragCoefficient = 3;
- gravityCoefficient = 0;
- inheritedVelFactor = 0;
- constantAcceleration = 0.0;
- lifetimeMS = 100;
- lifetimeVarianceMS = 0;
- textureName = "./materials/smoke1";
- spinSpeed = 9000.0;
- spinRandomMin = -5000.0;
- spinRandomMax = 5000.0;
- colors[0] = "0.6 0.6 0.6 0.0";
- colors[1] = "0.7 0.7 0.7 0.3";
- colors[2] = "1 1 1 0.2";
- colors[3] = "1 1 1 0";
- sizes[0] = 0.0;
- sizes[1] = 0.4;
- sizes[2] = 0.10;
- sizes[3] = 0.05;
- times[0] = 0.0;
- times[1] = 0.1;
- times[2] = 0.5;
- times[3] = 1.0;
- useInvAlpha = false;
- };
- datablock ParticleEmitterData(R101CSmokeEmitter)
- {
- ejectionPeriodMS = 1;
- periodVarianceMS = 0;
- ejectionVelocity = 32.0;
- velocityVariance = 0.0;
- ejectionOffset = 0.0;
- thetaMin = 0;
- thetaMax = 1;
- phiReferenceVel = 0;
- phiVariance = 360;
- overrideAdvance = false;
- particles = "R101CSmokeParticle";
- };
- datablock ParticleData(R101CTrailParticle)
- {
- dragCoefficient = 3.0;
- windCoefficient = 0.0;
- gravityCoefficient = 0.0;
- inheritedVelFactor = 0.0;
- constantAcceleration = 0.0;
- lifetimeMS = 200;
- lifetimeVarianceMS = 20;
- spinSpeed = 10.0;
- spinRandomMin = -50.0;
- spinRandomMax = 50.0;
- useInvAlpha = false;
- animateTexture = false;
- //framesPerSec = 1;
- textureName = "./materials/smoke1";
- //animTexName = "~/data/particles/dot";
- // Interpolation variables
- colors[0] = "1 1 0 0.5";
- colors[1] = "1 1 0.4 1.0";
- colors[2] = "0.7 0.7 0.7 0";
- sizes[0] = 0.3;
- sizes[1] = 0.15;
- sizes[2] = 0.0;
- times[0] = 0.0;
- times[1] = 0.1;
- times[2] = 1.0;
- };
- datablock ParticleEmitterData(R101CTrailEmitter)
- {
- ejectionPeriodMS = 1;
- periodVarianceMS = 0;
- ejectionVelocity = 0; //0.25;
- velocityVariance = 0; //0.10;
- ejectionOffset = 0;
- thetaMin = 0.0;
- thetaMax = 90.0;
- particles = R101CTrailParticle;
- };
- datablock ProjectileData(R101CTrailProjectile)
- {
- directDamage = 0;
- directDamageType = $DamageType::Gun;
- radiusDamageType = $DamageType::Gun;
- 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 = 100;
- verticalImpulse = 50;
- //explosion = gunExplosion;
- particleEmitter = "R101CTrailEmitter";
- muzzleVelocity = 200;
- velInheritFactor = 0;
- armingDelay = 0;
- lifetime = 1000;
- fadeDelay = 700;
- bounceElasticity = 0.5;
- bounceFriction = 0.10;
- isBallistic = true;
- gravityMod = 0.0;
- hasLight = false;
- lightRadius = 3.0;
- lightColor = "0 0 0.5";
- };
- // Kill Stuff
- AddDamageType("R101C", '<bitmap:add-ons/Weapon_Package_Titanfall/materials/CI_R101C> %1', '%2 <bitmap:add-ons/Weapon_Package_Titanfall/materials/CI_R101C> %1',0.75,1);
- // Item Data
- datablock ItemData(R101CItem)
- {
- category = "Weapon"; // Mission editor category
- className = "Weapon"; // For inventory system
- // R101C Item Properties
- shapeFile = "./models/r101c.dts";
- rotate = false;
- mass = 1;
- density = 0.2;
- elasticity = 0.2;
- friction = 0.6;
- emap = true;
- //gui stuff
- uiName = "R-101C Carbine";
- iconName = "./materials/Icon_R101C";
- doColorShift = true;
- colorShiftColor = "0.935 0.916 0.846 1";
- // Dynamic properties defined by the scripts
- image = R101CImage;
- canDrop = true;
- RYG_Reloads = 1; // This weapon can reload!
- RYG_ClipSize = 24; // Max clip size for this weapon.
- // Weapon description for guis or w/e.
- RYG_Description = "The R-101C is a fully automatic, compact assault weapon commonly used throughout the Frontier. ";
- };
- // Weapon Image
- datablock ShapeBaseImageData(R101CImage)
- {
- // R101C Image properties
- shapeFile = "./models/r101c.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 = R101CItem;
- ammo = " ";
- projectile = gunProjectile;
- projectileType = Projectile;
- casing = GunShellDebris;
- shellExitDir = "1.0 0.1 1.0";
- shellExitOffset = "0 0 0";
- shellExitVariance = 10.0;
- shellVelocity = 5.0;
- //melee particles shoot from eye node for consistancy
- melee = false;
- //raise your arm up or not
- armReady = true;
- doColorShift = true;
- colorShiftColor = R101CItem.colorShiftColor;
- // Rykuta's stuffings.
- RYG_Support = 1;
- RYG_Accuracy = 0.0001; // First bullet's accuracy.
- RYG_RecoilAdd = 0.0002; // Amount of spread added per shot under time.
- RYG_RecoilSub = 0.0005; // Amount of spread reduced when gun has stopped spam firing.
- RYG_RecoilTick = 300; // Delay between each shot required for the recoil to be reduced.
- RYG_MovementPer = 150; // Percent of recoil generated due to movement.
- RYG_MaxRecoil = 0.005; // Maximum recoil can reach.
- RYG_Oversight = 0.0051; // Animation becomes more aggressive after this recoil is reached.
- RYG_MaxDmg = 25; // Max damage at optimum Range.
- RYG_MinDmg = 20; // Min damage at worst range.
- RYG_FalloffMax = 140; // Range when bullet is at lowest damage. (In TorqueUnits)
- RYG_FalloffMin = 90; // Range before bullet starts to lose damage. (In TorqueUnits)
- RYG_Headshot = 1.4; // Multiplier for head damage.
- RYG_Bipod = 0; // Gives the weapon the ability to utilize a bipod.
- RYG_BoltSound = R101CBoltSound; // Sound name for bolt pull.
- RYG_ClipInSound = R101CInSound; // Clip In Sound Name.
- RYG_ClipOutSound = R101COutSound; // Clip Out Sound Name.
- // 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 Gun ready->fire->reload transitions as
- // well as a no-ammo->dryfire idle state.
- raycastWeaponRange = 200; //varies
- raycastWeaponTargets =
- $TypeMasks::PlayerObjectType | //AI/Players
- $TypeMasks::StaticObjectType | //Static Shapes
- $TypeMasks::TerrainObjectType | //Terrain
- $TypeMasks::VehicleObjectType | //Terrain
- $TypeMasks::FXBrickObjectType; //Bricks
- raycastExplosionProjectile = GunProjectile;
- raycastExplosionBrickSound = bulletHitSound;
- raycastExplosionPlayerSound = bulletHitSound;
- raycastDirectDamage = 2;
- raycastDirectDamageType = $DamageType::R101C;
- raycastSpreadAmt = 0.001; //varies
- raycastSpreadCount = 1;
- raycastTracerProjectile = R101CTrailProjectile;
- raycastFromMuzzle = true;
- raycastImpactImulse = 10;
- // Main gun functionality - - - - - - - - - - - - - - - - - - - - - - - - - - -
- stateName[0] = "Activate";
- stateTimeoutValue[0] = 1.0;
- stateTransitionOnTimeout[0] = "LoadCheckA";
- StateSequence[0] = "use";
- StateSound[0] = "R101CEquipSound";
- StateScript[0] = "onMount";
- stateName[1] = "Ready";
- stateTransitionOnNoAmmo[1] = "Reload";
- stateTransitionOnTriggerDown[1] = "Fire";
- stateAllowImageChange[1] = true;
- stateScript[1] = "onReady";
- stateName[2] = "Fire";
- stateTransitionOnTimeout[2] = "Smoke";
- stateTimeoutValue[2] = 0.08;
- stateFire[2] = true;
- stateAllowImageChange[2] = false;
- stateSequence[2] = "fire";
- stateScript[2] = "onFire";
- stateEjectShell[2] = true;
- stateEmitter[2] = R101CFireEmitter;
- stateEmitterTime[2] = 0.05;
- stateEmitterNode[2] = "muzzleNode";
- stateWaitForTimeout[2] = true;
- StateSequence[2] = "fire";
- stateName[3] = "Smoke";
- stateEmitter[3] = R101CSmokeEmitter;
- stateEmitterTime[3] = 0.3;
- stateEmitterNode[3] = "muzzleNode";
- stateTimeoutValue[3] = 0.01;
- stateTransitionOnTimeout[3] = "LoadCheckA";
- // Reload checks - - - - - - - - - - - - - - - - - - - - - - - - - - -
- stateName[6] = "LoadCheckA";
- stateScript[6] = "onLoadCheck";
- stateTimeoutValue[6] = 0.01;
- stateTransitionOnTimeout[6] = "LoadCheckB";
- stateName[7] = "LoadCheckB";
- stateTransitionOnAmmo[7] = "Ready";
- stateTransitionOnNoAmmo[7] = "NoRoundsLeftA";
- // No Rounds Left States - - - - - - - - - - - - - - - - - - - - - - - -
- stateName[9] = "NoRoundsLeftA";
- stateScript[9] = "NoRoundsLeft";
- stateTimeoutValue[9] = 0.01;
- stateTransitionOnTimeout[9] = "NoRoundsLeftB";
- stateName[10] = "NoRoundsLeftB";
- stateTimeoutValue[10] = 0.01;
- stateTransitionOnNoAmmo[10] = "ReloadFull";
- stateTransitionOnTriggerDown[10] = "NoRoundsLeftC";
- stateName[11] = "NoRoundsLeftC";
- stateScript[11] = "BlankFire";
- stateTimeoutValue[11] = 0.01;
- stateTransitionOnTriggerUp[11] = "NoRoundsLeftB";
- // Reloads - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- // Regular Reload
- stateName[12] = "Reload";
- stateScript[12] = "OnClipRemoved";
- stateTimeoutValue[12] = 1.1;
- stateTransitionOnTimeout[12] = "InsertClipA";
- stateWaitForTimeout[12] = true;
- StateSequence[12] = "reload";
- stateName[13] = "InsertClipA";
- stateScript[13] = "OnClipInserted";
- stateTimeoutValue[13] = 1.1;
- stateTransitionOnTimeout[13] = "ReloadFinish";
- stateWaitForTimeout[13] = true;
- // Full Reload
- stateName[14] = "ReloadFull";
- stateScript[14] = "OnClipRemoved";
- stateTimeoutValue[14] = 1.1;
- stateTransitionOnTimeout[14] = "InsertClipB";
- stateWaitForTimeout[14] = true;
- stateName[15] = "InsertClipB";
- stateScript[15] = "OnClipInserted";
- stateTimeoutValue[15] = 1.1;
- stateTransitionOnTimeout[15] = "GunBolt";
- stateWaitForTimeout[15] = true;
- stateName[16] = "GunBolt";
- stateScript[16] = "onGunBolt";
- stateTimeoutValue[16] = 0.7;
- stateTransitionOnTimeout[16] = "ReloadFinish";
- stateWaitForTimeout[16] = true;
- // Finish reloading
- stateName[17] = "ReloadFinish";
- stateScript[17] = "OnGunReloadFinished";
- stateTimeoutValue[17] = 0.01;
- stateTransitionOnTimeout[17] = "Ready";
- stateWaitForTimeout[17] = true;
- };
- function R101CImage::onFire(%this,%obj,%slot)
- {
- %num = getRandom(1, 3);
- serverPlay3D( R101CFire @ %num @ Sound, %obj.getHackPosition() SPC "0 0 1 0");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement