Yeah, it don't work, dunno why, is very odd, no?
//Guitar by [SS]Masterlegodude[AG]
datablock ParticleData(guitarParticleA)
{
dragCoefficient = 0;
gravityCoefficient = 0;
inheritedVelFactor = 1;
constantAcceleration = 0.0;
spinRandomMin = -90;
spinRandomMax = 90;
lifetimeMS = 100;
lifetimeVarianceMS = 20;
textureName = "base/data/particles/star1";
colors[0] = getrandom(0,1000) / 1000 SPC getrandom(0,1000) / 1000 SPC getrandom(0,1000) / 1000 @ " 0.500";
colors[1] = getrandom(0,1000) / 1000 SPC getrandom(0,1000) / 1000 SPC getrandom(0,1000) / 1000 @ " 0.500";
sizes[0] = 0.3
sizes[1] = 0.05;
};
datablock ParticleEmitterData(guitarEmitterA)
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 6;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 180;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "guitarParticleA";
};
datablock ParticleData(guitarParticleB)
{
dragCoefficient = 0;
windCoefficient = 0;
gravityCoefficient = 0;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
spinRandomMin = -90;
spinRandomMax = 90;
lifetimeMS = 800;
lifetimeVarianceMS = 200;
textureName = "base/data/particles/star1";
colors[0] = "1 1 1 1";
colors[1] = "0.2 0.2 1 0";
sizes[0] = 0.1;
sizes[1] = 0.05;
};
datablock ParticleEmitterData(guitarEmitterB)
{
ejectionPeriodMS = 1;
periodVarianceMS = 0;
ejectionVelocity = 0;
velocityVariance = 0.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 180;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "guitarParticleB";
};
datablock ExplosionData(guitarExplosion)
{
//explosionShape = "";
lifeTimeMS = 150;
particleEmitter = guitarEmitterA;
particleDensity = 10;
particleRadius = 0.2;
faceViewer = true;
explosionScale = "1 1 1";
shakeCamera = false;
camShakeFreq = "10.0 11.0 10.0";
camShakeAmp = "3.0 10.0 3.0";
camShakeDuration = 0.5;
camShakeRadius = 20.0;
// Dynamic light
lightStartRadius = 0;
lightEndRadius = 0;
lightStartColor = "0 0 0 0";
lightEndColor = "0 0 0 0";
damageRadius = 4;
radiusDamage = 70;
impulseRadius = 6;
impulseForce = 800;
};
AddDamageType("guitarDirect", '<bitmap:add-ons/ci/generic> %1', '%2 <bitmap:add-ons/ci/generic> %1',1,1);
AddDamageType("guitarRadius", '<bitmap:add-ons/ci/generic> %1', '%2 <bitmap:add-ons/ci/generic> %1',1,0);
datablock ProjectileData(guitarLauncherProjectile)
{
//projectileShapeName = "";
directDamage = 40;
directDamageType = $DamageType::guitarDirect;
radiusDamageType = $DamageType::guitarRadius;
impactImpulse = 1000;
verticalImpulse = 1000;
explosion = guitarExplosion;
particleEmitter = guitarEmitterB;
brickExplosionRadius = 3;
brickExplosionImpact = false; //destroy a brick if we hit it directly?
brickExplosionForce = 30;
brickExplosionMaxVolume = 30; //max volume of bricks that we can destroy
brickExplosionMaxVolumeFloating = 60; //max volume of bricks that we can destroy if they aren't connected to the ground (should always be >= brickExplosionMaxVolume)
sound = guitarLoopSound;
muzzleVelocity = 100;
velInheritFactor = 0.0;
armingDelay = 00;
lifetime = 4000;
fadeDelay = 3500;
bounceElasticity = 0.5;
bounceFriction = 0.20;
isBallistic = false;
gravityMod = 0.0;
hasLight = false;
lightRadius = 0.0;
lightColor = "1 0.5 0.0";
};
datablock ItemData(guitarItem)
{
category = "Weapon"; // Mission editor category
className = "Weapon"; // For inventory system
// Basic Item Properties
shapeFile = "Add-Ons/shapes/Guitar.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
//gui stuff
uiName = "Guitar";
iconName = "./ItemIcons/bow";
doColorShift = true;
colorShiftColor = "0.3 0.3 0.3 1";
// Dynamic properties defined by the scripts
image = guitarImage;
canDrop = true;
};
datablock ShapeBaseImageData(guitarImage)
{
// Basic Item properties
shapeFile = "Add-Ons/shapes/Guitar.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 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 = false;
eyeOffset = "0 0 0";
// Add the WeaponImage namespace as a parent, WeaponImage namespace
// provides some hooks into the inventory system.
className = "WeaponImage";
// Projectile && Ammo.
item = guitarItem;
ammo = " ";
//melee particles shoot from eye node for consistancy
melee = false;
doRetraction = false;
//raise your arm up or not
armReady = true;
//casing = " ";
doColorShift = true;
colorShiftColor = "0 0 0 1";
// 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";
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "PreFire";
stateAllowImageChange[1] = true;
stateName[2] = "PreFire";
stateScript[2] = "onPreFire";
stateAllowImageChange[2] = false;
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "CheckFire";
stateTimeoutValue[3] = 0.2;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateWaitForTimeout[3] = true;
//stateTransitionOnTriggerUp[3] = "StopFire";
stateName[4] = "CheckFire";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "Fire";
stateName[5] = "StopFire";
stateTransitionOnTimeout[5] = "Ready";
stateTimeoutValue[5] = 0.2;
stateAllowImageChange[5] = false;
stateWaitForTimeout[5] = true;
stateSequence[5] = "StopFire";
stateScript[5] = "onStopFire";
};
function guitarImage::onPreFire(%this, %obj, %slot)
{
%obj.playthread(2, armattack);
}
function guitarImage::onStopFire(%this, %obj, %slot)
{
%obj.playthread(2, root);
}