Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making an Introduction & more
T122002 Offline
Junior Member

Posts: 24
Threads: 10
Joined: Dec 2012
Reputation: 1
#1
Making an Introduction & more

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.
04-22-2013, 03:51 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Making an Introduction & more

For the commentary, use
PHP Code: (Select All)
AddEffectVoice(stringasVoiceFilestringasEffectFilestringasTextCatstringasTextEntry,
bool abUsePositionstringasPosEntityfloat afMinDistancefloat afMaxDistance); 
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,
PHP Code: (Select All)
void OnStart()
{
PlrWalkFadeOut();
}

void PlrWalkFadeOut()
{
FadeOut(0);
FadeIn(0.5f);
AddTimer(""3.0f"PlrWalk");
}

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.)
04-22-2013, 08:40 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#3
RE: Making an Introduction & more

JustAnotherPlayer beat me again. Posted anyways Tongue
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:
void OnStart()
{
StartPlayerLookAt("lookatthisareafirst", 6, 6, "");
AddTimer("", 3.0f, "FadeIn1");
FadeOut(0.001f);
}

void FadeIn1(string &in asTimer)
{        
FadeIn(3.0f);
AddTimer("", 6.0f, "FadeOut1");
}

void FadeOut1(string &in asTimer)
{
FadeOut(3.0f);
StartPlayerLookAt("lookatthisareafirst", 6, 6, "");
AddTimer("", 6.0f, "FadeIn2");
}

void FadeIn2(string &in asTimer)
{
FadeIn(3.0f);
TeleportPlayer("SecondIntro");
}
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 Tongue

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:
PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
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.

So an example of this code would be:
PlayMusic("callmemaybe_carly.ogg", false, 1.0f, 1.0f, 1, false);

If I put this into the OnStart()

void OnStart()
{
PlayMusic("callmemaybe_carly.ogg", false, 1, 1, 1, false);
}

I would assume Call Me Maybe by Carly Rae Jepsen would play when the game starts.

Sound files are similar, but are called differently.
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

And what THIS gibberish means is this:

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.

PlaySoundAtEntity("thesound", "mgs1bleep.snt", "Player", 1.0f , false);

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 Smile

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 04-22-2013, 08:49 AM by Romulator.)
04-22-2013, 08:48 AM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#4
RE: Making an Introduction & more

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:
<Flashback>
    <Voices>
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlaguebs_01.ogg" EffectSound="fb_sfx_19_false_dead02.ogg" TextCat="" TextEntry="" />
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlague_04.ogg" EffectSound="" TextCat="Flashbacks" TextEntry="CH02L19_FalseDeadPlague_04" />
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlague_05.ogg" EffectSound="" TextCat="Flashbacks" TextEntry="CH02L19_FalseDeadPlague_05" />
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlague_06.ogg" EffectSound="" TextCat="Flashbacks" TextEntry="CH02L19_FalseDeadPlague_06" />
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlague_07.ogg" EffectSound="" TextCat="Flashbacks" TextEntry="CH02L19_FalseDeadPlague_07" />
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlaguebs_01.ogg" EffectSound="" TextCat="" TextEntry="" />
    </Voices>
</Flashback>

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
PHP Code: (Select All)
AddEffectVoice("CH02L15_Alexander_01""""Voice""CH02L15_Alexander_01"false""0.0f0.0f); 

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?
04-22-2013, 10:37 AM
Find
T122002 Offline
Junior Member

Posts: 24
Threads: 10
Joined: Dec 2012
Reputation: 1
#5
RE: Making an Introduction & more

(04-22-2013, 08:40 AM)JustAnotherPlayer Wrote: For the commentary, use
PHP Code: (Select All)
AddEffectVoice(stringasVoiceFilestringasEffectFilestringasTextCatstringasTextEntry,
bool abUsePositionstringasPosEntityfloat afMinDistancefloat afMaxDistance); 
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,
PHP Code: (Select All)
void OnStart()
{
PlrWalkFadeOut();
}

void PlrWalkFadeOut()
{
FadeOut(0);
FadeIn(0.5f);
AddTimer(""3.0f"PlrWalk");
}

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 Tongue
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:
void OnStart()
{
StartPlayerLookAt("lookatthisareafirst", 6, 6, "");
AddTimer("", 3.0f, "FadeIn1");
FadeOut(0.001f);
}

void FadeIn1(string &in asTimer)
{        
FadeIn(3.0f);
AddTimer("", 6.0f, "FadeOut1");
}

void FadeOut1(string &in asTimer)
{
FadeOut(3.0f);
StartPlayerLookAt("lookatthisareafirst", 6, 6, "");
AddTimer("", 6.0f, "FadeIn2");
}

void FadeIn2(string &in asTimer)
{
FadeIn(3.0f);
TeleportPlayer("SecondIntro");
}
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 Tongue

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:
PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);
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.

So an example of this code would be:
PlayMusic("callmemaybe_carly.ogg", false, 1.0f, 1.0f, 1, false);

If I put this into the OnStart()

void OnStart()
{
PlayMusic("callmemaybe_carly.ogg", false, 1, 1, 1, false);
}

I would assume Call Me Maybe by Carly Rae Jepsen would play when the game starts.

Sound files are similar, but are called differently.
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

And what THIS gibberish means is this:

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.

PlaySoundAtEntity("thesound", "mgs1bleep.snt", "Player", 1.0f , false);

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 Smile

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. Big Grin

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:
<Flashback>
    <Voices>
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlaguebs_01.ogg" EffectSound="fb_sfx_19_false_dead02.ogg" TextCat="" TextEntry="" />
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlague_04.ogg" EffectSound="" TextCat="Flashbacks" TextEntry="CH02L19_FalseDeadPlague_04" />
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlague_05.ogg" EffectSound="" TextCat="Flashbacks" TextEntry="CH02L19_FalseDeadPlague_05" />
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlague_06.ogg" EffectSound="" TextCat="Flashbacks" TextEntry="CH02L19_FalseDeadPlague_06" />
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlague_07.ogg" EffectSound="" TextCat="Flashbacks" TextEntry="CH02L19_FalseDeadPlague_07" />
        <Voice VoiceSound="flashbacks/CH02L19_FalseDeadPlaguebs_01.ogg" EffectSound="" TextCat="" TextEntry="" />
    </Voices>
</Flashback>

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
PHP Code: (Select All)
AddEffectVoice("CH02L15_Alexander_01""""Voice""CH02L15_Alexander_01"false""0.0f0.0f); 

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.)
04-22-2013, 05:05 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#6
RE: Making an Introduction & more

(04-22-2013, 05:05 PM)T122002 Wrote:
(04-22-2013, 08:40 AM)JustAnotherPlayer Wrote: For the commentary, use
PHP Code: (Select All)
AddEffectVoice(stringasVoiceFilestringasEffectFilestringasTextCatstringasTextEntry,
bool abUsePositionstringasPosEntityfloat afMinDistancefloat afMaxDistance); 
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,
PHP Code: (Select All)
void OnStart()
{
PlrWalkFadeOut();
}

void PlrWalkFadeOut()
{
FadeOut(0);
FadeIn(0.5f);
AddTimer(""3.0f"PlrWalk");
}

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.

"Veni, vidi, vici."
"I came, I saw, I conquered."
04-23-2013, 05:56 AM
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#7
RE: Making an Introduction & more

(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. Big Grin

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:

Spoiler below!

<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="thesoundfile.ogg" />
</Main>
</SOUNDS>
<PROPERTIES Volume="1" MinDistance="1" MaxDistance="10" Random="0" Interval="0" FadeEnd="True" FadeStart="False" Stream="False" Loop="False" Use3D="True" Blockable="True" BlockVolumeMul="0.7" Priority="1" />
</SOUNDENTITY>


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. Smile

If any of MY code is not understandable, send me a personal message or comment below.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
04-23-2013, 07:36 AM
Find
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#8
RE: Making an Introduction & more

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.)
04-23-2013, 07:44 PM
Find




Users browsing this thread: 1 Guest(s)