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
7thProductions Offline
Junior Member

Posts: 42
Threads: 17
Joined: Mar 2012
Reputation: 0
#1
Frustrating scripting

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()
{

}

03-21-2012, 12:55 AM
Find
Strembitsky Offline
Senior Member

Posts: 254
Threads: 37
Joined: Feb 2012
Reputation: 3
#2
RE: Frustrating scripting

It always helps to know what your error says.

The Nightmares v1.0 - Dreadful Fires WIP
03-21-2012, 01:13 AM
Find
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




Users browsing this thread: 1 Guest(s)