Frictional Games Forum (read-only)

Full Version: Newbie needs help scripting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
i am a first time scripter, and need help making an intro for my custom story, I was testing the FadeOut() method, but it wouldn't work so i am obviously doing something wrong.

my code was :

void OnStart()
{
wake();
}
wake(){
FadeOut(0);
FadeIn(15);

just wanted to test it but i probably need to put it somewhere else.
void OnStart()
{
wake();
}
wake(){
FadeOut(0);
FadeIn(15);


What you're looking for would look like this:
Code:
void OnStart()
{
FadeOut(0);
FadeIn(15);
}

Place your functions inside the curly brackets.
well you didnt make a void command Tongue what has the player to do to let it happen? wait 15sec, walk in a certain area, pick something up?

if you want to start scripting, look atleast at wiki site for beginner explenation Smile and when you still don't understand you could ask here Wink

scripting help : http://wiki.frictionalgames.com/hpl2/tut...s%3Ascript
(03-30-2011, 10:04 PM)nkmol Wrote: [ -> ]well you didnt make a void command Tongue what has the player to do to let it happen? wait 15sec, walk in a certain area, pick something up?

if you want to start scripting, look atleast at wiki site for beginner explenation Smile and when you still don't understand you could ask here Wink

scripting help : http://wiki.frictionalgames.com/hpl2/tut...s%3Ascript

sorry, right i mean it was

void onstart(){
FadeOut(0);
FadeIn(15);
}

that previous post was something i had copypasted from earlier today

anyways, what i want is for the game to start and the screen is completely black, then it fades to normal view, no trigger needed.
but when i use the script above, nothing happens
It's because Fade functions simply don't work with onstart, only onenter and onleave, and other functions. Best bet (I did the same) is add a timer in onstart with a 0 second counter, and put FadeOut(0) in the new function.
(03-31-2011, 03:29 AM)MrBigzy Wrote: [ -> ]It's because Fade functions simply don't work with onstart, only onenter and onleave, and other functions. Best bet (I did the same) is add a timer in onstart with a 0 second counter, and put FadeOut(0) in the new function.

Well, that can't be completely true.

FadeIn() works fine on my maps when they're placed in the OnStart string.
Weird, wouldn't work for me.

Or maybe it was just FadeOut that doesn't work for it?
(03-31-2011, 04:49 AM)MrBigzy Wrote: [ -> ]Weird, wouldn't work for me.

Or maybe it was just FadeOut that doesn't work for it?

Maybe, or just have both of them in OnStart won't do anything!
That's obvious true, fadein and fadeout at the Same time makes it neutral. So Nothing happend....
Try to make à timer for FadeIn :p
I'm pretty sure I only had the one there....maybe Undecided can't remember now lol
Pages: 1 2