Main Features
User Manual
How to buy
Add-on boats
Add-on scenery
Add-on Library
Boat design
Scenery design
VS forum
User survey
Boat data structure | Boat design sample | Instrument panels | Weapons

The weapons in Virtual Sailor are located in the Virtual Sailor\weapons directory, each weapon is placed in a seperate directory and must be called weapon_## where ## is the number of this weapon, inside this directory all the weapon related files are found.

Each weapon must have a number because of the parameter in the boat.cfg of the boat that carries this weapon defines a weapon number.

The weapon configuration file weapon.cfg allows four types of weapons:

  • Ballistic weapons such as cannons, machine guns and rockets.
  • Guided missiles, where guidance method is line of sight and not self guidance.
  • Unguided torpedos.
  • Guided torpedos, where guidance method is line of sight and not self guidance.

Note: Although most missiles and torpedos have self guidance, the line of sight method was chosen because of the lack of challenge in lauching a self guided weapon and seeing it the target.

Inside each weapon directory are the following files:


This file defines the type and characterisitcs of the weapon.

The structure of the panel.cfg file is as follows:

1 [explodes_in_water]
0 [fixed_rotation]
0 [fixed_elevation]
0 [weapon_guided]
10 [mass]
0.01 [cross_section]
1.0 [cd0]
0.0 [thrust]
0.0 [burn_time]
5.0 [time_max]
100.0 [launch_vel]
0.0 [launch_x]
0.0 [launch_y]
0.0 [launch_z]
0.0 [beta_base]
0.0 [gama_base]

20.0 [salvo_rate]
0.5 [salvo_size]


This file has a fixed format, all parameters must be specified in this order.
explodes_in_water - 1 if weapon is shell, rocket or missile, 0 for torpedo.
fixed_rotation - 0 if weapon can be aimed in rotation, 1 if rotation is fixed.
fixed_elevation - 0 if can be aimed in elevation, 1 if elevation is fixed.
weapon_guided - 1 if weapon is guided, 0 if it is not.
mass - mass of shell itself in kg.
cross_section - cross section of shell in square meters.
cd0 - drag coefficient of shell.
thrust - thrust of rocket or torpedo propeller in newtons.
burn_time - the time of burnout or end of motor activation in seconds.
time_max - the maximal time the shell is allowed to fly in seconds.
lauch_velocity - muzzle velocity of shell in m/sec.
lauch_x - the initial x position of shell relative to weapon's base.
lauch_y - the initial y position of shell relative to weapon's base.
lauch_z - the initial z position of shell relative to weapon's base.
beta_base- the initial direction of turret in radians.
gama_base - the initial elevation of barrel in radians.

salvo_rate - used for machine gun only, rate of shells per second.
salvo_size - used for machine run only, size of shell light spot.

Base.x , Turret.x , File.x , Tail.x , Shell.x

These are the model files which compose the weapon's base, turret, barrel, shell and fire effects.
All of these files are optional and may be omitted for weapons without a barrel, turret or base.

The functions of these files are:

Base - This part defines the fixed part of the weapon, for example the base of a cannon.

Turret - This part is part which is attached to base and rotates to allow aiming of weapon in azimuth, this part is positioned at (0,0) coordinate the base part.

Barrel - This part is the part which is attached to the turret and allows aiming the weapon in elevation, this part is positioned at (0,0) coordinate of the turret part.

Fire - This part is the flame or smoke ejected from the weapon at the moment of launch, it is seen for a fraction of a second and is scaled in the process to simulate the effect of fire, this part is positioned at (0,0) coordinate of the barrel.

Tail - This part is the flame or smoke ejected from the shell in flight, it is seen only when the shell is in flight, and is attached to the shell, it is positioned at the (0,0) coordinate of the shell.

This figure illustrates the various parts shortly after the shell has been fired.

All of these files are simple one frame hierarchy mesh files, they can be created by converting a 3DS file into an X file by using the command "conv3ds -m [filename.3ds]" , conv3ds.exe is a small freeware converter written by Microsoft.

Download source files and conv3ds

Fire.wav, Flight.wav, Explode.wav

These are the sounds which accompany the weapon during firing, flight and explosion.
They are optional and may be used to override the default sounds which are at the Virtual Sailor\sounds directory.

Texture Files

Texture files can be bmp, jpg, dds files that define the textures of the weapon.

Special textures are used for machine gun effects, these are:

blast.jpg - blast sequence of shell with 16 frames.
flame.jpg - flame of shell, includes front and side views.
splash.jpg - splash sequence of sheel with 16 frames.

Copyright Ilan Papini 1999 - 2017
All Right Reserved