Talk:GetSecondsPassed
Revision as of 08:53, 4 September 2008 by imported>DragoonWraith (→Help)
--JustTim 18:26, 27 April 2006 (EDT) : Slserpent, you've messed up the Example! The old Version was correct, yours is not!
ok, i guess if you like counting backwards, it works. the only problem is timer isn't initialized, so it always goes to the else. and i should have put 'if timer < 2' in my version--my bad. -slserpent
Help
Having trouble implementing this in my script. I am trying to make a statue of the player and I want to call the SkipAnim Command on him but only after any weapon has finished being drawn. (Thus the need for GetSecondsPassed. Here is my code
Begin GameMode If RSPlayerStatue.IsWeaponOut == 1 ;checks if the statue has weapon drawn before actor is set unconscious/destroyed RSPlayerStatue.setunconscious 1 RSPlayerStatue.setdestroyed 1 If DoOnce == 0 Set AnimTimer to GetSecondsPassed ; sets the timer once inside the Gamemode block instead of every frame Set DoOnce to 1 endif endif If AnimTimer >= 3 ;should execute after GetSecondsPassed >= 3 seconds ???? RSPlayerStatue.skipanim endif End
Many Thanks--Antares 09:05, 4 September 2008 (EDT)
- GetSecondsPassed returns the time (in seconds) since the previous frame. AnimTimer, then, will never be >=3 unless you have a <1/3 FPS!
- What you want to do is add up the times between frames until you get over three, like this:
set AnimTimer to AnimTimer + GetSecondsPassed
- Does that make sense?
- Dragoon Wraith TALK 09:53, 4 September 2008 (EDT)