Author Topic: Changing Name And Damage of a Wepon  (Read 1968 times)

I don't want to become some huge coder cracking out Add_Ons every day or anything,
 but i do want to know what to change and where in the wepons code so its name is changed and its damage is changed.
(if i made 1 i would make a sword called the :wooden sword, and it would be weaker and its a brownish shade)
 how would i change the name, change it to a weaker damage, and make it a brownish color?

I am not and repete NOT asking for a flame war on anything! Not why i dont know or anything else!

im here to learn a cool skill and not be flaimed  :panda:

You need to copy the datablocks, and change the value of several things. ColorShiftColor will change the colour of the weapon, UIName will change it's inventory name, and DirectDamage will change the amount of damage.

Basically, you can do this:

Code: [Select]
datablock ProjectileData(wSwordProjectile : swordProjectile)
{
   directDamage = 25;
};

datablock ProjectileData(wSwordItem : swordItem)
{
   uiName = "Wooden Sword";
   colorShiftColor = "0.4 0.6 0 1";
   image = wSwordImage;
};

datablock ShapeBaseImageData(wSwordImage : swordImage)
{
   item = wSwordItem;
   projectile = wSwordProjectile;
   colorShiftColor = "0.4 0.6 0 1";
};

function wSwordImage::onPreFire(%this, %obj, %slot)
{
   %obj.playthread(2, armattack);
}

function wSwordImage::onStopFire(%this, %obj, %slot)
{
   %obj.playthread(2, root);
}

However, this will require that Weapon_Sword is enabled.

Alternatively, you can copy and paste the entire sword datablocks, re-naming them, and changing 
what you require, making them self reliant.

Also, I've changed the colour there to a brown already.

Your RGB Values will all needed to be divided by 255 for the ColorShiftColor.

Also (I don't see an edit button, for whatever reason), I accidentally wrote ProjectileData instead of ItemData, the second occurance.

Code: [Select]
datablock ProjectileData(wSwordItem : swordItem)
needs to be:

Code: [Select]
datablock ItemData(wSwordItem : swordItem)

Now this is getting ridiculous..

Apparently the RGB value I used is green, so I've changed it to:

Code: [Select]
colorShiftColor = "0.5 0.3 0.1 1";
which is in fact, brown.

Also, I've added:

Code: [Select]
if(!isObject(swordProjectile) || !isObject(swordItem) || !isObject(swordImage))
{
   exec("./Weapon_Sword.cs");
}

if(!isObject(swordProjectile) || !isObject(swordItem) || !isObject(swordImage))
{
   error("ERROR: Sword Datablocks not found!");
   return;
}

to the top of my script to ensure the original sword exists.

thanx ill try it:D and.. WTH?!?! 4posts! XD

i cant see the modify either o_O

but i cant find where this code is at

where do i find the spot to change this code???

what was the origbrown town code??