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
How to make an intro?
goodcap Offline
Member

Posts: 193
Threads: 112
Joined: Jun 2012
Reputation: 3
#1
How to make an intro?

This is what I want to do.

When you click start, you see just a black screen and you hear a voice telling something about the story with some backround music, then the blackness fades out and the game begins.

How do I make this happen?


Thanks
(This post was last modified: 11-29-2013, 12:48 PM by goodcap.)
11-29-2013, 12:40 PM
Find
RaideX Offline
Member

Posts: 212
Threads: 33
Joined: May 2013
Reputation: 7
#2
RE: How to make an intro?

this is done pretty simple:

first, under your OnStart() section you code the following

PHP Code: (Select All)
OnStart() {
fadeout(0.0f);
AddTimer("GameBegin"5.0f"GameBeginFunction");
}

void GameBeginFunction (string &in asTimer) {
stuffyouwanttohappen();


The AddTimer is the timer for when you want stuff to happen.

When you want the screen to go normal again, you either do it with an extra timer or you include it in your function somewhere.

I've get something similar in my full conversion, maybe you'r interested but you can take a look if you want. (Added as attachment and you will have to re-save it as a .hps file as i couldn't upload it in that format for some reason)

EDIT: If you have more questions, feel free to ask at any time!


Attached Files
.txt   IntroExample.txt (Size: 1.26 KB / Downloads: 86)

If you don't draw first, you don't get to draw at all... -The False Shepherd
(This post was last modified: 11-29-2013, 01:31 PM by RaideX.)
11-29-2013, 01:29 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#3
RE: How to make an intro?

Here's your script. The Voice must have the Background Music added on it's .ogg file. If I recall correctly.

PHP Code: (Select All)
void OnStart()
{
FadeOut(0);
AddTimer("Opening"5.0f"OpeningIntro"); //5.0f is how long the voice will start
}

void OpeningIntro(string &in asTimer)
{
AddEffectVoice("VoiceFile.ogg""EffectToPlay""TextCategory""TextEntry"true"TheEntityWhereTheSoundOriginates"110);


"Veni, vidi, vici."
"I came, I saw, I conquered."
11-29-2013, 01:52 PM
Find
goodcap Offline
Member

Posts: 193
Threads: 112
Joined: Jun 2012
Reputation: 3
#4
RE: How to make an intro?

(11-29-2013, 01:52 PM)JustAnotherPlayer Wrote: Here's your script. The Voice must have the Background Music added on it's .ogg file. If I recall correctly.

PHP Code: (Select All)
void OnStart()
{
FadeOut(0);
AddTimer("Opening"5.0f"OpeningIntro"); //5.0f is how long the voice will start
}

void OpeningIntro(string &in asTimer)
{
AddEffectVoice("VoiceFile.ogg""EffectToPlay""TextCategory""TextEntry"true"TheEntityWhereTheSoundOriginates"110);


Okay, everything works except for the fade in. The game starts out with a black screen and the voice starts. that works, but after the voice the screen continue to be black. What did I forget?

void OnStart()
{
FadeOut(0);
AddTimer("Opening", 5.0f, "OpeningIntro"); //5.0f is how long the voice will start
}

void OpeningIntro(string &in asTimer)
{
AddEffectVoice("record_music.ogg", "EffectToPlay", "TextCategory", "TextEntry", true, "TheEntityWhereTheSoundOriginates", 1, 10);
}
(This post was last modified: 11-30-2013, 05:50 PM by goodcap.)
11-30-2013, 05:49 PM
Find
RaideX Offline
Member

Posts: 212
Threads: 33
Joined: May 2013
Reputation: 7
#5
RE: How to make an intro?

You forgot to use the function to fade the screen to normal again Big Grin
You should change your code to something similar to this:
PHP Code: (Select All)
void OnStart()
{
FadeOut(0);
AddTimer("Opening"5.0f"OpeningIntro");
}

void OpeningIntro(string &in asTimer)
{
AddEffectVoice("record_music.ogg""EffectToPlay""TextCategory""TextEntry"true"TheEntityWhereTheSoundOriginates"110);
AddTimer("EndOpening"x.xf"FadeIn"); //x.x depends on how long your intro is (time till fadein starts)
}
void FadeIn (string &in asTimer) {
FadeIn(x.xf); //x.x is how long it takes to go from black to normal

Hope understand everything i've written. I tried explaining it a bit simple c:

If you don't draw first, you don't get to draw at all... -The False Shepherd
(This post was last modified: 11-30-2013, 08:02 PM by RaideX.)
11-30-2013, 08:01 PM
Find
goodcap Offline
Member

Posts: 193
Threads: 112
Joined: Jun 2012
Reputation: 3
#6
RE: How to make an intro?

(11-30-2013, 08:01 PM)RaideX Wrote: You forgot to use the function to fade the screen to normal again Big Grin
You should change your code to something similar to this:
PHP Code: (Select All)
void OnStart()
{
FadeOut(0);
AddTimer("Opening"5.0f"OpeningIntro");
}

void OpeningIntro(string &in asTimer)
{
AddEffectVoice("record_music.ogg""EffectToPlay""TextCategory""TextEntry"true"TheEntityWhereTheSoundOriginates"110);
AddTimer("EndOpening"x.xf"FadeIn"); //x.x depends on how long your intro is (time till fadein starts)
}
void FadeIn (string &in asTimer) {
FadeIn(x.xf); //x.x is how long it takes to go from black to normal

Hope understand everything i've written. I tried explaining it a bit simple c:

Thanks so much, dude. It works now Smile
Could help me with something else please, I want to make it that when you enter a certain area a message pops up.
12-01-2013, 12:32 AM
Find
RaideX Offline
Member

Posts: 212
Threads: 33
Joined: May 2013
Reputation: 7
#7
RE: How to make an intro?

Quote:Thanks so much, dude. It works now Smile
Could help me with something else please, I want to make it that when you enter a certain area a message pops up.

Glad it worked Big Grin. For you other question i'll try to explain it as easy as the first one c:

PHP Code: (Select All)
OnStart() {
AddEntityCollideCallback("Player""CollideArea""CollideFunction"true1)
//When "Player" collides with "CollideArea" the "CollideFunction" is called and the area gets disabled (true) when you enter it (1)
}

void CollideFunction (string &in asParentstring &in asChildint alState) {
SetMessage("TextCategory""TextEntry"x.xf); 
//"TextCategory" is the category in your .lang file and "TextEntry" the entry. x.xf is how long it should be displayed (0 means auto calculate)


Regarding the .lang file: You basically have to write your text in this file and tell the game then where to get the text to display from.

Oh and of course you will have to create the "CollideArea" with the level editor, just in case you didn't know.

EDIT: You can also get EVERYTHING you want to code on this site.

If you don't draw first, you don't get to draw at all... -The False Shepherd
(This post was last modified: 12-01-2013, 10:53 AM by RaideX.)
12-01-2013, 10:50 AM
Find




Users browsing this thread: 1 Guest(s)