i was looking for the old portal gun to merge with the new one to make the best one possible
i found this instead:
//fake portal gun
// made from 9MM.cs
//projectile
datablock ProjectileData(portalProjectile)
{
projectileShapeName = "~/data/shapes/blank.dts";
directDamage = 0;
radiusDamage = 0;
damageRadius = 1;
explosion = bulletExplosion;
// particleEmitter = bullet2TrailEmitter;
muzzleVelocity = 600;
velInheritFactor = 1;
scale = ".5 .5 .5";
armingDelay = 0;
lifetime = 8000;
fadeDelay = 7500;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = true;
gravityMod = 0;
hasLight = false;
lightRadius = 3.0;
lightColor = "0 0 0.5";
damagetype = '%1 got fragged by %2';
};
//////////
// item //
//////////
datablock ItemData(portalgun)
{
category = "Weapon"; // Mission editor category
className = "Tool"; // For inventory system
// Basic Item Properties
shapeFile = "~/data/shapes/l-portalgun.dts";
skinName = 'black';
rotate = true;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
// Dynamic properties defined by the scripts
pickUpName = 'a fake portal gun';
invName = "portalgun";
image = portalgunImage;
};
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(portalgunImage)
{
// Basic Item properties
shapeFile = "~/data/shapes/l-portalgun.dts";
skinName = 'black';
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 = ;
ammo = " ";
projectile = portalProjectile;
projectileType = Projectile;
//melee particles shoot from eye node for consistancy
melee = false;
//raise your arm up or not
armReady = true;
//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.5;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = portalgunChargeSound;
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Fire";
stateAllowImageChange[1] = true;
stateName[2] = "Fire";
stateTransitionOnTimeout[2] = "Reload";
stateTimeoutValue[2] = 0.001;
stateFire[2] = true;
stateAllowImageChange[2] = false;
stateSequence[2] = "Fire";
stateScript[2] = "onFire";
stateWaitForTimeout[2] = true;
stateSound[2] = redportalFireSound;
stateName[3] = "Reload";
stateSequence[3] = "Reload";
stateAllowImageChange[3] = false;
stateTimeoutValue[3] = 0.001;
stateScript[3] = "onPreFire";
stateWaitForTimeout[3] = true;
stateTransitionOnTimeout[3] = "Check";
stateName[4] = "Check";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "StopFire";
stateName[5] = "StopFire";
stateTransitionOnTimeout[5] = "Ready";
stateTimeoutValue[5] = 0.20;
stateAllowImageChange[5] = false;
stateWaitForTimeout[5] = true;
//stateSequence[5] = "Reload";
stateScript[5] = "onStopFire";
};
function portalgunImage::onPreFire(%this, %obj, %slot)
{
%obj.playthread(2, root);
}
function portalgunImage::onStopFire(%this, %obj, %slot)
{
%obj.playthread(2, jump);
}
function portalProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
tbmcollison(%this,%obj,%col,%fade,%pos,%normal);
tbmcollison(%this,%obj,%col,%fade,%pos,%normal);
tbmradiusDamage
(%obj, VectorAdd(%pos, VectorScale(%normal, 0.01)),
%this.damageRadius,%this.radiusDamage,%this.damageType,20);
}
datablock AudioProfile(redportalFireSound)
{
filename = "~/data/sound/PortalGun/portalgun_shoot_red1.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(portalgunChargeSound)
{
filename = "~/data/sound/PortalGun/portalgun_poerup1.wav";
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(blueportalFireSound)
{
filename = "~/data/sound/PortalGun/portalgun_shoot_blue1.wav";
description = AudioClose3d;
preload = true;
};