Hi everybody! I have a couple questions to ask, I figure I will ask all of them in this thread. Most of the questions are asking about an introduction.
So, I decided that for my story, I want an introduction to explain some of the story or characters thoughts. I want to add commentary for the intro., but I also don't know how to script that. I use Audacity to save it as a .ogg, however, it doesn't work. The intro doesn't have to be something completely dramatic, just something simple.
My question is, before you can even start playing, how would you add commentary and make it so the words of what you're saying show up at the bottom of the screen and they go along with what you're saying. Then when you're done talking and move onto a different sentence, the words will change to the new sentence being said.
During the intro, I want the character to slowly walk to one destination then the screen will slowly fade out, then slowly fade back in with the player being at a completely different location, but are still walking slowly to the required destination. When the character is moving, the actual player has no control of the character, and the character is just walking.
When the character would teleport to a different location during the introduction, that is when I want the commentary to play. And when the screen fades out then back in, a new sentence will be said. And finally when the intro is over, than the actual player will be able to play.
My next question is how to make a flashback effect, does that require walking into a scripted area, than the flashback would happen? How would I make that happen so you can hear the commentary during the effect, then when the commentary is over, the flashback ends.
My final question is, how do I make custom music and sounds? I said earlier that I used Audacity to make it into a .ogg, but when I make a "music" folder inside the custom story folder and place the .ogg file there, it doesn't play in the actual story itself, even when I put it inside the script. And that's the same with sounds, they just don't work.
Hopefully that made sense, and I hope someone can help me figure this thing out.
asVoiceFile - the voice to play asEffectFile - the effect to play asTextCat - the category in the .lang file asTextEntry - the text entry in the .lang file abUsePosition - plays using 3D from the entity, or without 3D asPosEntity - the entity at which the effect appears afMinDistance - minimum distance to see the effect afMaxDistance - maximum distance to see the effect
--------------------------------------------------------
For the fade out and player walk,
void PlrWalk(string &in asTimer) { MovePlayerForward(0.7f); //Change 0.7f to how fast/long you want the player to walk AddTimer("", 0.6f, "PlrWalkLoop"); }
void PlrWalkLoop(string &in asTimer) { AddTimer("", 0.3f, "PlrWalk"); AddTimer("", 3.0f, "FadeOut"); //Change 3.0f to how long you want the player to walk. }
void FadeOut(string &in asTimer) { FadeOut(5.0f); TeleportPlayer("PlayerStartArea_2"); //PlayerStartArea_2 is where the Player will be transported to. It must be a PlayerStart. FadeIn(5.0f); AddTimer("", 3.0f, "FadeOutAgain"); //Change 3.0f to how long you want the Player to walk the second time. }
void FadeOutAgain(string &in asTimer) { FadeOut(3.0f); //Add the AddVoiceEffect thing on the first one. FadeIn(2.0f); RemoveTimer("PlrWalk"); RemoveTimer("PlrWalkLoop"); }
----------------------------------------------
You cannot import then export it without making any changes in Audacity. You have to use a music extension converter.
----
And most perimeters require an .snt file for each .ogg.
"Veni, vidi, vici." "I came, I saw, I conquered."
(This post was last modified: 04-22-2013, 08:55 AM by PutraenusAlivius.)
JustAnotherPlayer beat me again. Posted anyways
Do your best to use us both. We both have not done everything mentioned, but can be a good intro if done well.
Okay, we have a lot here.
I will put the stuff into spoilers as I go.
Introductive commentary
Spoiler below!
Commentary recorded by Audacity and exported as an .ogg file is supposed to work just fine. The code for playing the sound is as follows:
PlayEffectVoice("CH01L00_DanielsMind01_", 1, 1, "IntroSequenceVoiceOver");
//Taken from the first level
Replace the first set of quotation marks with the name of your .ogg file. IntroSequenceVoiceOver is another callback which you can call later, but if you do not need to do that callback, just make it "".
Unfortunately, I cannot find anything on the subtitles :/
Making the character walk in an intro
Spoiler below!
As far as my knowlege of coding in Amnesia goes, I do not know if this is possible. Throughout Amnesia, I do not know if this actually occurs either. What you can do however is make the player focus entirely on one ScriptArea, to make the player assume he/she is to go that way. To make the game fade out, there is simple coding for that too, and teleporting also.
If I was doing what I said above, it would look something like this:
And would continue in a similar fashion to that. You can read about what each does in the wiki =adduseitemcallback]here if you have issues understanding some of the code above.
Commentary playing on FadeIn()
Spoiler below!
Add the code I used in the first spoiler into the code in the second spoiler after FadeIn(3.0f); is called.
Flashbacks
No spoiler because I cannot do these yet
Music and Custom Sounds
Spoiler below!
Let me first warn you, this is a big spoiler
Music is easy. Assuming that like you said, you placed them in a music folder, you can call them into your story with this code:
What this gibberish means is this:
asMusicFile - the music to play + extension .ogg
abLoop - determines whether a music track should loop
afVolume - volume of the music
afFadeTime - time in seconds until music reaches full volume
alPrio - priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.
abResume - if true, playback will be continued from where the track stopped after the call to StopMusic(); if false, the track will be restarted.
asSoundName - internal name
asSoundFile - the sound to use + extension .snt
asEntity - the entity to create the sound at, can be “Player”
afFadeTime - time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f
abSaveSound - if true, a looping sound will “remember” its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If true, the sound is never attached to the entity! Note that saving should only be used on looping sounds!
The main difference is that it calls the .snt of a file, which you just copy and paste from anything which Amnesia calls as the .snt. You just have to edit the stuff in it as if it were in NotePad.
Well, there's more to this question than you think, so I suggest that you take it one step at the time. Tell us what you'd like to do first, so that we can walk you through it.
You'll need to do some scripting - are you familiar with it at least a bit?
In a nutshell, when making your own commentary/subtitles and music and sound, you have to create additional files besides just the sounds themselves. Commentary entries go into the extra_english.lang file, while music and sounds also have files add additional information to the audio itself, to be used by the game (like the .snt files). For commentary and flashbacks, this helps the game use the same code for different languages. For sounds, these files contain information about things like the volume, and how far from the source the sounds can be heard.
These are all just plain text files, using what's called XML format to store this additional data. You can open, view and edit them with plain text editors like Notepad, or Notepad++. (Don't use applications like Word, which support fancy text formatting, because when saved the file itself will not be plain text, but will have formation information embedded into it, and then it will not work.)
Just to give you a quick overview, here's how a .flash (flashback) file looks like:
If you've ever seen a source of a web page, you'll notice that this is somewhat similar to HTML. Basically, you have these tags, which can nest other tags, and contain attributes, etc. When creating your own, you'd probably copy and rename one of the existing files, and then change some details in it so that they correspond to your own assets (and purposes).
extra_english.lang and .snt files have a similar structure, and when using script functions, you normally pass in arguments which refer to the entries in these files.
You could walk through this for a relatively easy intro to XML files, just to get the feel for it.
BTW, you can achieve voiceover/commentary/subtitle effect using the AddEffectVoice function
And flashbacks use Flashback Areas you place in the editor, where you can specify the flashback file.
If you're making an intro-like sequence, you'd also want to know how to take away the control from the player, how to fade in and out, how to teleport player and force the camera to look in a certain direction.
asVoiceFile - the voice to play asEffectFile - the effect to play asTextCat - the category in the .lang file asTextEntry - the text entry in the .lang file abUsePosition - plays using 3D from the entity, or without 3D asPosEntity - the entity at which the effect appears afMinDistance - minimum distance to see the effect afMaxDistance - maximum distance to see the effect
--------------------------------------------------------
For the fade out and player walk,
void PlrWalk(string &in asTimer) { MovePlayerForward(0.7f); //Change 0.7f to how fast/long you want the player to walk AddTimer("", 0.6f, "PlrWalkLoop"); }
void PlrWalkLoop(string &in asTimer) { AddTimer("", 0.3f, "PlrWalk"); AddTimer("", 3.0f, "FadeOut"); //Change 3.0f to how long you want the player to walk. }
void FadeOut(string &in asTimer) { FadeOut(5.0f); TeleportPlayer("PlayerStartArea_2"); //PlayerStartArea_2 is where the Player will be transported to. It must be a PlayerStart. FadeIn(5.0f); AddTimer("", 3.0f, "FadeOutAgain"); //Change 3.0f to how long you want the Player to walk the second time. }
void FadeOutAgain(string &in asTimer) { FadeOut(3.0f); //Add the AddVoiceEffect thing on the first one. FadeIn(2.0f); RemoveTimer("PlrWalk"); RemoveTimer("PlrWalkLoop"); }
----------------------------------------------
You cannot import then export it without making any changes in Audacity. You have to use a music extension converter.
----
And most perimeters require an .snt file for each .ogg.
Okay. The AddVoiceEffect seems much easier than I thought. The PlrWalkFadeOut, is that a function or just something random? XD I couldn't find it at the Engine Scripts Page. It seems that using the "MovePlayerForward" function would be very helpful in this, so can I use that just to make the player move? Or does that function require more, kind of like the AddEnemyPatrolNodes, the player would have to walk in a specific path. Well basically, just walk straight forward.
(04-22-2013, 08:48 AM)ROMul8r Wrote: JustAnotherPlayer beat me again. Posted anyways
Do your best to use us both. We both have not done everything mentioned, but can be a good intro if done well.
Okay, we have a lot here.
I will put the stuff into spoilers as I go.
Introductive commentary
Spoiler below!
Commentary recorded by Audacity and exported as an .ogg file is supposed to work just fine. The code for playing the sound is as follows:
PlayEffectVoice("CH01L00_DanielsMind01_", 1, 1, "IntroSequenceVoiceOver");
//Taken from the first level
Replace the first set of quotation marks with the name of your .ogg file. IntroSequenceVoiceOver is another callback which you can call later, but if you do not need to do that callback, just make it "".
Unfortunately, I cannot find anything on the subtitles :/
Making the character walk in an intro
Spoiler below!
As far as my knowlege of coding in Amnesia goes, I do not know if this is possible. Throughout Amnesia, I do not know if this actually occurs either. What you can do however is make the player focus entirely on one ScriptArea, to make the player assume he/she is to go that way. To make the game fade out, there is simple coding for that too, and teleporting also.
If I was doing what I said above, it would look something like this:
And would continue in a similar fashion to that. You can read about what each does in the wiki =adduseitemcallback]here if you have issues understanding some of the code above.
Commentary playing on FadeIn()
Spoiler below!
Add the code I used in the first spoiler into the code in the second spoiler after FadeIn(3.0f); is called.
Flashbacks
No spoiler because I cannot do these yet
Music and Custom Sounds
Spoiler below!
Let me first warn you, this is a big spoiler
Music is easy. Assuming that like you said, you placed them in a music folder, you can call them into your story with this code:
What this gibberish means is this:
asMusicFile - the music to play + extension .ogg
abLoop - determines whether a music track should loop
afVolume - volume of the music
afFadeTime - time in seconds until music reaches full volume
alPrio - priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, 1 - higher, etc.
abResume - if true, playback will be continued from where the track stopped after the call to StopMusic(); if false, the track will be restarted.
asSoundName - internal name
asSoundFile - the sound to use + extension .snt
asEntity - the entity to create the sound at, can be “Player”
afFadeTime - time in seconds the sound needs to fade. Avoids enemies hearing the sound if afFadeTime is at least 0.1f
abSaveSound - if true, a looping sound will “remember” its playback state (currently playing/stopped), and that state will be restored the next time the level is entered. If true, the sound is never attached to the entity! Note that saving should only be used on looping sounds!
The main difference is that it calls the .snt of a file, which you just copy and paste from anything which Amnesia calls as the .snt. You just have to edit the stuff in it as if it were in NotePad.
And if I did what I did with Carly Rae, this would play the alert sound a guard makes from Metal Gear Solid when he spots Snake.
Comment here if needed
Hmm..okay. I think doing that would be better and much less confusing. I think why I thought the player would walk forward is because whenever a memory happens or commentary starts playing, I always walk forward. So I thought that there was just a script thing for that. But I think looking at specific objects would work much better. I could probably just forget about commentary too if it comes to that, since I've played some great stories w/o commentary (Lost The Lights for example). I can just put down the messages of what the character is saying.
Commentary on FadeIn doesn't seem too difficult, I think I will practice that a little with a test map.
I also figured out how to make the custom music now, thanks! For the custom sounds, do I just save the extension as .snt instead of .ogg?
(04-22-2013, 10:37 AM)TheGreatCthulhu Wrote: Well, there's more to this question than you think, so I suggest that you take it one step at the time. Tell us what you'd like to do first, so that we can walk you through it.
You'll need to do some scripting - are you familiar with it at least a bit?
In a nutshell, when making your own commentary/subtitles and music and sound, you have to create additional files besides just the sounds themselves. Commentary entries go into the extra_english.lang file, while music and sounds also have files add additional information to the audio itself, to be used by the game (like the .snt files). For commentary and flashbacks, this helps the game use the same code for different languages. For sounds, these files contain information about things like the volume, and how far from the source the sounds can be heard.
These are all just plain text files, using what's called XML format to store this additional data. You can open, view and edit them with plain text editors like Notepad, or Notepad++. (Don't use applications like Word, which support fancy text formatting, because when saved the file itself will not be plain text, but will have formation information embedded into it, and then it will not work.)
Just to give you a quick overview, here's how a .flash (flashback) file looks like:
If you've ever seen a source of a web page, you'll notice that this is somewhat similar to HTML. Basically, you have these tags, which can nest other tags, and contain attributes, etc. When creating your own, you'd probably copy and rename one of the existing files, and then change some details in it so that they correspond to your own assets (and purposes).
extra_english.lang and .snt files have a similar structure, and when using script functions, you normally pass in arguments which refer to the entries in these files.
You could walk through this for a relatively easy intro to XML files, just to get the feel for it.
BTW, you can achieve voiceover/commentary/subtitle effect using the AddEffectVoice function
And flashbacks use Flashback Areas you place in the editor, where you can specify the flashback file.
If you're making an intro-like sequence, you'd also want to know how to take away the control from the player, how to fade in and out, how to teleport player and force the camera to look in a certain direction.
So, what you wanna do first?
I was told that there wasn't a specific thing for making the player just walk forward...umm..I could probably just make it so that the character is focusing on things, then teleport to a different map and do things there.
I know little about coding, I'm still a n00b at some stuff. Hmm..when you said " <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlague_05.ogg" EffectSound="" TextCat="Flashbacks" TextEntry="CH02L19_FalseDeadPlague_05" />
<Voice "
Can I change the name so it's not "CH02L19_FalseDeadPlague_05.ogg" to whatever I want?
(i.e.:
VoiceSound="flashback/whateverthenameis.ogg"
EffectSound="" TextCat="Flashbacks"
TextEntry="whateverthenameis.ogg"/>
<Voice"
?
(This post was last modified: 04-22-2013, 05:19 PM by T122002.)
asVoiceFile - the voice to play asEffectFile - the effect to play asTextCat - the category in the .lang file asTextEntry - the text entry in the .lang file abUsePosition - plays using 3D from the entity, or without 3D asPosEntity - the entity at which the effect appears afMinDistance - minimum distance to see the effect afMaxDistance - maximum distance to see the effect
--------------------------------------------------------
For the fade out and player walk,
void PlrWalk(string &in asTimer) { MovePlayerForward(0.7f); //Change 0.7f to how fast/long you want the player to walk AddTimer("", 0.6f, "PlrWalkLoop"); }
void PlrWalkLoop(string &in asTimer) { AddTimer("", 0.3f, "PlrWalk"); AddTimer("", 3.0f, "FadeOut"); //Change 3.0f to how long you want the player to walk. }
void FadeOut(string &in asTimer) { FadeOut(5.0f); TeleportPlayer("PlayerStartArea_2"); //PlayerStartArea_2 is where the Player will be transported to. It must be a PlayerStart. FadeIn(5.0f); AddTimer("", 3.0f, "FadeOutAgain"); //Change 3.0f to how long you want the Player to walk the second time. }
void FadeOutAgain(string &in asTimer) { FadeOut(3.0f); //Add the AddVoiceEffect thing on the first one. FadeIn(2.0f); RemoveTimer("PlrWalk"); RemoveTimer("PlrWalkLoop"); }
----------------------------------------------
You cannot import then export it without making any changes in Audacity. You have to use a music extension converter.
----
And most perimeters require an .snt file for each .ogg.
Okay. The AddVoiceEffect seems much easier than I thought. The PlrWalkFadeOut, is that a function or just something random? XD I couldn't find it at the Engine Scripts Page. It seems that using the "MovePlayerForward" function would be very helpful in this, so can I use that just to make the player move? Or does that function require more, kind of like the AddEnemyPatrolNodes, the player would have to walk in a specific path. Well basically, just walk straight forward.
You can actually create your own functions and such -- meaning that you don't have to use the Engine Scripts page to make one. But you have to learn how to create one first. All you need to do is add PlayerStart areas where the player is transported.
(04-22-2013, 05:05 PM)T122002 Wrote: Hmm..okay. I think doing that would be better and much less confusing. I think why I thought the player would walk forward is because whenever a memory happens or commentary starts playing, I always walk forward. So I thought that there was just a script thing for that. But I think looking at specific objects would work much better. I could probably just forget about commentary too if it comes to that, since I've played some great stories w/o commentary (Lost The Lights for example). I can just put down the messages of what the character is saying.
Commentary on FadeIn doesn't seem too difficult, I think I will practice that a little with a test map.
I also figured out how to make the custom music now, thanks! For the custom sounds, do I just save the extension as .snt instead of .ogg?
Well, assuming it is music; like I said, we call the PlayMusic(); but if we are using sounds, we would use PlaySoundAtEntity();
Sound files are interesting as the game actually calls .snt files as a thing we play around in NotePad. If you open a .snt in Notepad, it would look like this:
What you need to do is change the Sound File to the .ogg file which is the sound effect you want to play, then screw around with properties if you need. This would mean that if I used the above, in one of my music folders, I would find:
thesoundfile.ogg thesoundfile.snt
The filename of the .snt does not necessarily have to be the same as the .ogg, but it does look much neater.
If any of MY code is not understandable, send me a personal message or comment below.
Yeah - basically, most of these "special" (game-specific) files are actually text files with tags like that (XML files). In the case of the snt files, they are used by the game to store additional information about the sound entity, besides just the audio file itself - you can see above, within PROPERTIES, that there's volume, min and max distance from the source of the sound that define where the sound is audible, fading, looping, 3D (positional - stereo/surround), etc.
Whenever you work with a file like that, you change the appropriate values to point to the files from your custom story.
(This post was last modified: 04-23-2013, 07:46 PM by TheGreatCthulhu.)