itunes89
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 1957 |
|
|
| 16 May 2013 07:59 PM |
local a = tick() local b = 0 while true do repeat until tick() - a >= 0.1 b = b + 1 end
This still crashes me, anyone have a better idea? |
|
|
| Report Abuse |
|
|
|
| 16 May 2013 08:01 PM |
...You have a repeat inside a while true do...And it never updates a...
Anyways, you probably never need to wait less then 1/30 of a second, and even if you did there isn't a good way to do it since roblox only calls Lua threads ever 1/30 of a second anyways. |
|
|
| Report Abuse |
|
|
itunes89
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 1957 |
|
|
| 16 May 2013 08:04 PM |
| Oh so I guess there is no way. Well that sucks.. Anyway Yea I noticed that right after I posted this. |
|
|
| Report Abuse |
|
|
dekkonot
|
  |
| Joined: 22 Dec 2010 |
| Total Posts: 6685 |
|
|
| 16 May 2013 08:06 PM |
Urm...No way, I don't think.
~ Non simpliciter Latinam legere ~ |
|
|
| Report Abuse |
|
|
UnBuild
|
  |
| Joined: 22 Mar 2013 |
| Total Posts: 3233 |
|
|
| 16 May 2013 08:26 PM |
I tried this one time
function Waiting(Number) Ticker = math.floor(tick()) repeat until math.floor(tick()) == Ticker + Number end
All it does is freeze the game for "Number" seconds though. Lol. (Note, I don't think what I have now is even going to work, it was something like that I got rid of it because it works for poorly) |
|
|
| Report Abuse |
|
|
|
| 16 May 2013 11:06 PM |
ahem...you always have to have a wait function within a loop for ROBLOX.
local a = tick() local b = 0 while true do repeat wait() until tick() - a >= 0.1 --that was your main problem
b = b + 1 wait() --that shouldn't be required(because the wait is within the repeat loop), but it's a failsafe end |
|
|
| Report Abuse |
|
|
|
| 16 May 2013 11:14 PM |
| You don't always have to have a wait function within a loop... |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 16 May 2013 11:16 PM |
No. Please don't.
Hook up to the Camera.Changed event. |
|
|
| Report Abuse |
|
|
|
| 16 May 2013 11:19 PM |
| ^ This is correct. You only need to have the wait function if you are preforming consistent processes. |
|
|
| Report Abuse |
|
|
|
| 16 May 2013 11:19 PM |
| Quenty, you messed me up.... |
|
|
| Report Abuse |
|
|
|
| 16 May 2013 11:27 PM |
| true. I was just stating my experience with loops crashing me. usually it had to deal with not having a wait() within a loop. Though the way I worded it is contradictory, it's really just a suggestion |
|
|
| Report Abuse |
|
|
SN0X
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 7277 |
|
|
| 17 May 2013 12:27 AM |
| The stupidity before Quenty posted..... O.e it was over 9000! |
|
|
| Report Abuse |
|
|
|
| 17 May 2013 12:34 AM |
| What was wrong with my post? |
|
|
| Report Abuse |
|
|
|
| 17 May 2013 07:24 AM |
@SadisticMurderer
SN0X was giving an example of said stupidity. |
|
|
| Report Abuse |
|
|
Aerideyn
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 1882 |
|
|
| 17 May 2013 08:48 AM |
wait(0.29)
(you meant 0.03? ) |
|
|
| Report Abuse |
|
|
|
| 17 May 2013 09:03 AM |
Question.
Do the games even run at 60FPS, or are we being lied to? Right now, I'm pretty sure that the game doesn't look like it's running at 60FPS.
The Prime Jester of Scripters has spoken. |
|
|
| Report Abuse |
|
|
|
| 17 May 2013 09:28 AM |
RunThread = coroutine.wrap(function() wait(0.045) while wait(0.03) do print 'faster den duh speed of limitation' end end)
function RunFunction() wait(0.03) while wait(0.03) do print 'faster den duh speed of limitation' end
RunThread() RunFunction()
Don't know if this is what you're looking for but it prints at intervalsfaster than 0.03. |
|
|
| Report Abuse |
|
|
|
| 17 May 2013 09:29 AM |
The graphics might run at 60 FPS
The physics most likely runs at 30 FPS to be synchronized with scripts
The network probably runs at 10/#Parts FPS |
|
|
| Report Abuse |
|
|
|
| 17 May 2013 09:29 AM |
Whoops, forgot an end:
RunThread = coroutine.wrap(function() wait(0.045) while wait(0.03) do print 'faster den duh speed of limitation' end end)
function RunFunction() wait(0.03) while wait(0.03) do print 'faster den duh speed of limitation' end end
RunThread() RunFunction() |
|
|
| Report Abuse |
|
|
| |
|
| |
|
SN0X
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 7277 |
|
|
| 17 May 2013 10:39 AM |
>What was wrong with my post?
Never mind :/
But it's still odd that itunes is posting this and about wait only in loops and the busy waits and not knowing why it freezes up and like stuff ._.
greetings hue man |
|
|
| Report Abuse |
|
|
|
| 17 May 2013 10:41 AM |
@thedestroyer Well wait(0.2)
0.2 is less than 0.3 like the title says
k |
|
|
| Report Abuse |
|
|
| |
|
itunes89
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 1957 |
|
|
| 17 May 2013 12:31 PM |
| The thing is, why can I run loops in Java without any sort of wait and I got 500+ Frames Per Second. |
|
|
| Report Abuse |
|
|