Jump to content
Sign in to follow this  
Oglesbee

AI say a custom sound

Recommended Posts

Hi I ran search and either didn't use the right keywords on this.

My issue

I am creating a intro where i want two AI to have a conversation. I have created a sound and converted to .ogg. I followed the instructions to create a wave to lip file.

however I cannot get the sound to play. I initially had a problem with it not finding the sound and got the error message. and now it just doesn't want to play it.

Description.ext

class RscText
{
type = CT_STATIC;
idc = -1;
style = ST_MULTI;
colorBackground[] = {0,0,0,0};
colorText[] = {0,0,0,0};
font = "TahomaB";
sizeEx = 0.06;
h = 0.04;
};

class DiagText : RscText
{
colorText[] = {0.9, 0.9, 0.9, 1};
x = 0.00;
y = 0.90;
w = 1.50;
h = 0.2;
lineSpacing = 0.90;
};

class RscTitles
{
Titles[] = { "Diag1","Diag2","Diag3"};

class Diag1
{
idd = -1;
MovingEnable=0;
Duration=2;
FadeIn=1;
FadeOut=1;
Name="Diag1";
Controls[]={"Control01"};
class Control01: DiagText
{
text = "The DieCorp Chronicles";
};
};
class Diag2
{
idd = -1;
MovingEnable=0;
Duration=2;
FadeIn=1;
FadeOut=1;
Name="Diag2";
Controls[]={"Control01"};
class Control01: DiagText
{
text = "Any Similarities to actual people or events is purely coincedence";
};
};
class Diag3
{
idd = -1;
MovingEnable=0;
Duration=2;
FadeIn=1;
FadeOut=1;
Name="Diag3";
Controls[]={"Control01"};
class Control01: DiagText
{
text = "Somewhere in Afghanistan";
};
};
};


class CfgSounds
{
// List of sounds (.ogg files without the .ogg extension)
sounds[] = {bill1};


// Definition for each sound
class bill1
{
name = "bill1";
sound[] = {\sound\bill1.ogg, db + 10, 1.0};
titles[] = {0, ""};
};
};[/Code]

Then I am calling the sound in the cam script here

[Code]Intro.sqs
cutText ["", "BLACK FADED"];
TitleRsc ["Diag1", "PLAIN DOWN"];
~5
TitleRsc ["Diag2", "PLAIN DOWN"];
~5
TitleRsc ["Diag3", "PLAIN DOWN"];
cutText ["", "BLACK IN"];
0 fadesound 0
enableEnvironment false
enableRadio false
_camera= "camera" camcreate [0,0,0]
_camera cameraeffect ["internal","back"]

;=== 11:27:51
_camera camPrepareTarget roger
_camera camPreparePos [1459.46,4726.69,180.49]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera

;=== 11:28:28
_camera camPrepareTarget roger
_camera camPreparePos [1450.92,4909.14,126.85]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 8
@camCommitted _camera


;=== 11:29:09
_camera camPrepareTarget roger
_camera camPreparePos [1255.54,4962.01,161.80]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 8
@camCommitted _camera

;=== 11:29:42
_camera camPrepareTarget roger
_camera camPreparePos [1164.95,4839.30,82.79]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 8
@camCommitted _camera


;=== 11:30:30
_camera camPrepareTarget [1321.96,4818.47,-0.00]
_camera camPreparePos [1280.92,4844.08,2.97]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 8
@camCommitted _camera


;=== 11:31:02
_camera camPrepareTarget [78609.03,-58397.43,-5066.16]
_camera camPreparePos [1307.33,4825.03,1.73]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 6
@camCommitted _camera


;=== 11:31:38
_camera camPrepareTarget [52062.15,-81350.55,1074.03]
_camera camPreparePos [1320.86,4814.54,0.97]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 4
@camCommitted _camera
bill say ["bill1",30];
~10

[color="Red"];=== 11:32:17
_camera camPrepareTarget [56119.17,-75100.65,-24499.84]
_camera camPreparePos [1321.43,4813.91,1.51]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera
~10[/color]

player cameraeffect ["terminate",""back"]
camdestroy _camera
end1=true;
exit;[/Code]

this as you can tell is a problem. My sound file is 2 mb in size. I used goldwave to convert it but I know there is some rules about the sampling and other things that I can't seem to find. Any help would be greatly appreciated or a reroute to the appropriate post.

Edited by Oglesbee

Share this post


Link to post
Share on other sites

Hi there,

one big problem here is that you mixed SQS and SQF in the file.

You should use only SQF, since SQS is obsolete.

~5 becomes sleep 5; and so on.

Rename the file to .sqf and try again with this content:

cutText ["", "BLACK FADED"];
TitleRsc ["Diag1", "PLAIN DOWN"];
sleep 5;
TitleRsc ["Diag2", "PLAIN DOWN"];
sleep 5;
TitleRsc ["Diag3", "PLAIN DOWN"];
cutText ["", "BLACK IN"];
0 fadesound 0;
enableEnvironment false;
enableRadio false;

_camera= "camera" camcreate [0,0,0];
_camera cameraeffect ["internal","back"];

//=== 11:27:51
_camera camPrepareTarget roger;
_camera camPreparePos [1459.46,4726.69,180.49];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0;


//=== 11:28:28
_camera camPrepareTarget roger;
_camera camPreparePos [1450.92,4909.14,126.85];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 8;
sleep 8;


//=== 11:29:09
_camera camPrepareTarget roger;
_camera camPreparePos [1255.54,4962.01,161.80];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 8;
sleep 8;

//=== 11:29:42
_camera camPrepareTarget roger;
_camera camPreparePos [1164.95,4839.30,82.79];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 8;
sleep 8;


//=== 11:30:30
_camera camPrepareTarget [1321.96,4818.47,-0.00];
_camera camPreparePos [1280.92,4844.08,2.97];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 8;
sleep 8;


//=== 11:31:02
_camera camPrepareTarget [78609.03,-58397.43,-5066.16];
_camera camPreparePos [1307.33,4825.03,1.73];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 6;
sleep 6;


//=== 11:31:38
_camera camPrepareTarget [52062.15,-81350.55,1074.03];
_camera camPreparePos [1320.86,4814.54,0.97];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 4;
sleep 4;

bill say ["bill1",30];
sleep 10;

//=== 11:32:17
_camera camPrepareTarget [56119.17,-75100.65,-24499.84];
_camera camPreparePos [1321.43,4813.91,1.51];
_camera camPrepareFOV 0.700;
_camera camCommitPrepared 0;
sleep 10;

player cameraeffect ["terminate","back"];
camdestroy _camera;
end1=true;

I haven't tested it, just converted it to SQF real quick.

Also, make use of the RPT Error File. It logs all errors and you can see what's wrong.

Share this post


Link to post
Share on other sites

I thank you for your help. I ran the code you input and changed the file to an sqf. also the init line where i execute the script from sqs to sqf. When the intro begins it however does not do anything. One question. I thought that camera scripts had to be done in sqs. I am looking now to make sure nothing is messed up in my description.ext. I will attempt to get it to work and re post if I get it working. Again thank you. Okay I ran the code you input after trying to get it to work. I infact rebuilt the script entirely with new cam positions. I get these errors in my rpt.

Error loading control C:\Users\Patrick\Documents\ArmA 2\missions\DyncorpChronicles.Takistan\description.ext/RscTitles/Diag1/Control01/

Suspending not allowed in this context

Error in expression <sleep 5;>

Error position: <sleep 5;>

Error Generic error in expression

Error loading control C:\Users\Patrick\Documents\ArmA 2\missions\DyncorpChronicles.Takistan\description.ext/RscTitles/Diag2/Control01/

Suspending not allowed in this context

Error in expression <sleep 5;>

Error position: <sleep 5;>

Error Generic error in expression

Suspending not allowed in this context

Error in expression <sleep 5;>

Error position: <sleep 5;>

Error Generic error in expression

Error loading control C:\Users\Patrick\Documents\ArmA 2\missions\DyncorpChronicles.Takistan\description.ext/RscTitles/Diag3/Control01/

Suspending not allowed in this context

Error in expression <sleep 10;>

Error position: <sleep 10;>

Error Generic error in expression

this is what i get when I run the script you input. I must also confess I was playing around trying to fix the errors and may have created more.

Edited by Oglesbee

Share this post


Link to post
Share on other sites

No, camera scripts can be sqf. Everything can be and should be sqf. :)

I gave it a shot myself and it worked fine, as far as i can tell - no errors, intro was playing.

Make sure to call the intro.sqf like this:

nul = execVM "intro.sqf";

For the description.ext, please try this cfgSounds block:

class cfgSounds {

sounds[] = {};

class bill1 {
	name = "bill1";
	sound[] = {"sound\bill1.ogg", db+10, 1.0};
	titles[] = {};
};
};

Share this post


Link to post
Share on other sites

okay I called the script properly this time. with

nul = execVM "intro.sqf";

Let me see if i can get this straight. You have to use the above code to call up sqf scripts? If thats the case that would explain quite a bit.

I get no errors this time in my rpt. however the characters lips are moving but no sound is coming out. I am going to re record the voice file and see if it has something to do with the size of the file or how i saved it.

I ran a test on the sound with play sound and a trigger. It plays the audio file. So why would it not be playing it when I call it up in the cam script with the

bill say ["bill1",3]; command

Edited by Oglesbee

Share this post


Link to post
Share on other sites

Yes, that's how you call sqf.

SQF

nul = execVM "script.sqf";

SQS

[] exec "script.sqs";

You can use higher quality for the sound. In my experience the file format isn't really important. You can use 128kbps and 44000hz, no problem with that.

It doesn't even have to be ogg, wav files are working as well. ;)

Share this post


Link to post
Share on other sites

Well thats good news. thanks for the lesson. I still cannot get the sound to play with the say command. Could it be when i disabled the enviroment noise it just mutes them talking? I have created mission with sound before but never a cutscene with someone talking in it. This has me stumped. I even configured the identites for bill and roger got that working. Still no audio but it looks like the lips are moving.

I created a lip file for it. I use a older version right now since i can't dload any patches I wonder if that could be an issue or what. ill have to do some more digging until i come up with something. Thanks for your help and patience.

---------- Post added at 01:57 PM ---------- Previous post was at 01:07 PM ----------

well I am officially a retard. I had the damn fadesound command in the cam script and i never brought the sound back.

So if anyone has this same problem just so you know if you use fadesoud anywhere it can cause this problem

Edited by Oglesbee

Share this post


Link to post
Share on other sites

Oops... Didn't know that, never used fadeSound.

Glad you figured it out. :thumbsup:

Share this post


Link to post
Share on other sites

well I am officially a retard. I had the damn fadesound command in the cam script and i never brought the sound back.

So if anyone has this same problem just so you know if you use fadesoud anywhere it can cause this problem

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  

×