Home   Help Search Login Register  

Author Topic: using OFP's voices  (Read 2672 times)

0 Members and 1 Guest are viewing this topic.

Offline OliverPA

  • Members
  • *
  • I was a llama!
using OFP's voices
« on: 05 Aug 2004, 08:58:28 »
Let me first apologize for posting this very basic question that really should be answered by one of the many sound/voice related posts and tutorials on this and other sites.
However, I've been searchin' and readin' and searchin' some more for many, many hours but the answer still eludes me.

I quite simply want to use the many in-game words, ie. have a character say eg. "don't fire! friendly soldier at 2 o'clock". OFP has all the neccessary voice files, but how can I use them?
Here's what I've learned so far:
To use a sound file with the say/radio commands one needs to define them in description.ext as CfgSounds/Voice or Radio - no problem and easily done. Some of the files in voices.pbo are declared in such a way (eng1,eng2,...) but the majority of files aren't (true?). The in-game CfgVoice declarations define more than 250 words, but their names don't seem to be usable.
I've also tried creating my own sound/voice/radio-classes referencing the in-game sounds, but none of them worked unless I copied the files into the myMission/sounds folder - not acceptable.

Frankly I'm getting quite frustrated because surely the answer can't be all that complicated for a simple task as this.

Offline Hauk

  • Members
  • *
  • I sail under the Jolly Roger!! Pirates are kings!!
Re:using OFP's voices
« Reply #1 on: 06 Aug 2004, 21:28:55 »
Hey Oliver,

What you should do is get a de-PBO'er and de-PBO the 1985 campaign. You'll find all the sound files in there, but it's common practice among mission makers to make your own voice files as it adds uniqueness to a mission.

I can't point you in the way of a de-PBO tool cos I don't know where to find them, but there out there.

Good Luck,

Hauk

Gooner861

  • Guest
Re:using OFP's voices
« Reply #2 on: 06 Aug 2004, 22:36:42 »
Just type "PBO" into the search part of the editors depot. It'll come up with loads of stuff.

Good luck, im trying to work this out as well so were in the same position.

Gooner  ;D

Offline OliverPA

  • Members
  • *
  • I was a llama!
Re:using OFP's voices
« Reply #3 on: 07 Aug 2004, 08:49:34 »
What you should do is get a de-PBO'er and de-PBO the 1985 campaign. You'll find all the sound files in there

All the missions of the 1985 campaign include their own sounds and do not reference the OFP voices.
By now I've extended the ECP config.cpp to include all available voice-sounds (atease, attack, alphabet, numbers,...) which works quite well but is, of course, a terrible solution since a mission really shouldn't require a change of such basic game files. The same CfgSound entries did not work when declared by a description.ext.

Any other ideas?

Offline Hauk

  • Members
  • *
  • I sail under the Jolly Roger!! Pirates are kings!!
Re:using OFP's voices
« Reply #4 on: 07 Aug 2004, 21:32:15 »
Hey Oliver

Sorry I can't come up with anything better than that. What I do recommend is that you post this in the Editing/Scripting:Advanced section, cos I have a post over there and am getting a great response from the community. ;D

Good Luck with that,

Hauk

Offline OliverPA

  • Members
  • *
  • I was a llama!
Re:using OFP's voices
« Reply #5 on: 10 Aug 2004, 22:00:53 »
Well, in case anyone's interested, here's what I've come up with. It's not perfect (size issue) but much better than having no radio...

I extracted the Adam folder from dta\Voice.pbo into the mission folder - 2mb in total :(
The description.ext file declares the sounds as v_fname:
Code: [Select]
class CfgSounds
{
  sounds[] = {...};

  class v_1oclock
  {
    name="1oclock";
    sound[]={"\Voice\Adam\clockfacing\1oclock",0.1,1.0};
    titles[]={0,""};
  };
...
};

Speech output is handled by SpeechDec.sqs:
Code: [Select]
; parameters: [unit, [speech1,...]]
; requirements: isVar
; global variables: SpeechDec_active
; radio message: this is groupname - speech1,... over

_unit = _this select 0;
_inp = ["thisis"] + ([group _unit, true] call getCallsign) + ["pause"] + (_this select 1) + ["over", "over01"];
if(!([SpeechDec_active] call isVar)) then { SpeechDec_active = false; };


#wait
? !SpeechDec_active : goto "begin"
~1
goto "wait"

#begin
SpeechDec_active = true;

_i = 0;
#loop
? _i >= count _inp : goto "done"
playSound ("v_" + (_inp select _i));
_i = _i + 1;
~0.7
goto "loop";

#done
SpeechDec_active = false;
exit;
The 0.7 second interval is a nice compromise. Too large a number will lead to unnaturally long pauses between words, shorter delays may lead to overlapping sounds.
Btw, I chose playSound to prevent multiple radio lines appearing since I don't know of a command that turns off radio text display but allows the speech to be heard.

Usage is rather easy, in fact it seems to be pretty much alike to the way ofp creates speech (look at the RadioProtocol declarations):
_snds = ["contact", "atposition"] + ([_enemypos] call GridCoordToSpeech) + ["pause", "enemy"] + ([_nenemies] call IntToSpeech);
[_leader, _snds] exec "SpeechDec.sqs";
... generates a 'contact'-report.

_snds = ["position"] + ([_pos] call GridCoordToSpeech) + ["pause", "friendly"] + ([count units _group] call IntToSpeech) + ["pause", "enemy"] + ([_nenemies] call IntToSpeech);
[_leader, _snds] exec "SpeechDec.sqs";
... reports group position, group size and number of known enemies.

You can't, of course, generate all too fancy reports with the limited available phrases but it creates a wonderfully chaotic atmosphere once all the teams start reporting in... too bad there's no "maintain radio discipline!" file :)

The attached archive contains the description.ext and the necessary scripts plus some related ones.



Still hoping someone knows a way to reference the sound files without copying them into the mission folder...

LaKing

  • Guest
Re:using OFP's voices
« Reply #6 on: 02 Feb 2005, 18:52:13 »
....

To bad, that noone knows the answer.
The question is well formed, and only some noobish answers.

...

I try to figure out the same thing, but i dont have a batter idea than that either.

That SuX ....THIS MUST BE POSSIBLE

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:using OFP's voices
« Reply #7 on: 03 Feb 2005, 01:19:50 »
Well, I'm 99% certain that, in you description.ext, you can refer to sound files in other .pbo files than your mission. The way this works when configuring addons (or calling scripts from them) is like this:

\pboname\foldername\filename

You can have as many folders as you want, or none at all. So, if to refer to the voices, the path would look something like this:

\voices\adam\fire.ogg

That would refer to the file "fire.ogg" in the folder "adam" in the file "voices.pbo". It sounds like you know what your doing in terms of snooping around in .pbo's and configs, but let me know if you need more explaination.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re:using OFP's voices
« Reply #8 on: 03 Feb 2005, 13:28:06 »
I am 1% certain that you can not.  I tried forever to use OpFL man hit sounds using the mission description.ext, following the classes as defined in the config.cpp from the ECP.  I could not get it to work.  I would love to be proven wrong on this.  I ended up unpbo'ing the sounds and stuffing them in a sound folder for my mission.
urp!

LaKing

  • Guest
Re:using OFP's voices
« Reply #9 on: 31 Mar 2005, 23:02:28 »
I think the problem is that CfgSounds assumes the sounds directory in the mission pbo as root. I think CfgMusic as well.

Here is the only way how i could play adam's roger

description ext code:

class TEST
{
  idd = 100;
  movingEnable = true;
  controlsBackground[] = {};
  objects[] = { };
  controls[] = {TESTA};
 
  class TESTA
  {
   soundEnter[] = {"\voice\adam\roger", 0.2, 1};
   
  x = 0
  y = 0
  idc = 101
  w = 1
  h = 1
  style = ST_CENTER
  colorText[] = {0, 0, 0, 1};
  font = "CourierNewB64"
  SizeEX = 0.025
  text = ""
  action = "closedialog 10"
  type = CT_ACTIVETEXT;
  color[] = {1, 1, 1, 1};
  colorActive[] = {1, 0, 0, 1};
  soundPush[] = {, 0.2, 1};
  soundClick[] = {"ui\ui_ok", 0.2, 1};
  soundEscape[] = {"ui\ui_cc", 0.2, 1};
  default = true;
  };
 
};

I have a console in my map, there i run:

createDialog "TEST"

and i hear adam say roger.

But this is not a workin way, becose i open a dialog.
Even when the next command is closedialog, i get a flashup of the dialog in the screen, + the sound is not played then.

So the problem is, how can i play the sound without the playsound or playmusic command. ???
i guess it should be possible to define some classes and to use soundEnter[] or maybe even sound[].   But what needs to be defined, and what could that class interhit.
And what to call then?

So if anyone has any ideas just post it here ...   ty ty ty