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
#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


Messages In This Thread
Making an Introduction & more - by T122002 - 04-22-2013, 03:51 AM
RE: Making an Introduction & more - by T122002 - 04-22-2013, 05:05 PM
RE: Making an Introduction & more - by Romulator - 04-23-2013, 07:36 AM
RE: Making an Introduction & more - by Romulator - 04-22-2013, 08:48 AM



Users browsing this thread: 1 Guest(s)