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:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble with Timers
ADrySoldier Offline
Junior Member

Posts: 1
Threads: 1
Joined: Oct 2014
Reputation: 0
#1
Trouble with Timers

So I have recently started to make a Custom Story, and everything was going great until I got to this one part in my .lang file. Here it is:

void OnStart()
{
}
AddEntityCollideCallback("Player", "ScriptArea_1", "BoardDoor", true, 1);
// Set Player to Sleeping Position
SetPlayerActive(false);
FadeOut(0.0f);
SetPlayerCrouching(true);
MovePlayerHeadPos(0, -0.75f, 0, 10, 0);
FadePlayerRollTo(37.75f, 10, 10);
// Ready Timer for Wake
AddTimer("Time1", 2.5f, "Wake");
}
}

void OnEnter()
{
PlayMusic("", true, 0.9, 1.0, 1, true);
}

void OnLeave()
{
StopMusic(1 , 1);
}

void Wake(string &in asTimer)
{
// string &in asTimer is always used when setting up a Timer Callback
// Set Player to a awoken position
FadeIn(0.7f);
FadePlayerRollTo(0.0f, 6.5, 7);
// Ready Timer for EventDoor
AddTimer("Time2", 5.0f, "EventDoor");
}

void EventDoor(string &in asTimer)
{
// Player looks at door, says Robbers! and gets up
StartPlayerLookAt("metal_1", 4.5f, 5, "");
SetMessage("Messages", "robbers", 3);
MovePlayerHeadPos(0, 0, 0, 4.5f, 3);
// Ready timer for Move
AddTimer("Move", 2.0f, "Move");
}

void Move(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

void BoardDoor(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
FadeOut(0.5f);
AddTimer("PlaySound", 1.5f, "PlaySound");
}

void PlaySound(string &in asTimer)
{
TeleportPlayer("PlayerStartArea_2");
PlayGuiSound("15_hammer.snt", 100);
AddTimer("PlaySound2", 0.8f, "PlaySound2");
}

void PlaySound2(string &in asTimer)
{
PlayGuiSound("15_hammer.snt", 100);
AddTimer("PlaySound3", 0.8f, "PlaySound3");
}

void PlaySound3(string &in asTimer)
{
PlayGuiSound("15_hammer.snt", 100);
AddTimer("PlaySound4", 0.8f, "PlaySound4");
}

void PlayGuiSound4(string &in asTimer)
{
PlayGuiSound("15_hammer.snt", 100);
AddTimer("FadeIn", 0.5f, "FadeIn");
}

void FadeIn(string &in asTimer)
{
FadeIn(0.5f);
AddTimer("blockcade", 0.0f, "blockcade");
}

void blockcade(string &in asTimer)
{
SetEntityActive("cabinet_nice_2", true);
SetEntityActive("chair_wood02_2", true);
SetEntityActive("chair_wood02_3", true);
SetEntityActive("chair_wood02_1", true);
SetEntityActive("cabinet_nice_1", false);
SetEntityActive("shirt_hanging_white_1", true);
SetEntityActive("shirt_hanging_white_2", true);
AddTimer("Finish", 0.0f, "Finish");
}

void Finish(string &in asTimer)
{
SetMessage("Messages", "doneboards", 3);
AddTimer("LookUp", 2.0f, "LookUp");
}

void LookUp(string &in asTimer)
{
SetEntityActive("fallingrock", true);
AddEntityCollideCallback("fallingrock", "ScriptArea_2", "Faint", true, 1);
StartPlayerLookAt("fallingrock", 4.5f, 5, "");
}

void Faint(string &in asParent, string &in asChild, int alState)
{
FadeOut(0.3f);
StopPlayerLookAt();
}

After PlayGuiSound4 that the player is stuck there because of SetPlayerActive. It's supposed to show a barricade at the door at via the SetEntities but nothing happens and I am tearing my hair out looking it up online and seeing long since dead threads. I don't know what the problem is, and if it's even the timer. Please help.

Here's a picture of the CS I am working on:


.jpg   Concussion.jpg (Size: 47.5 KB / Downloads: 171)

I made a demo on ModDB but that was when I was first trying so it sucks majorly. This is a reboot that is a completely new idea with the same name. Thanks for looking.
(This post was last modified: 10-25-2014, 10:08 PM by ADrySoldier.)
10-25-2014, 08:13 PM
Find


Messages In This Thread
Trouble with Timers - by ADrySoldier - 10-25-2014, 08:13 PM
RE: Trouble with Timers - by Romulator - 10-26-2014, 12:19 AM
RE: Trouble with Timers - by Mudbill - 10-26-2014, 01:51 AM



Users browsing this thread: 1 Guest(s)