46
Modification Help / Trouble in Terrorist Town
« on: August 26, 2011, 09:18:21 PM »8-28-2011
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.
datablock ParticleData(TTTTracer)
{
dragCoefficient = 3.0;
windCoefficient = 0.0;
gravityCoefficient = 0.0;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 120;
lifetimeVarianceMS = 0;
spinSpeed = 10.0;
spinRandomMin = -50.0;
spinRandomMax = 50.0;
useInvAlpha = false;
animateTexture = false;
//framesPerSec = 1;
textureName = "base/data/particles/dot";
//animTexName = "~/data/particles/dot";
// Interpolation variables
colors[0] = "1 1 0 0.5";
colors[1] = "1 1 0.4 0.5";
sizes[0] = 0.05;
sizes[1] = 0.01;
times[0] = 0.0;
times[1] = 0.25;
};
datablock ParticleEmitterData(TTTTracerEmitter)
{
ejectionPeriodMS = 2;
periodVarianceMS = 0;
ejectionVelocity = 0; //0.25;
velocityVariance = 0; //0.10;
ejectionOffset = 0;
thetaMin = 0.0;
thetaMax = 90.0;
particles = TTTTracer;
useEmitterColors = false;
};
datablock ExplosionData(FirePlasmidExplosion)
{
//explosionShape = "";
soundProfile = "fireplasmidsound";
lifeTimeMS = 150;
particleEmitter = adminWandExplosionEmitter;
particleDensity = 50;
particleRadius = 1;
faceViewer = true;
explosionScale = "1 1 1";
shakeCamera = true;
camShakeFreq = "10.0 11.0 10.0";
camShakeAmp = "1.0 1.0 1.0";
camShakeDuration = 0.5;
camShakeRadius = 10.0;
// Dynamic light
lightStartRadius = 1;
lightEndRadius = 0;
lightStartColor = "1 0 0";
lightEndColor = "0 0 0";
uiName = "Fire Plasmid Impact";
};
package imageSwitch
{
function Armor::onTrigger(%this,%obj,%slot,%val)
{
Parent::onTrigger(%this,%obj,%slot,%val);
if(%slot == 4 && %val)
{
if(%obj.getMountedImage(0) == IMAGE1.getID())
{
%obj.updateArm(IMAGE2);
%obj.mountImage(IMAGE2,0);
}
else if(%obj.getMountedImage(0) == IMAGE2.getID())
{
%obj.updateArm(IMAGE2);
%obj.mountImage(IMAGE1,0);
}
}
}
};
activatePackage(imageSwitch);
Now wait, what?////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(DATA2Image)
{
// Basic Item properties
shapeFile = "./DATA.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 1.0 -0.85"
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 = BowItem;
ammo = " ";
projectile = DATAProjectile;
projectileType = Projectile;
casing = DATAShellDebris;
shellExitDir = "-1.0 -1.0 -3.0";
shellExitOffset = "0 0 0";
shellExitVariance = 15.0;
shellVelocity = 10.0;
//melee particles shoot from eye node for consistancy
melee = false;
//raise your arm up or not
armReady = true;
LarmReady = true;
doColorShift = false;
colorShiftColor = DATAItem.colorShiftColor;//"0.400 0.196 0 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.
// The animation dustLock is used to reset the bolt to the closed
// position when you pick it up.
stateName[0] = "Activate";
stateSequence[0] = "dustLock";
stateTimeoutValue[0] = 0.23;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = weaponSwitchSound;
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "Fire";
stateAllowImageChange[1] = true;
stateSequence[1] = "ready";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Smoke";
stateTimeoutValue[3] = 0.15;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateWaitForTimeout[3] = true;
stateEmitter[3] = DATAFlashEmitter;
stateEmitterTime[3] = 0.08;
stateEmitterNode[3] = "muzzleNode";
stateSound[3] = DATAFireSound;
stateEjectShell[3] = true;
stateName[4] = "Smoke";
stateEmitter[4] = DATASmokeEmitter;
stateEmitterTime[4] = 0.12;
stateEmitterNode[4] = "muzzleNode";
stateTimeoutValue[4] = 0.0;
stateTransitionOnTimeout[4] = "Ready";
};
Good! Now that you defined a new image, give it the name of your first image, but increase the number value on the end by one. Remember, this was using my bACR script, so you should probably just find that code in your server.cs, and copy+paste it, edit it, etc, yeah. (I replaced my datablock names with DATA, so if you did use it, it's easier to change.)};
MissionCleanup.add(%p);
}
return %p;
}
PASTE IT HERE. DO NOT ADD THIS CODE.
Voila! You have added your imageswitcher, and in theory, you can change images right now, simply via right clicking! (note, if you did JUST THIS, the gun will probably do nothing, and be very uneventful, and probably broken, bare with me for a bit longer.) So, now, you should go up to the code in IMAGE2, saying..eyeOffset = 0; //"0.0 1.0 -0.85"
Change that to...eyeOffset = "0.0 1.0 -0.85"
Now, your gun should be slightly offset when you right click, but it won't be looking down the sights, so adjust that until you are, OR, use the easy-adjustment guide + base.eyeOffset = "0 0.3 -0.73"; //-Left +Right, -Back +Front, -Down +Up
REMEMBER! You may have to do A LOT of trial and error, this took me 6 hours to get right!