Frictional Games Forum (read-only)
Newbie needs help scripting - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Newbie needs help scripting (/thread-7118.html)

Pages: 1 2


Newbie needs help scripting - DrQuackinducks - 03-30-2011

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.


RE: Newbie needs help scripting - Russ Money - 03-30-2011

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.


RE: Newbie needs help scripting - nkmol - 03-30-2011

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/tutorials/script/disable_gravity_tutorial?idx=hpl2%3Atutorials%3Ascript


RE: Newbie needs help scripting - DrQuackinducks - 03-31-2011

(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/tutorials/script/disable_gravity_tutorial?idx=hpl2%3Atutorials%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


RE: Newbie needs help scripting - MrBigzy - 03-31-2011

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.


RE: Newbie needs help scripting - Russ Money - 03-31-2011

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


RE: Newbie needs help scripting - MrBigzy - 03-31-2011

Weird, wouldn't work for me.

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


RE: Newbie needs help scripting - Russ Money - 03-31-2011

(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!


RE: Newbie needs help scripting - nkmol - 03-31-2011

That's obvious true, fadein and fadeout at the Same time makes it neutral. So Nothing happend....
Try to make à timer for FadeIn :p


RE: Newbie needs help scripting - MrBigzy - 03-31-2011

I'm pretty sure I only had the one there....maybe Undecided can't remember now lol