Jump to content

Timer is frame dependant


Recommended Posts

I hope I ended up in the right Forum, feel free to move this post If I didn't. So I feel like a complete noob for asking this but somehow my timers are frame dependant now. I used to create some timers before but I never encountered this problem before. In fact I was rewriting an old project of mine and the exact same timers don't work properly anymore. A four second timer only works when I turn it into a 400 frames timer. This is how part of my script looks:

begin gamemode
	if ( state == 1 )
		disablecontrol 15
		set state to 2
		set timer to 0.3
		;stuff
	endif
	if ( state == 2 && timer <= 0 )
		set state to 3
		set timer to 4.3
		;stuff
	endif
	if ( state == 3 && timer <= 0 )
		set state to 4
		set timer to 0.7
		;stuff
	endif
	if ( state == 4 && timer <= 0 )
		enablecontrol 15
		set state to 0
		;stuff
	endif

	if ( state > 0 && timer > 0 )
		set timer to timer - getsecondspassed
	endif
end

I replaced my actual code with ";stuff" because it's a secret until I am done. 😃 What am I doing wrong?

Link to comment
Share on other sites

5 hours ago, cookiedoughnexus said:

I hope I ended up in the right Forum, feel free to move this post If I didn't.

What game is this for?  Since last year(?), not all games have their own Nexus forums. 

Those that do, you can find them under Game Communities above, and following the CommunityForum links in their main Nexus sections will also bring you to their specific forums.

Those that don't, the CommunityForum links will drop you in the general forums here.

Edited by AaronOfMpls
Link to comment
Share on other sites

14 hours ago, AaronOfMpls said:

What game is this for?  Since last year(?), not all games have their own Nexus forums. 

Those that do, you can find them under Game Communities above, and following the CommunityForum links in their main Nexus sections will also bring you to their specific forums.

Those that don't, the CommunityForum links will drop you in the general forums here.

This was for Oblivion. But I managed to find the problem already. I made sure to use float values in the code but stupid me used a "short" to define my value. Whenever I post on Nexus I find the answer to my code problems within minutes ( after spending hours before that ). Seems like I don't need the right forum, I just need that Nexus Magic. 😁

  • Like 1
Link to comment
Share on other sites

3 hours ago, cookiedoughnexus said:

Seems like I don't need the right forum, I just need that Nexus Magic. 😁

😄  Glad you got it fixed, in any case!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...