Difference between revisions of "Talk:GetSecondsPassed"
Jump to navigation
Jump to search
imported>Antares |
imported>Antares m (Spelling mistake :p) |
||
Line 95: | Line 95: | ||
</pre> | </pre> | ||
::That is my entire script for having a player statue that is updatable, ie will display whatever armor/weapons you are currently wearing. The whole skipanim dilemna comes about when I want the statue to have its weapon drawn but do not want the breathing animation. If you call '''skipanim''' inside the '''IsWeaponOut''' block the statue will not completely | ::That is my entire script for having a player statue that is updatable, ie will display whatever armor/weapons you are currently wearing. The whole skipanim dilemna comes about when I want the statue to have its weapon drawn but do not want the breathing animation. If you call '''skipanim''' inside the '''IsWeaponOut''' block the statue will not completely draw the weapon but get stuck halfway. Thus a delay is needed via '''GetSecondsPassed'''. Hope all that makes sense. Thanks heaps for the timely response. | ||
::--[[User:Antares|Antares]] 10:37, 4 September 2008 (EDT) | ::--[[User:Antares|Antares]] 10:37, 4 September 2008 (EDT) |
Revision as of 09:38, 4 September 2008
--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)
- I realised that shortly after I posted, I played around with the script but it still doesnt work. Here is the entire script. Do you know where its going wrong?
scn RSPlayerStatueToggleScript float AnimTimer ref RSPlayerStatue short OneStatue short button Begin OnActivate MessageBox "Would you like a statue made in your current likeness?", "Yes", "No", "Remove Current Statue" Activate End Begin GameMode Set button to GetButtonPressed If RSPlayerStatue.IsWeaponOut == 1 RSPlayerStatue.setunconscious 1 RSPlayerStatue.setdestroyed 1 endif If AnimTimer > 2 RSPlayerStatue.skipanim ; prevent him from breathing endif If OneStatue == 1 RSPlayerStatue.pms EffectStone endif If ( button == 0 ) && ( OneStatue == 1 ) Message "Please remove current statue first" endif If ( button == 0 ) && ( OneStatue == 0 ) set RSPlayerStatue to player.CreateFullActorCopy RSPlayerStatue.setscale 2 RSPlayerStatue.removeItem torch02 100 RSPlayerStatue.moveto RSPlayerStatueHereRef RSPlayerStatue.SetAlert 1 RSPlayerStatue.setghost 1 Set OneStatue to 1 Set AnimTimer to ( AnimTimer + GetSecondsPassed ) Message "A statue has been made in your likeness" endif If ( button == 2 ) && ( OneStatue == 0 ) Message "No statue to remove" endif If ( button == 2 ) && ( OneStatue == 1 ) Message "Statue removed" Set OneStatue to 0 RSPlayerStatue.DeleteFullActorCopy ;not sure which of these lines work as they act as a return function DeleteFullActorCopy ; but meh it achieves the desired effect endif If button == 1 return endif End
- That is my entire script for having a player statue that is updatable, ie will display whatever armor/weapons you are currently wearing. The whole skipanim dilemna comes about when I want the statue to have its weapon drawn but do not want the breathing animation. If you call skipanim inside the IsWeaponOut block the statue will not completely draw the weapon but get stuck halfway. Thus a delay is needed via GetSecondsPassed. Hope all that makes sense. Thanks heaps for the timely response.
- --Antares 10:37, 4 September 2008 (EDT)