AMORE Addon File coding conventions and structure.

An AMORE Addon File is a very elementary OFP addon PBO file. The only file that should be packed inside the AMORE Addon PBO file is a single OFP config.cpp file and nothing else. You can use any standard PBO editing tool to pack and unpack your AMORE Addon File.

An OFP config.cpp file can be created and edited with any standard text editing program, such as Windows NotePad. The config.cpp file's contents should begin with the following header section:

class CfgPatches
{
    class Amore_ofpecTag
    {
        units[] = {};
        weapons[] = { };
        worlds[] = { };
        requiredVersion = 1.00;
    };
};

 

In the above example and in all following examples, replace ofpecTag with your own unique 3 to 5 character OFPEC Tag identifier.

Immediately after the above header section code, you'll begin adding declarations for your OFP music, sound and or radio files. The following example shows one of each audio file type declaration defined:

class CfgMusic
{
    access=1;
    class Amore_ofpecTag_anyName1
    {
        name="Amore_ofpecTag_anyName1";
        sound[]={"\Amore\ofpecTag\Music\audioFileName.ogg",1.000000,1.000000};
    };
};

class CfgSounds
{
    access=1;
    class Amore_ofpecTag_anyName2
    {
        name="Amore_ofpecTag_anyName2";
        sound[]={"\Amore\ofpecTag\Sound\audioFileName.audioFileType",1.000000,1.000000};
        titles[]={};
    };
};

class CfgEnvSounds
{
    access=1;
    class Amore_ofpecTag_anyName3
    {
        name="Amore_ofpecTag_anyName3";
        sound[]={"\Amore\ofpecTag\Sound\audioFileName.audioFileType",1.000000,1.000000};
        titles[]={};
    };
};

class CfgSFX
{
    access=1;
    class Amore_ofpecTag_anyName4
    {
        name="Amore_ofpecTag_anyName4";
        sound[]={"\Amore\ofpecTag\Sound\audioFileName.audioFileType",1.000000,1.000000};
        titles[]={};
    };
};

class CfgRadio
{
    access=1;
    class Amore_ofpecTag_anyName5
    {
        name="Amore_ofpecTag_anyName5";
        sound[]={"\Amore\ofpecTag\Radio\audioFileName.audioFileType",1.000000,1.000000};
        titles[]={};
    };
};

 

Note that the class and name statement values in each entry, Amore_ofpecTag_anyName1/2/3/4/5, are always equivalent. This value is the name that mission makers will use to access that specific audio file in their missions. anyName1/2/3/4/5 can be any arbitrary name you choose. However, it should be something simple yet relevant (e.g., Track1, USAnthem, VoiceAtTheLZ, RadioAllClear, etc.)

audioFileName.audioFileType is the audio file's actual name. Valid OFP audioFileTypes are OGG, WAV and WSS. Mission makers never refer to the audio file's actual name.

Look carefully and you'll notice that different audio files are located in separate subfolders within the AMORE Contributor's folder. There are Music, Sound and Addon subfolders. Files defined by CfgMusic entries should be located in the Music subfolder. Files defined by CfgSounds, CfgEnvSounds and CfgSFX entries should be located in the Sound subfolder. Files defined by CfgRadio entries should be located in the Radio subfolder.

Using the above, the following is an example of a vaild AMORE config.cpp file:

class CfgPatches
{
    class Amore_Avon
    {
        units[] = {};
        weapons[] = { };
        worlds[] = { };
        requiredVersion = 1.00;
    };
};
class CfgMusic
{
    access=1;
    class Amore_Avon_RedOctoberTheme
    {
        name="Amore_Avon_RedOctoberTheme";
        sound[]={"\Amore\Avon\Music\redoct.ogg",1.000000,1.000000};
    };
};
class CfgSounds
{
    access=1;
    class Amore_Avon_DiveAlarm
    {
        name="Amore_Avon_DiveAlarm";
        sound[]={"\Amore\Avon\Sound\subdive.ogg",1.000000,1.000000};
        titles[]={};
    };
};
class CfgEnvSounds
{
    access=1;
    class Amore_Avon_Sonar
    {
        name="Amore_Avon_Sonar";
        sound[]={"\Amore\Avon\Sound\subsonar.wav",1.000000,1.000000};
        titles[]={};
    };
};
class CfgSFX
{
    access=1;
    class Amore_Avon_TorpedoOut
    {
        name="Amore_Avon_TorpedoOut";
        sound[]={"\Amore\Avon\Sound\torptubeout.ogg",1.000000,1.000000};
        titles[]={};
    };
};
class CfgRadio
{
    access=1;
    class Amore_Avon_Fire1
    {
        name="Amore_Avon_Fire1";
        sound[]={"\Amore\Avon\Radio\torpfire1.wav",1.000000,1.000000};
        titles[]={};
    };
};

 

To create the AMORE Addon File from the above config.cpp file, you would save the config.cpp file in a folder named Amore_Avon (using my OFPEC Tag for this example) and then run a utility such as PBOTool (available from this FAQ item) to create the actual AMORE Addon file, named Amore_Avon.PBO in our example here.

It's all nice and sweet that it takes very little to produce such the AMORE Addon File. What's most important, however, is that it works. Make sure you've tested out the use of all the defined audio files in OFP, using the definitions defined in your AMORE Addon File file, before you release your AMORE Multimedia Installer(s) and your AMORE Addon File to the public.

Should you decide to release additional AMORE Multimedia Installers in the future, just keep updating your config.cpp file to include definitions for the new entries and repack it as a PBO with the same name as your original AMORE Addon File.