Jump to content


Photo

Timing


  • Please log in to reply
12 replies to this topic

#1 freaky_entertainment

freaky_entertainment

    GMC Member

  • GMC Member
  • 287 posts

Posted 23 March 2008 - 07:04 PM

Sounds wierd but I can't seem to find a way to make something repeate exactly at 1065 miliseconds range ... the following doesnt work fine :
alarm[0]=1065 ... How can I make the alarm be exact 1065 miliseconds ... O,o
  • 0

#2 giggdaw

giggdaw

    GMC Member

  • New Member
  • 38 posts

Posted 23 March 2008 - 07:14 PM

hmm...

have you changed the room speed?
go on a room. there is a tab called settings.
change that number to... 1000 i think.that means, there are 1000 steps per second. 1000 milliseconds per second.
then your alarm should work properly :P

(though this is only if there are 1000 milliseconds per second... if its wrong, change the number to how many milliseconds there are per sec... i was never good at maths B) )

if you are not familiar with alarms:
set alarm[0] to 1065
in alarm[0] make the appropriate event happen, AND (if you want it to repeat) make another set alarm[0] to 1065 in alarm[0] event

Hope this helped you ;) ask if you want to know more.

Edited by giggdaw, 23 March 2008 - 07:18 PM.

  • 0

#3 Yourself

Yourself

    The Ultimate Pronoun

  • Retired Staff
  • 7343 posts
  • Version:Unknown

Posted 23 March 2008 - 07:30 PM

The room speed is the maximum number of steps that can happen in one second. It's only an upper limit on the speed of the game. Setting your room speed to 1000 won't necessarily make the game actually run that fast.
  • 0

#4 freaky_entertainment

freaky_entertainment

    GMC Member

  • GMC Member
  • 287 posts

Posted 23 March 2008 - 11:24 PM

so If I make the room speed 100 , and set alarm[0] to 1065 , it will really be 1065 milliseconds ? ;)
  • 0

#5 Mnementh

Mnementh

    15151

  • Retired Staff
  • 6263 posts
  • Version:GM:Studio

Posted 23 March 2008 - 11:25 PM

Did you see what Yourself said?
  • 0

#6 freaky_entertainment

freaky_entertainment

    GMC Member

  • GMC Member
  • 287 posts

Posted 23 March 2008 - 11:26 PM

Did you see what Yourself said?

yes but I dont quite catch it ...

Edit : In other words how to make a timer that triggers at every exact 1065 milliseconds ?

Edited by freaky_entertainment, 23 March 2008 - 11:27 PM.

  • 0

#7 Mnementh

Mnementh

    15151

  • Retired Staff
  • 6263 posts
  • Version:GM:Studio

Posted 23 March 2008 - 11:29 PM

Basically, what it means is, the room_speed is the maximum speed that your game will operate at. That doesn't mean, however, that it will actually run that fast. A computer can only handle so much, and 1000 steps per second is probobly to much.

However, because you're not asking for a ridiculously small delay, you might be able to do something with Yourself's high resolution timer. I wouldn't really know, having never tried it.

Edited by Mnementh, 23 March 2008 - 11:30 PM.

  • 0

#8 Yourself

Yourself

    The Ultimate Pronoun

  • Retired Staff
  • 7343 posts
  • Version:Unknown

Posted 24 March 2008 - 12:54 AM

You can use the current_time variable. It gives the number of milliseconds since the computer was turned on rounded to the nearest 16 ms. So with GM's built-in current_time variable, you could implement timers accurate to the nearest 1/60 of a second which should generally be good enough for a game. There are times when higher resolution is required but this doesn't sound like one of them.
  • 0

#9 cwarn23

cwarn23

    GMC Member

  • New Member
  • 111 posts

Posted 24 March 2008 - 04:25 AM

I have worked out your answer with a mathematical formula. If your room_speed is 30 then the formula is:
30/1000*1065

This would make your timer exactly 31.95 steps. So this meens that you would need to round it off to 32 steps if you have a room_speed of 30. Or just put the following into the alarm event:
room_speed/1000*1065
  • 0

#10 Yourself

Yourself

    The Ultimate Pronoun

  • Retired Staff
  • 7343 posts
  • Version:Unknown

Posted 24 March 2008 - 05:17 AM

I have worked out your answer with a mathematical formula. If your room_speed is 30 then the formula is:
30/1000*1065

This would make your timer exactly 31.95 steps. So this meens that you would need to round it off to 32 steps if you have a room_speed of 30. Or just put the following into the alarm event:
room_speed/1000*1065


That's assuming that each step lasts for 1/30 of a second, which isn't necessarily true.
  • 0

#11 safwat1995

safwat1995

    GMC Member

  • New Member
  • 394 posts

Posted 24 March 2008 - 07:36 AM

Sounds wierd but I can't seem to find a way to make something repeate exactly at 1065 miliseconds range ... the following doesnt work fine :
alarm[0]=1065 ... How can I make the alarm be exact 1065 miliseconds ... O,o


the 1065 arent miliseconds! they are steps ;)

the defualt number of steps per second is 30. so that means that alarm 0 is equal to 35 seconds!
  • 0

#12 marioman1996

marioman1996

    GMC Member

  • New Member
  • 36 posts

Posted 24 March 2008 - 10:53 AM

Actually, 1 step is equal to 1/30 of a second.

Which is to say:
30 steps = 1 second = 100 milliseconds
3 steps would be = 10 miliseconds.

So if you want 1065, it should be 318.5 steps.
(I'm not sure if you could put the .5 there)
  • 0

#13 marioman1996

marioman1996

    GMC Member

  • New Member
  • 36 posts

Posted 24 March 2008 - 10:55 AM

And i forgot to say that set your room speed to the default, 30.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users