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
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: Trouble with Timers

Can I first say that I am surprised your code actually works:

PHP Code: (Select All)
void OnStart()
{
}
AddEntityCollideCallback("Player""ScriptArea_1""BoardDoor"true1);
// Set Player to Sleeping Position
SetPlayerActive(false);
FadeOut(0.0f);
SetPlayerCrouching(true);
MovePlayerHeadPos(0, -0.75f0100);
FadePlayerRollTo(37.75f1010);
// Ready Timer for Wake
AddTimer("Time1"2.5f"Wake");
}


On the third line, you have a closing brace which would close the OnStart(), and generate errors for the rest of that set of code there.

Edit: If you remove that closing brace, remove another at the bottom of the OnStart() area as well. If you do not fully understand, this is what your code should look like:

Spoiler below!
PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""ScriptArea_1""BoardDoor"true1);
// Set Player to Sleeping Position
SetPlayerActive(false);
FadeOut(0.0f);
SetPlayerCrouching(true);
MovePlayerHeadPos(0, -0.75f0100);
FadePlayerRollTo(37.75f1010);
// Ready Timer for Wake
AddTimer("Time1"2.5f"Wake");





Now, I do not think you can call timers at 0.0f. You CAN however change the two which happen instantly by changing 0.0f to 0.001f, which is practically instantaneous. Give that an attempt, otherwise I do not know exactly what is wrong. Perhaps I misread some syntax, but the game would return an error in that case.

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 10-26-2014, 12:21 AM by Romulator.)
10-26-2014, 12:19 AM
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)