Frictional Games Forum (read-only)
Tape Recorder PlaySoundAtEntity - Solved - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Tape Recorder PlaySoundAtEntity - Solved (/thread-24621.html)



Tape Recorder PlaySoundAtEntity - Solved - MsHannerBananer - 02-14-2014

Okay. So. I don't know how I'd go about doing this scripting at all.

The idea is to have a tape recorder play back a recording with several lines of dialogue (with interchanging subtitles as well).

I have a vague idea on how this kind of script could be set up, but I'm just not sure.

Obviously the tape recorder would have an interact callback, and then the function inside the callback would be where the lines of dialogue and the subtitles are put.

I don't like asking for people to write up the complete script for me, as I usually have it started and just need a few lines of help, but it would help me a lot if someone could.

Thanks guys! Big Grin


RE: Tape Recorder PlaySoundAtEntity - Mudbill - 02-14-2014

It's quite simple. Firstly, you'll need to separate your dialogue files into each chunk you want the subtitles to appear at individually (for example each sentence). After that, you'll just add the
Code:
AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry,
bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance);
script. Add one for each chunk you have.

For example like this:

Code:
void InteractCallback(string &in asEntity)
{
    AddEffectVoice("con01_01", "", "Dialogue", "Entry01_01",
true, asEntity, 5, 15);
    AddEffectVoice("con01_02", "", "Dialogue", "Entry01_02",
true, asEntity, 5, 15);
    AddEffectVoice("con01_03", "", "Dialogue", "Entry01_03",
true, asEntity, 5, 15);
}

The first parameter is the sound file, the fourth is the subtitle .lang entry. Otherwise it's up to you to change anything. Personally I'd use a for-loop to do this, but it would result in the exact same as what's above.

I do have a lengthy video which could explain things more if you're interested.
Spoiler below!






RE: Tape Recorder PlaySoundAtEntity - MsHannerBananer - 02-15-2014

(02-14-2014, 09:20 AM)Mudbill Wrote: It's quite simple. Firstly, you'll need to separate your dialogue files into each chunk you want the subtitles to appear at individually (for example each sentence). After that, you'll just add the
Code:
AddEffectVoice(string& asVoiceFile, string& asEffectFile, string& asTextCat, string& asTextEntry,
bool abUsePosition, string& asPosEntity, float afMinDistance, float afMaxDistance);
script. Add one for each chunk you have.

For example like this:

Code:
void InteractCallback(string &in asEntity)
{
    AddEffectVoice("con01_01", "", "Dialogue", "Entry01_01",
true, asEntity, 5, 15);
    AddEffectVoice("con01_02", "", "Dialogue", "Entry01_02",
true, asEntity, 5, 15);
    AddEffectVoice("con01_03", "", "Dialogue", "Entry01_03",
true, asEntity, 5, 15);
}

The first parameter is the sound file, the fourth is the subtitle .lang entry. Otherwise it's up to you to change anything. Personally I'd use a for-loop to do this, but it would result in the exact same as what's above.

I do have a lengthy video which could explain things more if you're interested.
Spoiler below!




Thanks so much Mudbill!! I watch your videos on youtube and you actually helped me do a lot of my stuff with Amnesia scripting! I hope you never stop making them!! Big Grin