RUG DSAI

From Bohemia Interactive Community
Revision as of 21:30, 11 March 2008 by Wolfrug (talk | contribs)
Jump to navigation Jump to search

a Cooperation by WolfRUG and 6thSense.eu

6thSense.eu Presents: Dynamic Speaking AI (By WolfRUG and Sickboy)

Features



Installation



Customizing

Settings



Creating Custom Voices Pack


Creating a custom voices pack with RUG DSAI is fairly simple as long as you have a basic understanding of configs, pbo-packing and, of course, sound editing. The easiest way to learn is simply to open up one of the existing language packs and poke around : excepting the core RUG_DSAI.pbo file, they all follow the same pattern. Basically all the files in the .pbo need to be changed for an entirely new language pack, but the easiest way to do it is by editing an existing pack. Here's a step-by-step manual which describes the function and the needed changes within each file of the pack:

Addon.h #define RUG_WANTEDSIDE {"WEST", "GUER"}; #define RUG_ADDON RUG_DSAIENG #define RUG_ADDON_STR "RUG_DSAIENG" #define GENERAL_SPEECH_SOUND_LEVEL db-25 #define GENERAL_SPEECH_SOUND_LEVEL2 db-20 #define GENERAL_SPEECH_SOUND_LEVEL3 db-40

The addon.h is just a file that is included in the main config.cpp. You need to change the defines for RUG_ADDON and RUG_ADDON_STR to comply with yours : for instance RUG_DSAI_TAG_LANGUAGE. Make the string and the addon-name identical. The GENERAL_SPEECH_SOUND_LEVEL defines decide how far your sounds are heard - more about this later. By default, the first (no number) is for "normal" speech, the second is for shouted (i.e. combat taunts) sounds, and the third for very low sounds (coughs, hums, stealth etc.). RUG_WANTEDSIDE is an array which needs to contain two strings: "WEST", "EAST", "GUER" or "CIV" are the possible entries. The first entry ("WEST") is the first choice, the second ("GUER") the alternative if the first is already taken. Note that you can't force the scripts to pick your sound pack out of all installed - the only way to make your take precedence is by instructing the users not to have the other packs loaded.

#include "addon.h" class CfgPatches { class RUG_ADDON { units[] = {}; weapons[] = {}; requiredVersion = 1.08; requiredAddons[] = {"CAData", "CASounds", "Extended_Init_Eventhandlers", "RUG_DSAI"}; }; }; class RUG_DSAI { class Languages { class RUG_ADDON { wantedSide[] = RUG_WANTEDSIDE }; }; }; class CfgSounds { // RUG_DSAI sounds #include "RUG_DSAI\DSAI_BehaviourSounds.h" #include "RUG_DSAI\DSAI_FleeingSounds.h" #include "RUG_DSAI\DSAI_WoundedSounds.h" #include "RUG_DSAI\DSAI_OwnKilledSounds.h" #include "RUG_DSAI\DSAI_EnemyKilledSounds.h" #include "RUG_DSAI\DSAI_MiscSounds.h" #include "RUG_DSAI\DSAI_ContactSounds.h" #include "RUG_DSAI\DSAI_UnderFireSounds.h" //CAM DSAI Extension #include "RUG_DSAI\CAMSoundsUSBehaviour.h" #include "RUG_DSAI\CAMSoundsUSContact.h" #include "RUG_DSAI\CAMSoundsUSFleeing.h" };

This is the proper config.cpp, which is vital to the proper functioning of your pack. Notice the inclusion of the addon.h at the top. The only part you need to edit here is the cfgSounds section. Depending on how complete your soundpack is, you might want to edit out certain of the sound files used. For instance, you've only got sounds for behavioural modes and wounded - then you remove all the other sound types. The includes point towards .h files that reside in the appropriate folder in your addon - make sure these match up. If your pack is very small, you could also just put the sound definitions straight into the config here, but that is not advised since it makes for very ugly text.


// Define the addon, name must comply with cfgPatches and pbo name #include "addon.h" RUG_ADDON = [ call compile loadfile ("\"+RUG_ADDON_STR+"\RUG_DSAI\DSAI_Behaviour.sqf"), // RUG_DSAI_Behaviour - 0 call compile loadfile ("\"+RUG_ADDON_STR+"\RUG_DSAI\DSAI_Fleeing.sqf"), // RUG_DSAI_Fleeing - 1 call compile loadfile ("\"+RUG_ADDON_STR+"\RUG_DSAI\DSAI_Wounded.sqf"), // RUG_DSAI_Wounded - 2 call compile loadfile ("\"+RUG_ADDON_STR+"\RUG_DSAI\DSAI_OwnKilled.sqf"), // RUG_DSAI_OwnKilled - 3 call compile loadfile ("\"+RUG_ADDON_STR+"\RUG_DSAI\DSAI_EnemyKilled.sqf"), // RUG_DSAI_EnemyKilled - 4 call compile loadfile ("\"+RUG_ADDON_STR+"\RUG_DSAI\DSAI_Misc.sqf"), // RUG_DSAI_Misc - 5 call compile loadfile "\RUG_DSAIGen\RUG_DSAI\DSAI_Generic.sqf", // RUG_DSAI_Generic - 6 call compile loadfile ("\"+RUG_ADDON_STR+"\RUG_DSAI\DSAI_Contact.sqf"), // RUG_DSAI_Contact - 7 call compile loadfile ("\"+RUG_ADDON_STR+"\RUG_DSAI\DSAI_UnderFire.sqf") // RUG_DSAI_UnderFire - 8 ];

This is the file named RUG_DSAILANGUAGE_Init.sqf found in the main folder. Please name the script accordingly, substituting ENG/LANUAGE with your own pack's name. This script simply loads the various scripts used, and compiles the lists of sounds used. If you do not have sounds for for instance OwnKilled, simply give it an empty array instead of the call compile loadfile : []. Example from russian config:

// Define the addon, name must comply with cfgPatches and pbo name #include "addon.h" RUG_ADDON = [ call compile loadfile ("\"+RUG_ADDON_STR+"\RUG_DSAI\DSAI_Behaviour.sqf"), // RUG_DSAI_Behaviour - 0 [], // RUG_DSAI_Fleeing - 1 [], // RUG_DSAI_Wounded - 2 [], // RUG_DSAI_OwnKilled - 3 [], // RUG_DSAI_EnemyKilled - 4 [], // RUG_DSAI_Misc - 5 call compile loadfile "\RUG_DSAIGen\RUG_DSAI\DSAI_Generic.sqf", // RUG_DSAI_Generic - 6 [], // RUG_DSAI_Contact - 7 [] // RUG_DSAI_UnderFire - 8 ];


Changelog

  • v0.2
    • Full optimization overhaul by Sickboy
  • v0.1 - Initial Version