Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script is broken
Bierton Offline
Junior Member

Posts: 5
Threads: 4
Joined: Jun 2012
Reputation: 0
#1
Script is broken

I tried doing a timer that would do a introduction of a guy fading in and out on the way to the castle. for some reason though the script starts of at the start and immediately teleports the player to the end leaving out the areas in between.



void OnStart()
{
FadeOut(0);
FadeIn(1);
SetPlayerMoveSpeedMul(0.25f);
SetPlayerRunSpeedMul(0);
AddTimer("S1", 6, "Start");
AddTimer("S2", 6, "Start");
AddTimer("S3", 6, "Start");
AddTimer("S4", 6, "Start");
AddTimer("S5", 6, "Start");
AddTimer("S6", 6, "Start");
AddTimer("S7", 6, "Start");
}

void Start(string &in asTimer)
{
string x = asTimer;
if (x == "S1")
{
StartPlayerLookAt("ScriptArea_1", 2, 2, "");
FadeOut(2);
}
else if (x == "S2")
{
FadeIn(1);
TeleportPlayer("PlayerStartArea_2");
FadeOut(2);
}
else if (x == "S3")
{
FadeIn(1);
TeleportPlayer("PlayerStartArea_3");
FadeOut(2);
}
else if (x == "S4")
{
StopPlayerLookAt();
TeleportPlayer("PlayerStartArea_4");
StartPlayerLookAt("ScriptArea_2", 2, 2, "");
FadeIn(1);
FadeOut(2);
}
else if (x == "S5")
{
FadeIn(1);
TeleportPlayer("PlayerStartArea_4");
StopPlayerLookAt();
}
else if( x == "S6")
{
StartPlayerLookAt("sewer_grate_rusty_1", 4, 4, "");
FadeOut(2);
}
else if (x == "S7")
{
PlaySoundAtEntity("", "joint_metal_gate.snt", "Player", 0, false);
}
}

What is wrong with the script. I may be blind or just plain stupid but I don't see a problem with it.
Thanks
07-01-2012, 12:33 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Script is broken

I feel I should point out that all of your timers are set to go off at the exact same time (after 6 seconds). If you set them to go off at different times (increasing values from top to bottom) you should be fine.

I rate it 3 memes.
07-01-2012, 02:41 PM
Find




Users browsing this thread: 3 Guest(s)