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
Frustrating scripting
MrErkky Offline
Junior Member

Posts: 28
Threads: 3
Joined: Nov 2011
Reputation: 5
#3
RE: Frustrating scripting

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)

03-21-2012, 02:12 AM
Find


Messages In This Thread
Frustrating scripting - by 7thProductions - 03-21-2012, 12:55 AM
RE: Frustrating scripting - by Strembitsky - 03-21-2012, 01:13 AM
RE: Frustrating scripting - by MrErkky - 03-21-2012, 02:12 AM



Users browsing this thread: 1 Guest(s)