106
Suggestions & Requests / Model for Syringe gun?
« on: September 01, 2010, 11:50:15 AM »
Does anyone have a model for a Syringe gun?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
AddDamageType("TF2Minigun", '<bitmap:add-ons/Weapon_TF2Minigun/CI_Minigun> %1', '%2 <bitmap:add-ons/Weapon_TF2Minigun/CI_Minigun> %1',0.5,1);
datablock DecalData(TF2MinigunCI)
{
textureName = "./CI_Minigun";
};
datablock DecalData(TF2minigunIcon)
{
textureName = "./icon_TF2minigun";
};
datablock AudioProfile(TF2MinigunFireLoopSound)
{
filename = "./TF2MinigunFireLoop.wav";
description = AudioClosestLooping3d;
preload = true;
};
datablock AudioProfile(TF2MinigunFireSound)
{
filename = "./TF2MinigunFire.wav";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(TF2MinigunSpinLoopSound)
{
filename = "./TF2MinigunSpinLoop.wav";
description = AudioClosestLooping3d;
preload = true;
};
datablock AudioProfile(TF2MinigunSpinupSound)
{
filename = "./TF2MinigunSpinup.wav";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(TF2MinigunSpindownSound)
{
filename = "./TF2MinigunSpindown.wav";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(TF2MinigunRicSound)
{
filename = "./TF2MinigunRic.wav";
description = AudioClosest3d;
preload = true;
};
datablock ParticleData(TF2MinigunFlashParticle)
{
dragCoefficient = 0;
gravityCoefficient = 0;
inheritedVelFactor = 1;
constantAcceleration = 0;
lifetimeMS = 30;
lifetimeVarianceMS = 0;
//textureName = "./muzzle";
textureName = "base/data/particles/cloud";
spinSpeed = 10;
spinRandomMin = -500;
spinRandomMax = 500;
colors[0] = "1 1 0.5 0.5";
colors[1] = "1 0.5 0 0.5";
colors[2] = "1 0 0 0.5";
sizes[0] = 0.9;
sizes[1] = 0;
sizes[2] = 0;
useInvAlpha = false;
};
datablock ParticleEmitterData(TF2MinigunFlashEmitter)
{
ejectionPeriodMS = 3;
periodVarianceMS = 0;
ejectionVelocity = 50;
velocityVariance = 0;
ejectionOffset = 0;
thetaMin = 0;
thetaMax = 1;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "TF2MinigunFlashParticle";
uiName = "TF2 Minigun Flash";
};
datablock ParticleData(TF2MinigunSmokeParticle)
{
dragCoefficient = 4;
gravityCoefficient = -1.0;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
lifetimeMS = 425;
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.7";
colors[1] = "0.5 0.5 0.5 0.0";
sizes[0] = 0.05;
sizes[1] = 0.25;
useInvAlpha = false;
};
datablock ParticleEmitterData(TF2MinigunSmokeEmitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 0;
ejectionVelocity = 1.0;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 90;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "TF2MinigunSmokeParticle";
};
//////////
// item //
//////////
datablock ItemData(TF2MinigunItem)
{
category = "Weapon"; // Mission editor category
className = "Weapon"; // For inventory system
// Basic Item Properties
shapeFile = "./Minigun.dts";
rotate = false;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
//gui stuff
uiName = "TF2 Minigun";
iconName = "./icon_TF2Minigun";
doColorShift = true;
colorShiftColor = "0.1 0.1 0.1 1.000";
// Dynamic properties defined by the scripts
image = TF2MinigunIdleImage;
canDrop = true;
};
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(TF2MinigunIdleImage)
{
// Basic Item properties
shapeFile = "./Minigun.dts";
emap = true;
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 0;
offset = "0 -0.1 -0.5";
eyeOffset = "0.30 1 -0.5";
rotation = eulerToMatrix( "75 0 0" );
eyerotation = eulerToMatrix( "75 50 -25" );
// 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 = TF2MinigunProjectile;
projectileType = Projectile;
casing = GunShellDebris;
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 = TF2MinigunItem.colorShiftColor;//"0.1 0.1 0.1 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";
stateSequence[0] = "root";
stateSound[0] = weaponSwitchSound;
stateScript[0] = "onActivate";
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Spinup";
stateSequence[1] = "root";
stateAllowImageChange[1] = true;
stateTransitionOnNoAmmo[1] = "Spinup";
stateName[2] = "Spinup";
stateScript[2] = "onSpinup";
stateAllowImageChange[2] = false;
stateTransitionOnTimeout[2] = "Fire";
stateTimeoutValue[2] = 0.67;
stateSequence[2] = "Spin";
stateName[3] = "Fire";
stateScript[3] = "onFire";
};
function TF2MinigunIdleImage::onUnMount(%this,%obj,%slot)
{
parent::OnUnMount(%this,%obj,%slot);
%obj.stopAudio(2);
%obj.stopAudio(3);
schedule(10,0,TF2MinigunUnMount,%obj);
}
function TF2MinigunIdleImage::onActivate(%this,%obj,%slot)
{
%obj.setImageAmmo(0, 1);
%obj.TF2MinigunTriggerdown = 0;
}
function TF2MinigunIdleImage::onFire(%this,%obj,%slot)
{
%obj.mountimage(TF2MinigunSpinupimage,0);
}
function TF2MinigunIdleImage::onSpinup(%this,%obj,%slot)
{
%obj.playAudio(2,TF2MinigunSpinupSound);
}
package TF2MinigunAltFire
{
function Armor::onTrigger(%this, %obj, %slot, %val)
{
if(%obj.getMountedImage(0) $= TF2MinigunIdleImage.getID() && %slot $= 4 && %val == 1)
{
%obj.TF2MinigunTriggerdown = 1;
//%obj.setImageAmmo(0, 0);
schedule(10,0,TF2MinigunTriggerDown,%obj);
}
if(%obj.getMountedImage(0) $= TF2MinigunIdleImage.getID() && %slot $= 4 && %val == 0)
{
%obj.TF2MinigunTriggerdown = 0;
%obj.setImageAmmo(0, 1);
}
if(%obj.getMountedImage(0) $= TF2MinigunImage.getID() && %slot $= 4 && %val == 1)
{
%obj.TF2MinigunTriggerdown = 1;
//%obj.setImageAmmo(0, 0);
schedule(10,0,TF2MinigunTriggerDown,%obj);
}
if(%obj.getMountedImage(0) $= TF2MinigunImage.getID() && %slot $= 4 && %val == 0)
{
%obj.TF2MinigunTriggerdown = 0;
%obj.setImageAmmo(0, 1);
}
Parent::onTrigger(%this, %obj, %slot, %val);
}
};
activatePackage(TF2MinigunAltFire);
function TF2MinigunTriggerDown(%obj)
{
if(%obj.TF2MinigunTriggerDown == 1)
{
%obj.setImageAmmo(0, 0);
schedule(10,0,TF2MinigunTriggerDown,%obj);
%obj.playthread(2, plant);
}
if(%obj.TF2MinigunTriggerDown == 0)
{
%obj.setImageAmmo(0, 1);
}
}
function TF2MinigunUnMount(%obj)
{
if(isobject(%obj.getmountedimage(0)) && (%obj.getmountedimage(0).getname() !$= "TF2MinigunSpinupImage" && %obj.getmountedimage(0).getname() !$= "TF2MinigunSpindownImage" && %obj.getmountedimage(0).getname() !$= "TF2MinigunImage"))
{
%obj.TF2MinigunTriggerdown = 0;
}
}
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(TF2MinigunSpinupImage)
{
// Basic Item properties
shapeFile = "./Minigun.dts";
emap = true;
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 0;
offset = "0 -0.05 -0.25";
eyeOffset = "0.30 0.75 -0.5";
rotation = eulerToMatrix( "37.5 0 0" );
eyerotation = eulerToMatrix( "38.5 25 -11" );
doColorShift = true;
colorShiftColor = TF2MinigunItem.colorShiftColor;//"0.1 0.1 0.1 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";
stateSequence[0] = "spin";
stateTimeoutValue[0] = 0.2;
stateTransitionOnTimeout[0] = "Ready";
stateAllowImageChange[0] = false;
stateName[1] = "Ready";
stateSequence[1] = "spin";
statescript[1] = "OnReady";
};
function TF2MinigunSpinupImage::onReady(%this,%obj,%slot)
{
%obj.mountimage(TF2Minigunimage,0);
}
function TF2MinigunSpinupImage::onUnMount(%this,%obj,%slot)
{
parent::OnUnMount(%this,%obj,%slot);
%obj.stopAudio(2);
%obj.stopAudio(3);
schedule(10,0,TF2MinigunUnMount,%obj);
}
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(TF2MinigunSpindownImage : TF2MinigunSpinupImage)
{
// Initial start up state
stateName[0] = "Activate";
stateSequence[0] = "root";
stateTimeoutValue[0] = 0.2;
stateTransitionOnTimeout[0] = "Ready";
stateAllowImageChange[0] = false;
stateTransitionOnTriggerDown[0] = "Ready";
stateName[1] = "Ready";
stateSequence[1] = "root";
statescript[1] = "OnReady";
};
function TF2MinigunSpindownImage::onReady(%this,%obj,%slot)
{
%obj.mountimage(TF2MinigunIdleimage,0);
}
function TF2MinigunSpindownImage::onUnMount(%this,%obj,%slot)
{
parent::OnUnMount(%this,%obj,%slot);
%obj.stopAudio(3);
schedule(10,0,TF2MinigunUnMount,%obj);
}
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(TF2MinigunImage)
{
// Basic Item properties
shapeFile = "./Minigun.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.30 0.05 -0.5";
rotation = eulerToMatrix( "0 0 0" );
eyerotation = eulerToMatrix( "2 0 3" );
// 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 = TF2MinigunProjectile;
projectileType = Projectile;
casing = GunShellDebris;
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 = TF2MinigunItem.colorShiftColor;//"0.1 0.1 0.1 1.000";
//Raycasting Weapons settings
raycastWeaponRange = 1000;
raycastWeaponTargets = $TypeMasks::FxBrickObjectType | //Targets the weapon can hit: Raycasting Bricks
$TypeMasks::PlayerObjectType | //AI/Players
$TypeMasks::StaticObjectType | //Static Shapes
$TypeMasks::TerrainObjectType | //Terrain
$TypeMasks::VehicleObjectType; //Vehicles
raycastWeaponPierceTargets = ""; //Gun cannot pierce
raycastExplosionProjectile = gunprojectile;
raycastExplosionSound = "TF2MinigunRicSound"; //sound played by exploding gunprojectile
raycastDirectDamage = 9;
raycastDirectDamageType = $DamageType::TF2Minigun;
raycastSpreadCount = 1;
raycastSpreadAmt = 0.004;
raycastTracerProjectile = TF2BulletTrailProjectile;
//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";
stateScript[0] = "OnActivate";
stateTimeoutValue[0] = 0.15;
stateTransitionOnTimeout[0] = "Ready";
stateSequence[0] = "Spin";
stateName[1] = "Ready";
stateScript[1] = "OnReady";
stateSequence[1] = "Spin";
stateTimeoutValue[1] = 1.00;
stateTransitionOnTimeout[1] = "Spindown";
stateTransitionOnTriggerDown[1] = "Fire";
stateTransitionOnNoAmmo = "AltFire";
stateName[2] = "AltFire";
stateScript[2] = "OnAltFire";
stateSequence[2] = "Spin";
stateTransitionOnTriggerDown[2] = "Fire";
stateTransitionOnAmmo[2] = "Ready";
stateName[3] = "Fire";
stateSequence[3] = "Spin";
stateTransitionOnTimeout[3] = "Smoke";
stateTimeoutValue[3] = 0.01;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateScript[3] = "onFire";
stateWaitForTimeout[3] = true;
stateEmitter[3] = TF2MinigunFlashEmitter;
stateEmitterTime[3] = 0.01;
stateEmitterNode[3] = "muzzleNode";
//stateSound[3] = TF2MinigunFireSound;
stateEjectShell[3] = true;
stateName[4] = "Smoke";
stateEmitter[4] = TF2MinigunSmokeEmitter;
stateEmitterTime[4] = 0.05;
stateEmitterNode[4] = "muzzleNode";
stateTimeoutValue[4] = 0.05;
stateTransitionOnTimeout[4] = "Check";
stateName[5] = "Check";
stateScript[5] = "OnCheck";
stateTransitionOnTriggerUp[5] = "AltFire";
stateTransitionOnTriggerDown[5] = "Fire";
stateName[6] = "Spindown";
stateSequence[6] = "root";
stateScript[6] = "OnSpindown";
};
function TF2MinigunImage::onUnMount(%this,%obj,%slot)
{
parent::OnUnMount(%this,%obj,%slot);
%obj.stopAudio(2);
%obj.stopAudio(3);
schedule(10,0,TF2MinigunUnMount,%obj);
}
function TF2MinigunImage::onActivate(%this,%obj,%slot)
{
%obj.SetImageAmmo(0, 1);
}
function TF2MinigunImage::onFire(%this,%obj,%slot)
{
Parent::onFire(%this,%obj,%slot);
%obj.TF2MinigunPlaySpinSound = 0;
if(!%obj.TF2MinigunPlayFireSound)
{
%obj.TF2MinigunPlayFireSound = 1;
%obj.playAudio(3,TF2MinigunFireLoopSound);
}
}
function TF2MinigunImage::onReady(%this,%obj,%slot)
{
%obj.TF2MinigunPlayFireSound = 0;
%obj.TF2MinigunPlaySpinSound = 0;
%obj.stopAudio(3);
}
function TF2MinigunImage::onAltFire(%this,%obj,%slot)
{
%obj.TF2MinigunPlayFireSound = 0;
if(!%obj.TF2MinigunPlaySpinSound)
{
%obj.TF2MinigunPlaySpinSound = 1;
%obj.playAudio(2,TF2MinigunSpinLoopSound);
}
%obj.stopAudio(3);
}
function TF2MinigunImage::onSpindown(%this,%obj,%slot)
{
%obj.mountimage(TF2MinigunSpindownimage,0);
%obj.playAudio(2,TF2MinigunSpindownSound);
%obj.stopAudio(3);
}
package TF2MinigunDropTool
{
function servercmdDropTool(%this,%slot)
{
if(isobject(%this.player.tool[%slot]) && %this.player.tool[%slot].getname() $= "TF2MinigunItem")
{
parent::servercmdDropTool(%this,%slot);
//if(isobject(%this.player.getmountedimage(0)) && %this.player.getmountedimage(0).getname() $= "TF2SpinupImage")
//if(getSubStr(%this.player.getMountedImage(0).getName, 0, 10) $= "TF2Minigun")
//if(isobject(%this.player.getmountedimage(0)) && (%this.player.getmountedimage(0).getname() $= ("TF2MinigunSpinupImage" || "TF2MinigunSpindownImage" || "TF2MinigunImage"))
if(isobject(%this.player.getmountedimage(0)) && (%this.player.getmountedimage(0).getname() $= "TF2MinigunSpinupImage" || %this.player.getmountedimage(0).getname() $= "TF2MinigunSpindownImage" || %this.player.getmountedimage(0).getname() $= "TF2MinigunImage"))
{
%this.player.schedule(5,unmountimage,0);
%obj.stopAudio(2);
%obj.stopAudio(3);
}
return;
}
parent::servercmdDropTool(%this,%slot);
}
};
activatepackage(TF2MinigunDropTool);
Shouldn't it be possible to multiply this damage by 1.35 (mini crit) and 3 (crit) respectively given that a certain variable exists to do so?Code: [Select]function ProjectileData::damage(%this,%obj,%col,%fade,%pos,%normal)
{
if(%this.directDamage <= 0)
return;
%damageType = $DamageType::Direct;
if(%this.DirectDamageType)
%damageType = %this.DirectDamageType;
%scale = getWord(%obj.getScale(), 2);
%directDamage = mClampF(%this.directDamage, -100, 100) * %scale;
if(%col.getType() & $TypeMasks::PlayerObjectType)
{
%col.damage(%obj, %pos, %directDamage, %damageType);
}
else
{
%col.damage(%obj, %pos, %directDamage, %damageType);
}
}Code: [Select]function ProjectileData::radiusDamage(%this, %obj, %col, %distanceFactor, %pos, %damageAmt)
{
//validate distance factor
if(%distanceFactor <= 0)
return;
else if(%distanceFactor > 1)
%distanceFactor = 1;
%damageAmt *= %distanceFactor;
if(%damageAmt)
{
//use default damage type if no damage type is given
%damageType = $DamageType::Radius;
if(%this.RadiusDamageType)
%damageType = %this.RadiusDamageType;
%col.damage(%obj, %pos, %damageAmt, %damageType);
//burn the player?
if(%this.explosion.playerBurnTime > 0)
{
if(%col.getType() & ($TypeMasks::PlayerObjectType | $TypeMasks::CorpseObjectType))
{
//check for vehicle protection from burning
%doBurn = true;
if(%col.isMounted())
{
%mountData = %col.getObjectMount().getDataBlock();
if(%mountData.protectPassengersBurn)
%doBurn = false;
}
if(%doBurn)
%col.burn(%this.explosion.playerBurnTime * %distanceFactor);
}
}
}
}
package TF2MinigunAltFire
{
function Armor::onTriggerDown(%this,%obj,%slot,%val)
{
if(%obj.getMountedImage(0) $= TF2MinigunIdleImage.getID() && %slot $= 4 && %val)
{
%obj.TF2MinigunTriggerdown = 1;
%obj.setImageAmmo(0, 0);
schedule(500,0,TF2MinigunTriggerDown,%obj);
}
if(%obj.getMountedImage(0) $= TF2MinigunIdleImage.getID() && %slot $= 4 && %val $= 0)
{
%obj.TF2MinigunTriggerdown = 0;
%obj.setImageAmmo(0, 1);
}
if(%obj.getMountedImage(0) $= TF2MinigunImage.getID() && %slot $= 4 && %val)
{
%obj.TF2MinigunTriggerdown = 1;
%obj.setImageAmmo(0, 0);
schedule(500,0,TF2MinigunTriggerDown,%obj);
}
if(%obj.getMountedImage(0) $= TF2MinigunImage.getID() && %slot $= 4 && %val $= 0)
{
%obj.TF2MinigunTriggerdown = 0;
%obj.setImageAmmo(0, 1);
}
Parent::onTriggerDown(%this,%obj,%slot,%val);
}
};
activatePackage(TF2MinigunAltFire);
function TF2MinigunTriggerDown(%obj)
{
if(%TF2MinigunTriggerDown == 1)
{
%obj.setImageAmmo(0, 0);
schedule(500,0,TF2MinigunTriggerDown,%obj);
}
if(%TF2MinigunTriggerDown == 0)
{
%obj.setImageAmmo(0, 1);
}
}
Yes, I know there was a better way to organize the different if statements, as they had very similar characteristics, but it's not what I am talking about. It's just that whatever I do, whatever I put in there, I am certain that this script simply does nothing. Is there something someone can please tell me that I am doing wrong?
OnActivate - Brick - SetAsSpawnPoint - None
All
Team1
Team2
Team3
Team4
Team5
Team6
If you set it to team 1, then set it to team 2, it will no longer spawn team 1.