270
« on: April 02, 2011, 05:43:27 PM »
I attempting to create a Spray Can item that looks exactly like the Spray Can but doesn't color bricks. So far I've gotten everything else working but the spray projectile doesn't collide with bricks, terrain or interior. I also can't seem to find the datablock that is the actual stream of paint. The Spray Can projectile doesn't have any "cloud" image assigned to it which it clearly has in game. Also by default the stream of paint is blue, again I am unable the datablock that controls that color. Any help?
datablock AudioProfile(propSprayActivateSound : sprayActivateSound)
{
description = AudioClose3d;
preload = true;
};
datablock AudioProfile(propSprayFireSound : sprayFireSound)
{
description = AudioClosestLooping3d;
preload = true;
};
datablock ParticleData(propSprayPaintDropletParticle : bluePaintDropletParticle)
{
colors[0] = "1 0 0 0.5";
colors[1] = "0 1 0 0";
colors[2] = "1 1 1 1";
colors[3] = "1 1 1 1";
};
datablock ParticleData(propSprayPaintExplosionParticle : bluePaintExplosionParticle)
{
colors[0] = "1 0 0 0.5";
colors[1] = "0 0 1 0";
colors[2] = "1 1 1 1";
colors[3] = "1 1 1 1";
};
datablock ParticleEmitterData(propSprayPaintDropletEmitter : bluePaintDropletEmitter)
{
className = "ParticleEmitterData";
lifetimeMS = "100";
particles = "propSprayPaintDropletParticle";
};
datablock ParticleEmitterData(propSprayPaintExplosionEmitter : bluePaintExplosionEmitter)
{
className = "ParticleEmitterData";
lifetimeMS = "100";
particles = "propSprayPaintExplosionParticle";
};
datablock ExplosionData(propSprayPaintExplosion : bluePaintExplosion)
{
className = "ExplosionData";
emitter[0] = "propSprayPaintExplosionEmitter";
emitter[1] = "propSprayPaintDropletEmitter";
};
datablock ProjectileData(propSprayCanProjectile : bluePaintProjectile)
{
className = "ProjectileData";
uiName = "";
muzzleVelocity = "20";
lifetime = "300";
explosion = "propSprayPaintExplosion";
explodeOnDeath = 0;
explodeOnPlayerImpact = 0;
};
datablock ItemData(propSprayCanItem)
{
category = "Tools";
className = "WeaponImage";
shapeFile = "base/data/shapes/spraycan.dts";
mass = 1;
drag = 0.5;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
uiName = "Spray Can Tool";
iconName = "./Icon_SprayCan";
doColorShift = false;
colorShiftColor = "0.471 0.471 0.471 1.000";
image = propSprayCanImage;
canDrop = true;
};
datablock ShapeBaseImageData(propSprayCanImage : blueSprayCanImage)
{
item = propSprayCanItem;
projectile = propSprayCanProjectile;
projectileType = Projectile;
showBricks = 0;
stateSound[0] = "propSprayActivateSound";
stateSound[2] = "propSprayFireSound";
};
function propSprayCanImage::onFire(%this, %obj, %slot)
{
%obj.playthread(2, root);
}
I've recolored the explosion for testing purposes.