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.)
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!
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: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.
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); 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)RaideX Wrote: You forgot to use the function to fade the screen to normal again
You should change your code to something similar to this:
void OpeningIntro(string &in asTimer) { AddEffectVoice("record_music.ogg", "EffectToPlay", "TextCategory", "TextEntry", true, "TheEntityWhereTheSoundOriginates", 1, 10); 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
Could help me with something else please, I want to make it that when you enter a certain area a message pops up.
Quote:Thanks so much, dude. It works now
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 . For you other question i'll try to explain it as easy as the first one c:
OnStart() { AddEntityCollideCallback("Player", "CollideArea", "CollideFunction", true, 1) //When "Player" collides with "CollideArea" the "CollideFunction" is called and the area gets disabled (true) when you enter it (1) }
void CollideFunction (string &in asParent, string &in asChild, int 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.)