=====================| Deployable Platform | =====================| Thanks to ZOD for the deployable platform, on which this tutorial is based. Also thanks to CrazyBrett for the information on how to add a deployable. Thanks to Jimmy K for pointing out some errors. What It Is This tutorial will take you through the complete process of adding a new deployable. The deployable will be a simple platform and will be available to Medium and Heavy armors. Step #1 Create a new file called platformDeployable.cs in your script\packs directory. Paste the following in it: //-------------------------------------- // Deployable Platform - by ZOD // Tutorial by Tribes 2 Coding Center //-------------------------------------- datablock StaticShapeData(DeployedPlatform) : StaticShapeDamageProfile { className = Sensor; shapeFile = "bmiscf.dts"; // dmiscf.dts maxDamage = 2.0; destroyedLevel = 2.0; disabledLevel = 1.8; explosion = DeployablesExplosion; dynamicType = $TypeMasks::StaticShapeObjectType; deployedObject = true; cmdCategory = "DSupport"; cmdIcon = CMDSensorIcon; cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor"; targetNameTag = 'Deployed Platform'; deployAmbientThread = true; debrisShapeName = "debris_generic_small.dts"; debris = DeployableDebris; heatSignature = 0; }; datablock ShapeBaseImageData(PlatformDeployableImage) { mass = 20; emap = true; shapeFile = "pack_deploy_inventory.dts"; item = PlatformDeployable; mountPoint = 1; offset = "0 0 0"; deployed = DeployedPlatform; heatSignature = 0; stateName[0] = "Idle"; stateTransitionOnTriggerDown[0] = "Activate"; stateName[1] = "Activate"; stateScript[1] = "onActivate"; stateTransitionOnTriggerUp[1] = "Idle"; isLarge = true; maxDepSlope = 360; // 30 deploySound = ItemPickupSound; }; datablock ItemData(PlatformDeployable) { className = Pack; catagory = "Deployables"; shapeFile = "pack_deploy_inventory.dts"; mass = 5.0; elasticity = 0.2; friction = 0.6; pickupRadius = 1; rotate = false; image = "PlatformDeployableImage"; pickUpName = "a platform pack"; heatSignature = 0; emap = true; }; function PlatformDeployableImage::testObjectTooClose(%item) { %mask = $TypeMasks::PlayerObjectType; %pos = %item.surfacePt; return !ContainerBoxEmpty (%mask, %pos, $MinDeployableDistance); } function PlatformDeployableImage::testNoTerrainFound(%item) { //don't check this for non-Landspike turret deployables } function PlatformDeployable::onPickup(%this, %obj, %shape, %amount) { // created to prevent console errors } function DeployedPlatform::onDestroyed(%this, %obj, %prevState) { Parent::onDestroyed(%this, %obj, %prevState); $TeamDeployedCount[%obj.team, PlatformDeployable]--; %obj.schedule(500, "delete"); } Some explanation is required. For a normal deployable object you need three datablocks, one for the inventory item, one for the image, and one for the deployed object. You also need some functions. The testObjectTooClose() function is used by the game to test an area to see if you can deploy an item there. The testObjectTooClose() function above, simply searches for players within the $MinDeployableDistance (already defined). The testNoTerrainFound() and onPickup() functions are simply there to prevent problems. The onDestroyed() function decrements the count of deployed platforms and deletes it from the game. Step #2 In inventoryHud.cs, find the definitions for the $InvPack and $NTInvPack arrays. Add your deployable as the next available element in those lists as shown: $InvPack[17] = "Deployable Platform"; $NTInvPack[10] = "Deployable Platform"; Note: If you do not want players to have access to the deployable platform in non-team based games, don't edit the $NTInvPack array. Also add your deployable to the bottom of the $NameToInv array: $NameToInv["Deployable Platform"] = "PlatformDeployable"; Step #3 You need to set the game up so that when a new match starts, it sets the number of deployed platforms to zero. To do this, open defaultGame.cs and find the clearDeployableMaxes() function. Add the following line within the for loop: $TeamDeployedCount[%i, PlatformDeployable] = 0; Step #4 Open hud.cs and find the section that fills up the $BackpackHudData array. Add the following to the end of the list: $BackpackHudData[18, itemDataName] = "PlatformDeployable"; $BackpackHudData[18, bitmapName] = "gui/hud_new_packmotionsens.png"; Then directly below that, increment $BackpackHudCount by one: $BackpackHudCount = 19; Step #5 Open player.cs and go to the datablocks for the male human armors. Add a max[] line for your deployable to each. For armors that will be allowed to deploy plaforms use: max[PlatformDeployable] = 1; And if an armor cannot deploy a platform use: max[PlatformDeployable] = 0; Step #6 Open deployables.cs. Near the top of the file, locate the definitions for $TeamDeployableMax numbers and add: $TeamDeployableMax[PlatformDeployable] = 10; Finally, at the VERY end of the file, append the following line: exec("scripts/packs/platformDeployable.cs"); --------------------------------------------------------------------------------