Frictional Games Forum (read-only)

Full Version: Completely new to scripting, stumped.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Before you say ANYTHING, please understand that I am from Germany, and my english is not as good. I am trying to make a custom story for my partner, I keep getting "fatal error unexpected end of script" or something. I have hardly anything on the script now.
I have tried following tutorial on wiki and youtube, am I placing wrong or something?? Very simple script so far, want to test out effects!

Someone tell me what I am doing wrong, please? :c I want to make this work.


void OnStart()
{
if(ScriptDebugOn())

{
void FadeImageTrailTo(5.4f 2.1f);

}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Once more, not so great at english, and really really new to scripting.
Anything on BOLD means its the problem

void OnStart()
{
if(ScriptDebugOn())

}

void FadeImageTrailTo(5.4f 2.1f)


{

}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
Ithink I see...Uneeded extra brackets??
also now I am trying this- Everything worked until I added the trail function
It keeps telling me "unexpected ' "


{
AddEntityCollideCallback("Player", "push", "Push", true, 1);

}

void Push(string &in asParent, string &in asChild, int alState)

{
PlaySoundAtEntity("", "guardian_distant.snt", "push", 0, false);
AddPlayerBodyForce(30000, 0, 0, false);

void FadeImageTrailTo(5.4f 2.1f);


void FadeIn(10);
}
Yes, I think that's the problem. I think it indeed should be this.

void OnStart()
{
if(ScriptDebugOn())


{
void FadeImageTrailTo(5.4f 2.1f)
}

}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}


I am not sure about this, seeing I've never used ScriptDebugOn nor FadeImageTrailTo.
Viel Glück und Spaß!
You need to do research on how to define and call a function. C++ material should be enough for that.
I get the basic idea, I just have trouble knowing if brackets should be on something or not

If they need to be indented(?) if spacing is important

Adding functions isn't a big problem.
spaces between anything doesn't matter. Functions and statements like if and for need brackets to determine what they should run.
Alright!
Thanks to everyone for answering!