The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Messages In This Thread
Script is broken - by Bierton - 07-01-2012, 12:33 PM
RE: Script is broken - by Adny - 07-01-2012, 02:41 PM



Users browsing this thread: 1 Guest(s)