Converting Miliseconds to Frames
#1
Posted 23 July 2010 - 04:06 AM
I'm sorry of this is confusing it's kinda like this:
0 seconds - 30 frames
1 second - 30 frames
Every 30 frames is also the equivalent to a second.
#2
Posted 23 July 2010 - 04:23 AM
You could also change the room speed to 60, but not exactly sure how that will effect game speed.
Lol, I hope this helped.
#3
Posted 23 July 2010 - 04:30 AM
I don't understand what you wrote. Basically, I need a equation to find out how many miliseconds are in a certain frame value like 3923 or whatever. I also need one to do the opposite find out how many frames there are in a milisecond value, essentially converting it to frames.I am having an extremely hard time understanding your problem, but I am going to try and help you understand from what I could comprehend. It is my understanding that you want a simple number, variable, equation or something from GM that is equivalent to 1 milisecond no? Well if that is the case, .001 is a milisecond converted into a second, divide that by two and you have a milli second of a GM frame correct? 30 Frames Per Second = 1 Second .0005 = Frames per Milisecond
You could also change the room speed to 60, but not exactly sure how that will effect game speed.
Lol, I hope this helped.
Then when I write them, I need them to be written like this... If you don't get that part dont worry about it.
EDIT:
Oh wait I think I got it. 1000/room_speed right?
Edited by XD005, 23 July 2010 - 04:38 AM.
#4
Posted 23 July 2010 - 08:14 AM
since you cannot save this number precisely within any variable, use the fraction (100/3) in your calculations to provide maximum possible precision.
#5
Posted 23 July 2010 - 11:39 AM
I don't understand what you wrote. Basically, I need a equation to find out how many miliseconds are in a certain frame value like 3923 or whatever. I also need one to do the opposite find out how many frames there are in a milisecond value, essentially converting it to frames.
I am having an extremely hard time understanding your problem, but I am going to try and help you understand from what I could comprehend. It is my understanding that you want a simple number, variable, equation or something from GM that is equivalent to 1 milisecond no? Well if that is the case, .001 is a milisecond converted into a second, divide that by two and you have a milli second of a GM frame correct? 30 Frames Per Second = 1 Second .0005 = Frames per Milisecond
You could also change the room speed to 60, but not exactly sure how that will effect game speed.
Lol, I hope this helped.
Then when I write them, I need them to be written like this... If you don't get that part dont worry about it.
EDIT:
Oh wait I think I got it. 1000/room_speed right?
.0005 is a milisecond of 30 frames per second, if you were to do an alarm event and set it to .0005, it will activate in a milisecond.
alarm[0]=.0005 //Equals one milisecond if room_speed=30
.001 is two miliseconds, .0015 is three miliseconds .002 is four milisecond and so on and so fourth.
if you are looking to create a timer that adds by the milisecond
var timer;
var start;
var second;
milisec=.0005
if start = 1 && timer < 30
{
timer+=milisec
}
if time=30
{
second+=1
timer=0
}but if you are planning to change the room speed often or what ever but don't want changing the code to be a burden you can do,
var timer;
var start;
var second;
milisec=(1/1000)/(60/room_speed)
if start = 1 && timer < room_speed
{
timer+=milisec
}
if timer=room_speed
{
second+=1
timer=0
}I still am having trouble comprehending your question, don't know why, haha but I feel this info could help you out.
EDIT: & you must excuse me if I made any mistakes. For I am ".0005"'s from going to sleep haha, and I don't feel like checking for errors.
(Miliseconds from sleep for those who didn't catch on
Edited by Senar, 23 July 2010 - 11:42 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











