Move Player / Remove Timers - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Move Player / Remove Timers (/thread-21560.html) Pages:
1
2
|
RE: Move Player / Remove Timers - Adrianis - 05-22-2013 Dude(s), you don't need to run your timers like that. If you look at my example again, you can see that the first timer sets off the second function, and that function adds a timer to call itself, not the previous function again, and will keep calling itself, that way you keep all your code to 1 function rather than switching between them constantly (which is delaying you're loop) Rewrote your code to demonstrate Code: void TurnAround(string &in asTimer) Hope that clears things up. Nice work on finding that solution JAP, there's a different problem with the code you wrote, Code: void StartWalking(string &in asTimer) This means that 300 timers are being declared that will all call StopWalking, which means another 300 timers are getting set up to call GiveControlBack. The code in those functions won't run into any problems due to being called so many times, but I thought I would point out the issue for you in case you do this again in the future with code that will cause problems RE: Move Player / Remove Timers - PutraenusAlivius - 05-22-2013 Sorry, but long script files screw up my mind. |