Jump to content
Sign in to follow this  
Zombitch

Say function playing sound but not displaying text

Recommended Posts

Hey guys,

I'm facing a new problem.

I am using the say function to make a NPC speaking, this works great but I would like that when the character speak it write the text he say on the screen (for the player).

So here is what I ve done :

In the description.ext file I added this :

class CfgSounds
{
sounds[] = {willEnableLightHouseSound};
class willEnableLightHouseSound
{
	name = "willEnableLightHouseSound";
	sound[] = {"willEnableLightHouse.ogg", 1, 1};
	titles[] = {"Wait here some seconds, I will check the lighthouse."};
};
};

And I activate the sound doing this :

theCharacter say "willEnableLightHouseSound";

But as I said, the sound play but the text do not display on screen.

Can you help please ?

Thanks ;)

Edited by Zombitch

Share this post


Link to post
Share on other sites
maybe try:

title = "text";

thats the line atleast for CfgRadios

I tried this but when I start the mission it tells me their is an error :

No title entry for CfgSounds.

Any idea ?

Thanks anyway

Share this post


Link to post
Share on other sites

You could try:

theCharacter say ["willEnableLightHouseSound", 15];

The '15' is the range in meters than the titles will be displayed. I do not know what the default is, so you might have been out of range.

Share this post


Link to post
Share on other sites

Hello Zenophon,

I tried to do what you said (setting a 50m range) but the problem is the same :(

Other ideas ? :p

Edited by Zombitch

Share this post


Link to post
Share on other sites

I have got it working (in dev branch) using these steps:

Make a new mission in the editor with two blufor soldiers exactly 100 meters apart. One is the player, the other named 'Y'. They are not grouped.

In the description.ext, copy this:

class CfgSounds {
   sounds[] = {Test};
   class Test {
       name = "Test";
       sound[] = {"Test.ogg", 1, 1};
       titles[] = {0, "Test"};
   };
};

In the debug console in game, execute this:

Y say ["Test", 101];

Using 99 as the number does not work, and using 101 does, so the game is very strict about range. There is no 'test.ogg' file in the mission, so that cannot be an issue. I added a '0' in front of the string in the titles[] array, according to this guide:

http://ofp.toadlife.net/downloads/tutorials/tutorial_sound/tutorial_sound.html

Lastly, remember to save the mission every time you change the description.ext to reload it.

Share this post


Link to post
Share on other sites
I added a '0' in front of the string in the titles[] array,

Thanks a lot, it's working. I added the 0 as a first element in titles array (as you did) and it makes it works.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×