Ah, I see. So basically any datablocks that's just "swordX" needs to be changed to "editswordX", if I'm not mistaken?
Edit: would it be possible to have forceAddonRequired in the script to take bits and pieces from the original sword instead or am I horribly wrong?
Edit: I think I fixed it. Removed like eight commented lines to shorten it a bit
//protoherosword.cs
datablock AudioProfile(protoswordDrawSound)
{
filename = "./protoswordDraw.wav";
description = AudioClosest3d;
preload = true;
};
datablock AudioProfile(protoswordHitSound)
{
filename = "./protoswordHit.wav";
description = AudioClosest3d;
preload = true;
};
//effects
datablock ParticleData(protoswordExplosionParticle)
{
dragCoefficient = 2;
gravityCoefficient = 1.0;
inheritedVelFactor = 0.2;
constantAcceleration = 0.0;
spinRandomMin = -90;
spinRandomMax = 90;
lifetimeMS = 500;
lifetimeVarianceMS = 300;
textureName = "base/data/particles/chunk";
colors[0] = "1.0 0.7 0.9 0.9";
colors[1] = "1.0 0.9 0.9 0.0";
sizes[0] = 0.5;
sizes[1] = 0.25;
};
datablock ParticleEmitterData(protoswordExplosionEmitter)
{
ejectionPeriodMS = 7;
periodVarianceMS = 0;
ejectionVelocity = 8;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 0;
thetaMax = 60;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvance = false;
particles = "swordExplosionParticle";
uiName = "Proto Hero Sword Hit";
};
datablock ExplosionData(protoswordExplosion)
{
//explosionShape = "";
lifeTimeMS = 500;
soundProfile = protoswordHitSound;
particleEmitter = protoswordExplosionEmitter;
particleDensity = 10;
particleRadius = 0.2;
faceViewer = true;
explosionScale = "1 1 1";
shakeCamera = true;
camShakeFreq = "80.0 80.0 80.0";
camShakeAmp = "1.0 1.0 1.0";
camShakeDuration = 0.5;
camShakeRadius = 10.0;
// Dynamic light
lightStartRadius = 3;
lightEndRadius = 0;
lightStartColor = "00.9 0.2 0.6";
lightEndColor = "0 0 0";
};
//projectile
AddDamageType("Sword", '<bitmap:add-ons/Weapon_Sword/CI_sword> %1', '%2 <bitmap:add-ons/Weapon_Sword/CI_sword> %1',0.75,1);
datablock ProjectileData(protoswordProjectile)
{
directDamage = 75;
directDamageType = $DamageType::Sword;
radiusDamageType = $DamageType::Sword;
explosion = protoswordExplosion;
//particleEmitter = as;
muzzleVelocity = 50;
velInheritFactor = 1;
armingDelay = 0;
lifetime = 100;
fadeDelay = 70;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = false;
gravityMod = 0.0;
hasLight = false;
lightRadius = 3.0;
lightColor = "0 0 0.5";
uiName = "Proto Hero Sword Slice";
};
//////////
// item //
//////////
datablock ItemData(protoswordItem)
{
category = "Weapon"; // Mission editor category
className = "Weapon"; // For inventory system
// Basic Item Properties
shapeFile = "./protosword.dts";
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;
//gui stuff
uiName = "Proto Hero Sword";
iconName = "./icon_sword";
doColorShift = true;
colorShiftColor = "0.600 0.000 0.000 1.000";
// Dynamic properties defined by the scripts
image = swordImage;
canDrop = true;
};
////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(protoswordImage)
{
// Basic Item properties
shapeFile = "./sword.dts";
emap = true;
// Specify mount point & offset for 3rd person, and eye offset
// for first person rendering.
mountPoint = 0;
offset = "0 0 0";
correctMuzzleVector = false;
eyeOffset = "0.7 1.2 -0.25";
className = "WeaponImage";
// Projectile && Ammo.
item = protoswordItem;
ammo = " ";
projectile = protoswordProjectile;
projectileType = Projectile;
//melee particles shoot from eye node for consistancy
melee = true;
doRetraction = false;
//raise your arm up or not
armReady = true;
//casing = " ";
doColorShift = true;
colorShiftColor = "0.600 0.000 0.000 1.000";
stateName[0] = "Activate";
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = protoswordDrawSound;
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;
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 swordImage::onPreFire(%this, %obj, %slot)
{
%obj.playthread(2, armattack);
}
function swordImage::onStopFire(%this, %obj, %slot)
{
%obj.playthread(2, root);
}