This is the time translation system in my project. Currently i have a little problem with this. As you can see the number turn after 108.84 to 10.8 instead of 110.84 and so it goes with next values…
108.84 equals to an integer value 10884, which is saved in one external text file to define the timing there an arrow should be spawned.
btime is the integer value 10884
(at 1:39:84, the minute is already 60 seconds so its calculated to gether to 108 seconds and 84 milisecs)
bcent is the 84
bsec is the 08
bmint should be the 1
Is there a way to stabilze it. If you do not understand my question just make questions…
I cant show you the whole code since its written by Pohjan and its really long. The other parts of the code dont concern this timing splitting function.
Thanks in advance
#first parse BBBBCC to centseconds
bcent=btime%100
bsec=int(btime/100)%100
bmin=int(btime/1000) #<<<< how should i format bmin?
bmilli=bmin+bsec+(bcent/100)
return bmilli
I’m afraid that your question isn’t phrased well enough to understand the problem. could you upload some sample data and what you would like the result to be?
the script was not written by me so i could not really understand how its working… but these are parts that strongly relate to the function. The creator of the script define BBBBCC just as a name for the def class
this is the condition to send the message by comparing deltime and btime…
if (deltime/100.0)>btime:
print ("Beat at:",int(dtime),int(deltime),bkeys)
vm['listcount']+=1
bge.logic.sendMessage(bkeys) #Still send message too (If still use them)
vm['note']=bkeys
the name let me assume that btime is given in 1s/100000. Usually 1s/1000 (=milli seconds) is assumed as the smallest time value. Therefore I do not understand why it should get fractions.
The formula itself let me guess that btime is given in 1s/100. The result would be in seconds (with fractions). In my eyes that makes more sense. But it makes the function name incorrect too.
i try to see if its possible to replace that in the script. the script has about 7000 characters and so many sub functions in it. only Pohjan knows how to fix it best