=-=-=-=-=-=-=-=-\ Anti-Enegery Pack| =-=-=-=-=-=-=-=-/ This tut will explain how to make an Anti Energy pack that will protect you from all, or some, energy weapons. Note: if you dont know how to do steps number 2, 3, and 7, look in other tuts. Step #1 First make a new pack called antienergypack.cs, then paste this in. // ------------------------------------------------------------------ // AntiEnergy PACK Code by Parousia // can be used by any armor type // while activated, Energy damage //------------------------------------------------------------------- datablock AudioProfile(AntiEnergyPackActivateSound) { filename = "fx/packs/shield_on.wav"; description = ClosestLooping3d; preload = true; }; datablock ShapeBaseImageData(AntiEnergyPackImage) { shapeFile = "pack_upgrade_shield.dts"; item = AntiEnergyPack; mountPoint = 1; offset = "0 0 0"; usesEnergy = true; minEnergy = 3; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateSequence[1] = "fire"; stateSound[1] = AntiEnergyPackActivateSound; stateEnergyDrain[1] = 14; stateTransitionOnTriggerUp[1] = "Deactivate"; stateTransitionOnNoAmmo[1] = "Deactivate"; stateName[2] = "Deactivate"; stateScript[2] = "onDeactivate"; stateTransitionOnTimeout[2] = "Idle"; }; datablock ItemData(AntiEnergyPack) { className = Pack; catagory = "Packs"; shapeFile = "pack_upgrade_shield.dts"; mass = 1; elasticity = 0.2; friction = 0.6; pickupRadius = 2; rotate = true; image = "AntiEnergyPackImage"; pickUpName = "an Anti Energy pack"; computeCRC = true; }; function AntiEnergyPackImage::onMount(%data, %obj, %node) { } function AntiEnergyPackImage::onUnmount(%data, %obj, %node) { %obj.setImageTrigger(%node, false); %obj.antiEnergy = ""; //Variable for antienergy pack } function AntiEnergyPackImage::onActivate(%data, %obj, %slot) { messageClient(%obj.client, 'MsgAntiEnergyPackOn', '\c2AntiEnergy pack on.'); %obj.antiEnergy = true; //Variable for antienergy pack } function AntiEnergyPackImage::onDeactivate(%data, %obj, %slot) { messageClient(%obj.client, 'MsgAntiEnergyPackOff', '\c2AntiEnergy pack off.'); %obj.setImageTrigger(%slot,false); %obj.antiEnergy = ""; //Variable for antienergy pack } function AntiEnergyPack::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors } The function onactivate, sets a variable called antienergy to true, the unmount and deactivate functions set it to nothing, or false, this is the variable we will use, so remember it. Step #2 Now you need to add the pack to the inventoryhud, since this has a hard rating you should know how to do this. Step #3 Now add it to all the players you want to have it, you should be able to do this too. Step #4 Now we need to add our pack to the hud, so open up hud.cs and paste this in with the rest of the $BackpackHudData array. Remember the number will vary!! $BackpackHudData[18, itemDataName] = "AntiEnergyPack"; $BackpackHudData[18, bitmapName] = "gui/hud_new_packshield"; Also increase the... Note: These next two steps are not required unless you want to be able to set a quickkey Step #5 Open Pack.cs and add the Exec line under the upgrade packs. You should know how to do this. Step #6 Now we will make it so that you get no damage from energy weapons when you have the pack on. First open player.cs and find the function: Armor::damageObject Right after: if(%targetObject.invincible || %targetObject.getState() $= "Dead") return; You need to add an if, It will need to look somewhat like this: if(%damageType $= $DamageType::Blaster) { look in damagetypes.cs and find all the damage types you think are energy, or that you want blocked and add them on like this: || %damageType $= $DamageType::PlasmaTurret //whatever the damagetype is goes here so now it looks like this: if(%damageType $= $DamageType::Blaster || %damageType $= $DamageType::PlasmaTurret) { Now under that if statement you need a new one. It will check wether the player is using an anti energy pack. if(%targetObject.antiEnergy) { now add this under the if: return; Don't forget to close your if statements. The final product will look a bit like this: if(%damageType $= $DamageType::Blaster || %damageType $= $DamageType::PlasmaTurret) { if(%targetObject.antiEnergy) { return; } } Thats the pack! Remember to add all the damagetypes you want blocked onto the first if statement. --------------------------------------------------------------------------------