_______________________________________________________________________ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Adding Armors:by Drumstix42 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- --- --- --- --- --- --- --- - _______________________________________________________________________ Energy-base weapons are pretty easy. You basically do the same thing you do for a normal weapon, but leave all the stuff out for ammo, and you add 3 extra lines in your weapon file. Step #1 ----- -------------- inventoryHud.cs -------------- ----- First, add this to your weapon's list: $InvWeapon[10] = "Weapon'sNameToAppear"; //change to corresponding number Then add this to the list under that, changing to fit your weapon: $NameToInv["Weapon'sNameToAppear"] = "WeaponsName"; Step #2 ----- -------------- weapons.cs -------------- ----- Now, add this to your $WeaponsHudData list: $WeaponsHudData[11, bitmapName] = "gui/hud_???"; //change this to one of the weapon's hud symbols(look at weapons above it for reference) $WeaponsHudData[11, itemDataName] = "WeaponsName"; //Remember to change the numbers correctly //$WeaponsHudData[11, ammoDataName] = ""; //No ammo, for a Energy Based Gun $WeaponsHudData[11, reticle] = "gui/hud_???"; //Change to reticle you want $WeaponsHudData[11, visible] = "false"; //False on a select few weapons, usually ones the base 'energy' weapons use. Always remember to keep the numbers in increasing order. Don`t forget to increase the $WeaponsHudCount by 1 at the very bottom of the list. Now, just like adding a ammo-based, scroll down a little passed your AmmoIncrement since you wont need that (no ammo). Add this to your weapons exec list: exec("scripts/weapons/Weapon'sFileName.cs"); Step #3 ----- -------------- inventory.cs -------------- ----- In this step we'll only need to add the gun itself to the clear and giveall list, as said before, NO AMMO! =P 3a) Now in the: function ShapeBase::clearInventory(%this) Add this with the other weapons: %this.setInventory(WeaponName, 0); 3b) Next in the: function serverCmdGiveAll(%client) Add this with the weapons like before: %player.setInventory(WeaponName, 1); Step #4 ----- -------------- player.cs -------------- ----- You'll need to add one of the following to each armor. It's your choice who get's what. If you can't remember where to add it, refer to the Ammo-Based tutorial, or just seach for: // Inventory restrictions Ok. Add this to allow the armor to equip the weapon max[WeaponName] = 1; Or, add this if you do NOT wish for the armor to EVER get this max[WeaponName] = 0; Once again, no ammo statement needed. Step #5 ----- -------------- YourWeapon.cs -------------- ----- Your final step will be creating or inserting your weapon into YourWeapon.cs in your scripts/weapons folder. The three important lines, which make an energy weapon, an energy using weapon are these: usesEnergy = true; fireEnergy = ?number?; //blaster's fireEnergy is at 4 minEnergy = ?number?; //blaster's minEnergy is at 4 These lines go in your: datablock ShapeBaseImageData(WeaponImage) These 3 lines tell the weapon to use energy, how much, and when to stop firing, when not enough energy is left. So, as stated, if you put in 4 for minEnergy, and your weapon has less then 4 energy while firing, it won't fire until it recharges past 4. Other things to remember, are if your making your Ammo weapon into an Energy weapon, is to take out the Ammo statements, such as in the same datablock where you add the 3 lines, with an Ammo gun, you have something like: datablock ShapeBaseImageData(DiscImage) { className = WeaponImage; shapeFile = "weapon_disc.dts"; item = Disc; ammo = DiscAmmo; offset = "0 0 0"; emap = true; Changing this to Energy using, for this part, you'd take out: ammo = DiscAmmo; And add under, the 3 lines stated before: datablock ShapeBaseImageData(DiscImage) { className = WeaponImage; shapeFile = "weapon_disc.dts"; item = Disc; offset = "0 0 0"; emap = true; usesEnergy = true; fireEnergy = 3; minEnergy = 3; } Now of course there's much other code to change for making the disc use energy instead, but this example will hopefully help you out. And that's it! Adding an Energy-Based weapon isn't reall hard at all, is it! Good luck! Have fun.