Torpedoes 1.0 + CoC Torpedo Test Vehicles 1.0
Torpedoes have been the essence of modern naval
warfare for over 100 years. The Chain of Command is proud to present the first
torpedo addon for OFP.
Quick Intructions
The Torpedoes
Test Mission
Multiplayer
Notes for addon makers
-Creating units using
torpedoes
-Creating your own torpedoes
Revision History
Installation
This package includes the CoC Torpedoes and 5 sample air units (Torpedo Test Vehicles) armed with the available torpedoes (3 West, 4 East). To install the package copy the (the Torpedoes addon) CoC_Torpedoes.pbo and (the Torpedo Test Vehicles) CoC_ttv.pbo to your OFP addon directory.
Note: You do not have to install the sample units. They are not meant to be military or even physically accurate. Thier primariy purpose is showing addon makers how torpedoes can be fitted to vehicles and to showcase how the torpedoes can be seamlessly integrated into the standard OFP weapon system.
Usage
The Torpedo Test Vehicles (TTVs) can be found under the (West&East) "CoC - Vehicles" class
and
are ready to use as is.
Active torpedoes that you can put in the water can be found under (Empty) CoC -
Ordnance.
To add torpedos to any other vehicle (boat or aircraft - NOT including the TTVs) you have to add one line
in the unit's INIT field:
[this, torpedoName, torpedoCount] exec "\Coc_Torpedoes\init\init.sqs" |
where torpedoName is one of the following (including quotes):
"CoC_Mk48" "CoC_Mk46" "CoC_Mk50" "CoC_5365KE" "CoC_APR3E" "CoC_Shkval" "CoC_ShkvalNuc" |
torpedoCount is the number of
torpedoes. Should always be larger than 0 which is reserved for addons where the
weapons are added through the config.cpp (see
this section for details on addon making). If you are using a vehicle that
has missiles/bombs by default then the torpedoCount should preferably be set to
the number of missiles/bomb the vehicle has by default. This is because the
torpedoes will be mounted on the positions where the missiles/bombs were in the
default case.
Example: (adds 8 Mk-46 torpedoes to the vehicle):
[this, "CoC_Mk46", 8] exec "\Coc_Torpedoes\init\init.sqs" |
Note: If you wish to see the torpedoes attached to the vehicle, then you must issue a removeAllWeapons command before the torpedo init command:
removeAllWeapons(this); [this, "CoC_Mk46", 8] exec "\Coc_Torpedoes\init\init.sqs"; |
You can after that add more weapons. Note that
you don't have to remove the weapons. The torpedoes will still be added and you
can use them - the only difference is visual that the torpedoes then won't be
attached below the vehicle.
For a full overview of the available torpedoes see below (here).
For instructions for addon makers see below (here)
Additional notes:
Note on the Nuclear Shkval underwater missile: Although it's low-yield it's
still a nuke, don't be near it when it detonates ;-) Nominal safe distance at
sea level is 900-1000m.
Known Issues:
West:
East:
One test mission is included in the pack called "CoC_TorpedoTest.Intro". You can try out the various torpedoes mounted on different vehicles in a target rich environment. To install the mission copy the "CoC_TorpedoTest.Intro to your editor mission directory.
The torpedoes are fully MP compatible and ready to use as is. In theory it should function the same way as in SP.
In practice the appearence of the torpedoes depends higly on the bandwith and number of users. The direction, velocity and position of the torpedoes are all synchronized over the network while the guidance system is executed only on the client that created it. Network lag may result in updates of the torpedo data being late to some clients leaving the torpedoes to be brutalized by the OFP physics engine during the information gap. This can have some effects on the visual appearence of the torpedoes: they may jump around and spin around a bit until the next update is recieved over the network. The function of the torpedoes is however uneffected by that and a kill is a kill on all clients, it's just that the torpedo movements might look a bit weird on closer inspection. With a good server with high bandwith or in LAN games you won't notice any of this. Also the person that fires the torpedo won't have any of these symptoms since the updates are executed locally.
The torpedoes are just a weapons pack. Their full potential will first be used once the talented addon makers of the OFP community start producing vehicles that use the torpedoes. To facilitate this process CoC is providing source files of the sample UH-60 torpedo carrying chopper and an example of how to easily make new torpedoes using the CoC Torpedo system as a foundation.
DOWNLOAD Torpedo Test Vehicles source
Adding torpedoes with proxies to a vehicle is almost identical to adding missiles to a vehicle. This document assumes that you already know how to do that. If not check out some of the excellent O2 tutorials that are on the web.
A brief understanding of how the torpedo system works will facilitate the usage of them in other addons. The torpedoes are actually not ordnance in OFP but vehicles (boats to be precise). To launch them a dummy weapon is used that is switched in mid air to the real thing. This is executed by a "fired" event handler that starts a script that makes the switch. A fact that complicates matters is that boats can't have missiles in OFP and that leads to that two different weapon systems and dummy ammo is needed: one for aerial vehicles (based on the LaserGuidedBomb) and one for boats (based on the Browning MG).
The process of adding the torpedoes consists of two steps:
class CfgWeapons { class Default {}; class LAWLauncher: Default {}; class CarlGustavLauncher : LAWLauncher {}; class AT3Launcher: CarlGustavLauncher {}; class HellfireLauncher: AT3Launcher {}; class LaserGuidedBombLauncher: HellfireLauncher{}; class CoC_Mk48Launcher:LaserGuidedBombLauncher{}; class CoC_Mk50Launcher:CoC_Mk48Launcher {};
class CoC_Mk50LauncherUH60: CoC_Mk50Launcher
|
2.
A vehicle (what a surprise! ;-) ) with the weapons and ammo added.
class CfgVehicles { class All {}; class AllVehicles: All {}; class Air: AllVehicles {}; class Helicopter: Air {}; class UH60: Helicopter {}; class CoC_uh60T_Mk50: UH60 {
|
3. And most important the following
event handler added to the vehicle.
Without it the torpedoes will not work!
As you can see it is the exactly same call that is used when you add torpedoes
to any other vehicles. Don't forget to change the bolded part to that type of
torpedo you wish to use!
class EventHandlers { init = " [_this select 0,{CoC_Mk50},0] exec {\CoC_Torpedoes\init\init.sqs}"; }; |
For custom user made torpedoes the EH looks slightly different. See the section below for more info.
4. And at last we need some
definitions of the proxies made in O2. Only one per model is needed.
class CfgNonAIVehicles {
|
And that's it. Pretty simple: Create proxies in O2. Define and add weapons. Add the event handler. Add proxies in config.
If you are planning on making some WW2 torpedo boats and feel that the nuclear Shkval is a bit out of context: Fear not! The CoC Torpedo system was designed with extensibility in mind. You can easily create a new torpedo with custom characteristics based on the original torpedoes. Three steps are required:
// [vehicle, maxSpeed, maxRange,
minRange, scanRange, sweepAngle, "warhead"] exec
{\CoC_Torpedoes\scripts\DTMGuidance.sqs}"; init = "[_this select 0,30,2000,75,500,30,""My_TorpedoP""] exec {\CoC_Torpedoes\scripts\DTMGuidance.sqs}"; |
An expanation of the parameters:
vehicle: A reference to the torpedo. Should always be set to
"_this select 0"
maxSpeed: Maximum speed of the torpedo in m/s. Think hard before
implementing real-world values since boats in OFP are generally much faster
than boats IRL.
maxRange: Maximum range of the torpedo before it runs out of
fuel.
minRange: Minimum scan range for the torpedo. Torpedoes use
their sonar (both active and passive) to avoid locking on to their own acustic
signals. This is simulated by the min range parameter.
scanRange: Maximum range for the scan cone (see illustration).
scanAngle: Angle of the detection cone. Torpedoes will lock on
targets within the detection cone: i.e within an angle between scan range and
min range.
warhead: the thing that goes "boom" and that you defined in your
config ;-)
["My_Torpedo","My_TorpedoP","My_TorpedoPB"] call
loadFile "\CoC_Torpedoes\init\regTorp.sqf" _this exec "\CoC_Torpedoes\init\init.sqs" exit |
The bolded line shows what you need to customize. The array contains the
name of your torpedo, the name of the warhead and the name of the boat
warhead. All those are definitions from the config.cpp. If you have several
torpedoes in your pack you can simply just add them to the same array in the
same way. Make sure however that you have three correct elements for each
torpedo type or it will not work!
If your torpedo is called as defined above and the script is init/init.sqs in
your addon then the user can use the torpedo on any vehicle by putting this in
the INIT line of the vehicle (identical to CoC torpedo syntax):
[this, "My_Torpedo", 2] exec "\My_Torpedo\init\init.sqs |
If you intend to add the torpedo via proxies to a vehicle
as described in this section
then you have to change the init event handler to call your brand new init
function.
init = " [_this select 0,{My_Torpedo},0] exec {\My_Torpedo\init\init.sqs}"; |
1.0:
Release version
RC2:
RC1:
BETA2:
BETA1: First Beta Release
Copyright © 2002 The Chain Of Command. Codemasters® is the registered trademark of Codemasters® Operation Flashpoint™and its Logo are trademarks of Codemasters®. All other copyrights or trademarks are the property of their respective owners.