Frictional Games Forum (read-only)

Full Version: Frustrating scripting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
this is the current script I have for my map...but every time I try to launch it I keep getting errors...can someone please tell me what the problem is... :/

////////////////////////////
// Run first time starting map
void OnStart()
{
SetPlayerCrouching(true);
SetPlayerActive(false);
ShowPlayerCrossHairIcons(false);
GiveSanityDamage(100.0, false);
SetSanityDrainDisabled(true);
FadeOut(0);
FadeIn(3);
AddTimer("T1", 3, "Intro");
AddTimer("T2", 6, "Intro");
AddTimer("T3", 8, "Intro");
AddTimer("T4", 10, "Intro");
AddTimer("T5", 12, "Intro");
}
void Intro(string &in asTimer)
{
string x = asTimer;
if (x == "T1")
{
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
AddEntityCollideCallback("Player", "violetedwards_message1", "violetedwardsmessage1", true, 1);
FadeOut(3);

}



violetedwardsmessage1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "violetedwards_message1", 0);
}

{
else if (x == "T2")
}
{
FadeIn(3);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
StartPlayerLookAt("ScriptArea_1", 2, 2, "");
}
else if (x == "T3")
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_2", 2, 2, "");
}
else if (x == "T4")
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
StopPlayerLookAt();
}
else if (x == "T5")
{
SetPlayerCrouching(false);
SetPlayerActive(true);
ShowPlayerCrossHairIcons(true);
SetPlayerMoveSpeedMul(0.3);
SetPlayerJumpDisabled(true);
SetPlayerCrouchDisabled(true);
SetPlayerRunSpeedMul(0.0);
}
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

It always helps to know what your error says.
Quote:void OnStart()
{
SetPlayerCrouching(true);
SetPlayerActive(false);
ShowPlayerCrossHairIcons(false);
GiveSanityDamage(100.0, false);
SetSanityDrainDisabled(true);
FadeOut(0);
FadeIn(3);
AddTimer("T1", 3, "Intro");
AddTimer("T2", 6, "Intro");
AddTimer("T3", 8, "Intro");
AddTimer("T4", 10, "Intro");
AddTimer("T5", 12, "Intro");
}
void Intro(string &in asTimer)
{
string x = asTimer;
if (x == "T1")
{
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
AddEntityCollideCallback("Player", "violetedwards_message1", "violetedwardsmessage1", true, 1);
FadeOut(3);
}
else if (x == "T2")
{
FadeIn(3);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
StartPlayerLookAt("ScriptArea_1", 2, 2, "");
}
else if (x == "T3")
{
StopPlayerLookAt();
StartPlayerLookAt("ScriptArea_2", 2, 2, "");
}
else if (x == "T4")
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
StopPlayerLookAt();
}
else if (x == "T5")
{
SetPlayerCrouching(false);
SetPlayerActive(true);
ShowPlayerCrossHairIcons(true);
SetPlayerMoveSpeedMul(0.3);
SetPlayerJumpDisabled(true);
SetPlayerCrouchDisabled(true);
SetPlayerRunSpeedMul(0.0);
}
} // I have moved this syntax and put a void in front off it
void violetedwardsmessage1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "violetedwards_message1", 0);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}
From what I can see (without any further information), the line under the green text is the one that caused the problem (I have correct it in this one). There might be something I'd missed but I think this script will work. (Of course you need to have the right name for the area in AddEntityCollideCalllback and your extra_english.lang file needs to be correct)