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
Newbie needs help scripting
DrQuackinducks Offline
Junior Member

Posts: 3
Threads: 1
Joined: Mar 2011
Reputation: 0
#1
Newbie needs help scripting

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.
(This post was last modified: 03-30-2011, 09:34 PM by DrQuackinducks.)
03-30-2011, 08:36 PM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#2
RE: Newbie needs help scripting

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


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

Place your functions inside the curly brackets.
03-30-2011, 09:59 PM
Find
nkmol Offline
Senior Member

Posts: 252
Threads: 19
Joined: Feb 2011
Reputation: 4
#3
RE: Newbie needs help scripting

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
Find
DrQuackinducks Offline
Junior Member

Posts: 3
Threads: 1
Joined: Mar 2011
Reputation: 0
#4
RE: Newbie needs help scripting

(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
03-31-2011, 01:11 AM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#5
RE: Newbie needs help scripting

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
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#6
RE: Newbie needs help scripting

(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.
03-31-2011, 03:43 AM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#7
RE: Newbie needs help scripting

Weird, wouldn't work for me.

Or maybe it was just FadeOut that doesn't work for it?
03-31-2011, 04:49 AM
Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#8
RE: Newbie needs help scripting

(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!
03-31-2011, 05:06 AM
Find
nkmol Offline
Senior Member

Posts: 252
Threads: 19
Joined: Feb 2011
Reputation: 4
#9
RE: Newbie needs help scripting

That's obvious true, fadein and fadeout at the Same time makes it neutral. So Nothing happend....
Try to make à timer for FadeIn :p
03-31-2011, 06:07 AM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#10
RE: Newbie needs help scripting

I'm pretty sure I only had the one there....maybe Undecided can't remember now lol
(This post was last modified: 03-31-2011, 11:39 AM by MrBigzy.)
03-31-2011, 11:39 AM
Find




Users browsing this thread: 1 Guest(s)