Author Topic: Sword Edits.  (Read 870 times)

I tried to make a few sword edits, just changing CIname, damage, colors and stuff.
need halps. or someone to do it for meh. okaybye.

EDIT: If you need me to post my failed sword edit, I will.
also, if you do manage to fix/make them, i would like it to be PM'd to mahself. :3
« Last Edit: February 05, 2009, 09:08:39 PM by Creola »

You need to rename the datablocks in order for it to not overwrite the original sword.

what section of the script would i do that? :3
EDIT:model .dts's? or what?

Quote
//sword.cs
datablock AudioProfile(swordDrawSound)
{
   filename    = "add-ons/weapon_sword/sworddraw.wav";
   description = AudioClosest3d;
   preload = true;
};
datablock AudioProfile(swordHitSound)
{
   filename    = "add-ons/weapon_sword/swordhit.wav";
   description = AudioClosest3d;
   preload = true;
};


//effects
datablock ParticleData(swordExplosionParticle)
{
   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]     = "0.7 0.7 0.9 0.9";
   colors[1]     = "0.9 0.9 0.9 0.0";
   sizes[0]      = 0.5;
   sizes[1]      = 0.25;
};

datablock ParticleEmitterData(swordExplosionEmitter)
{
   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 = "Sword Hit";
};

datablock ExplosionData(swordExplosion)
{
   //explosionShape = "";
   lifeTimeMS = 500;

   soundProfile = swordHitSound;

   particleEmitter = swordExplosionEmitter;
   particleDensity = 10;
   particleRadius = 0.2;

   faceViewer     = true;
   explosionScale = "1 1 1";

   shakeCamera = true;
   camShakeFreq = "20.0 22.0 20.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   // Dynamic light
   lightStartRadius = 3;
   lightEndRadius = 0;
   lightStartColor = "00.0 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(swordProjectile)
{
   directDamage        = 35;
   directDamageType  = $DamageType::Sword;
   radiusDamageType  = $DamageType::Sword;
   explosion           = swordExplosion;
   //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 = "sword Slice";
};


//////////
// item //
//////////
datablock ItemData(swordItem)
{
   category = "Weapon";  // Mission editor category
   className = "Weapon"; // For inventory system

    // Basic Item Properties
   shapeFile = "./sword.dts";
   mass = 1;
   density = 0.2;
   elasticity = 0.2;
   friction = 0.6;
   emap = true;

   //gui stuff
   uiName = "sword";
   iconName = "./icon_sword";
   doColorShift = true;
   colorShiftColor = "0.471 0.471 0.471 1.000";

    // Dynamic properties defined by the scripts
   image = swordImage;
   canDrop = true;
};

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(swordImage)
{
   // 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";

   // 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.7 1.2 -0.25";

   // Add the WeaponImage namespace as a parent, WeaponImage namespace
   // provides some hooks into the inventory system.
   className = "WeaponImage";

   // Projectile && Ammo.
   item = swordItem;
   ammo = " ";
   projectile = swordProjectile;
   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.471 0.471 0.471 1.000";

   // 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";
   stateSound[0]                    = swordDrawSound;

   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);
}

Everything that I put in bold for you, rename.
Everything in italic underlined, you need to use, or you will get errors. Have fun.

Hawt. You win teh gaem.

wayt, what about the //sword.cs at the top? do want change to wurks?
Also, what would i do to change the color of the weapon?
« Last Edit: February 05, 2009, 09:46:26 PM by Creola »

Nah, // is just so you can comment. // means nothing to a script.

but, how2 change weapon color?


The texture file.
i tried; it only changed it in the item spawn.

try these.
1 way--take a file in the folder,drag it to any folder,open it in MSpaint,or whatever,change it,and put it back in the zip file.but remember to delete the one in the folder you changed!

2--look for "setcolorshift"in the ITEM properties,not the IMAGE properties,and enter the RGB numbers.(to figure mine out,i go to blockland's player editor,click color set in the lower left ,and play with the colors.

// Item //
///////////

...

   doColorShift = true;
   colorShiftColor = "0.471 0.471 0.471 1.000";

...

///////////
// Weapon Image//
///////////

...

   doColorShift = true;
   colorShiftColor = "0.471 0.471 0.471 1.000";

...

Give the same new color code value to both lines for a different color sword item and held weapon. Do not change the 4th number, it's transparency and causes bugs if not set to 1.

Code: [Select]
item = swordItem;
   ammo = " ";
   projectile = swordProjectile;
   projectileType = Projectile;

This part should also be changed, leaving it would break if you didn't have the Sword enabled and would start doing the same damage/effects as the normal Sword if you did.. Keep the item the same as the name you defined for ItemData and the projectile the same as your ProjectileData, otherwise it may not work.