• No results found

5.52 - Using own sounds

In document Arma 3 Editing Guide (Page 129-133)

tracks[]= { Track1,Track2 };

class Track1 {

name = "Track1";

sound[] = {\music\track1.ogg, db+0, 1.0};

};

class Track2 {

name = "Track2";

sound[] = {\musik\track2.ogg, db+0, 1.0};

};

};

// === Sounds ===============================================>

class CfgSounds {

sounds[]= { Artillerie };

class Artillerie {

name = " Artillerie ";

sound[] = {\sounds\ artillerie.ogg, db+0, 1.0};

};

};

5.52 - Using own sounds

Chapter 5

As one can see in the example above, two additional areas for radio and the surround-sound classes have been defined as well.

- Class CFG music - Track list - Class Track1 - Name Track1 - Source,

db = Loudness,

1.0 = Speed of the sound - Hints to the sounds

By using the syntax db, it’s possible to define the loudness of the sound. It’s possible to adjust the sounds here which are too loud or too silent.

The speed option 1.0 defines the speed which is used while the sound will be played. So it’s possible to make some speech samples higher or deeper by playing them slower or faster. But don’t adjust it too high or your character will sound like M. Mouse.

// === Radio/Funk ============================================>

class CfgRadio {

sounds[] = {Funk1};

class Funk1 {

name = "Funk1";

sound[] = {"sound\funk1.ogg", db+5, 1.0};

title = “Das ist ein Funkspruck!;

};

};

// === Environment ============================================>

class CfgSFX {

sounds[] = {};

};

class CfgEnvSounds {

sounds[] = {};

};

class CfgMusic {

tracks[]= { Track1,Track2 };

class Track1 {

name = "Track1";

sound[] = {\music\track1.ogg, db+0, 1.0};

titles[] = { }; };

};

If one wants to play a sound in the editor, the respective sound has to be selected out of the effects sub area of a waypoint or a trigger. To make it work one has to save the mission first. Then the mission needs to be loaded again. Now ArmA©can read out of the new description.ext. You also have the possibility to run those sounds by using a syntax.

playMusic "Track1"

playMusic ["Track1", 30] (Plays Track1 from Second 30) playSound "Artillerie"

Namesay "Soundname"

As already explained, all these sounds can be faded down by changing the respective syntax.

10fadeSound 0.5 10fadeMusic 1 0fadeRadio 0.1

The first value is needed for the time when this option has to appear. The second one is needed to define the loudness of the sound file. The command preLoadSound enables to load the sound into the RAM while the mission is loading

preLoadSound "Track1"

Connecting sounds with text

It's possible to connect a sound with a text which will be displayed right in the moment when the sound plays. There’re two ways to make it work. The first one is to use the Stringtable and define the text as a string. The other way is to enter the text right into the description.ext. Now the text appears when the sound begins to play. This option is actually used for talk and even radio sounds. One can find a example in the script below:

// === Radio ================================================>

class CfgRadio {

sounds[] = {RadioMsg1, RadioMsg2};

class RadioMsg1 {

name = "RadioMsg1";

sound[] = {"\sound\ radiosound1.ogg", db+10, 1.0};

title = "It´s done. I am ready for further orders.";

};

class RadioMsg2 {

name = "RadioMsg2";

sound[] = {"\sound\radiosound2.ogg", db+10, 1.0};

title = {$STR_RADIO_2};

};

};

Play a random sound out of an Array

Even with the sounds it’s possible to create a lot of things per random. A good method is to define all sounds within an Array to get them selected by the Game automatically and randomly later in the mission.

The following example will explain this by using a script. The used sounds don’t need to be defined in the Description.ext because all of them are already defined in the Engine.

The used script can get caused just by using this Syntax:

[] exec “scripts\music.sqs”

Each time when the script will get called, a coincidence sound will be selected and played out of the predefined Array.

Call a random sound without a script

Another, quite well method of the “sounddynamic” will be shown with the now following Syntax example. The only disadvantage is that the user is not really able to select the Sounds by him self.

It’s quite important, that all sounds does have the same name and are numbered at the end of the Title, i.e: Track1, Track2 aso. ArmA©own sounds will be used here again, which are defined as the same Principe like ATrack1 till Atrack27. The Queens Gambits Titles are named from ATrack1 till ATrack9.

The now following Syntax contains a %1 instead of the actual value, which is used as a placeholder only. If this syntax gets caused so the engine will generate a random value out of a pool of numbers from 0 till 27 which will then replace the %1.

playMusic format ["ATrack%1",ceil random 27];

Note: The following entries don’t need a definition in the description.ext – Entries:

WithCare_Smile - WithCare_Suicide - WithCare_War - WithCare_What One can use different sound types of course which will used besides the default music tracks. If these sounds are not yet defined in the engine, so one need to define them into the Description.ext.

The following Syntax example explains all again by using the command Say.

Name1say format ["Help %1",ceil random 3];

Because all generated random values are never be rounded, so they need to be rounded by usingthe ceil command which will round the number up or off. That´s necessary to let the engine know which sound file has to be selected.

_music = ["ATrack1","ATrack6", "ATrack10", "ATrack11", "ATrack12", "ATrack13",

"ATrack14", "ATrack15", "ATrack19", "ATrack22"];

playMusic ( _music select floor(random((count _music) - 0.5 )));

exit;

Chapter 5

It’s possible to set an identity for every unit individually. But that wouldn’t be necessary because it would be a huge effort. So it’s more useful to set the identity for the main characters only.

The identity has to be defined in the description.ext before it can be used in the mission.

To do this, just take a look at the example below.

As one can see, the names are to be freely defined. Only the faces and the voices are predefined. Please make sure that the clasps were set on the correct position in the Description.ext!

If one wants to set the predefined identity to the respective unit, the predefined name has to be written into the init line of the unit.

NamesetIdentity "YourName" or this setIdentity "Mr-Murray"

class CfgIdentities {

class MrMurray {

name = "MrMurray";

face = "Face33";

glasses = "none";

speaker = "Dan";

pitch = 1.00;

};

class Memphisbelle {

name = "Memphisbelle";

face = "Face10";

glasses = "none";

speaker = "Howard";

pitch = 1.00;

};

class Dan {

name = "Dan";

face = "Face22";

glasses = "none";

speaker = "Russell";

pitch = 1.00;

};

};

In document Arma 3 Editing Guide (Page 129-133)

Related documents