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
Move Player / Remove Timers
Shirder Offline
Junior Member

Posts: 6
Threads: 2
Joined: Dec 2011
Reputation: 0
#8
RE: Move Player

So it's basically function1 that calls function2 that recalls function1. It seems so easy now that I got that Big Grin
Apparently there aren't many explanations on the internet, but you both made it way easier to understand. Thanks alot for explaining, works like a charme^^

And about that error message: Yep, it was caused by the patch. It wasn't installed properly. But now everything works like it's supposed to and the player moves!
Well, except that I now don't manage to stop him, but that's a different problem I can fix myself^^ At least he finally moves.

So far, many thanks. You helped me alot ;D

[EDIT]: Cheered too soon...
Well, I thought I could simply stop him by using RemoveTimer, but that doesn't have any effect. (At first he didn't walk, now he can't stop. I kinda knew this would happen ^^; )
I did like this: At the moment the player turns around, another timer is called that removes the looping timers 2,5 seconds after they've beed called.
Looks like this now:
Spoiler below!
void ResAreaSign(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
SetMessage("Thoughts", "RestrictedArea", 5.0);
StartPlayerLookAt("SignArea_1", 5, 5, "");
AddTimer("", 2.0f, "TurnAround");
}

void TurnAround(string &in asTimer)
{
StartPlayerLookAt("SignArea_3", 5, 5, "");
AddTimer("", 0.5f, "StartWalking");
AddTimer("", 3.0f, "StopWalking");
}

void StartWalking(string &in asTimer)
{
MovePlayerForward(5.0f);
AddTimer("", 0.01f, "RepeatWalking");
}

void RepeatWalking(string &in asTimer)
{
AddTimer("RepeatWalk", 0.01f, "StartWalking");
}

void StopWalking(string &in asTimer)
{
RemoveTimer("StartWalking");
RemoveTimer("RepeatWalking");
StopPlayerLookAt();
AddTimer("", 0.5, "GiveControlBack");
}

void GiveControlBack(string &in asTimer)
{
SetPlayerActive(true);
}
Everything else on 'void StopWalking' works, means I can look around and take control - while moving forward.
Putting RemoveTimer into a ScriptArea doesn't work either, same thing here.
How do I remove the timers now?

English isn't my first language, so please forgive my grammar mistakes :D
(This post was last modified: 05-21-2013, 11:21 PM by Shirder.)
05-21-2013, 10:20 PM
Find


Messages In This Thread
Move Player / Remove Timers - by Shirder - 05-20-2013, 06:10 PM
RE: Move Player - by Slanderous - 05-20-2013, 06:29 PM
RE: Move Player - by OriginalUsername - 05-20-2013, 06:35 PM
RE: Move Player - by Adrianis - 05-20-2013, 07:08 PM
RE: Move Player - by Shirder - 05-20-2013, 08:41 PM
RE: Move Player - by Adrianis - 05-21-2013, 02:45 AM
RE: Move Player - by PutraenusAlivius - 05-21-2013, 02:43 AM
RE: Move Player - by Shirder - 05-21-2013, 10:20 PM
RE: Move Player / Remove Timers - by Shirder - 05-22-2013, 11:33 AM
RE: Move Player / Remove Timers - by Adrianis - 05-22-2013, 01:03 PM



Users browsing this thread: 1 Guest(s)