generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Waiting Less Than 0.3 seconds.

Previous Thread :: Next Thread 
itunes89 is not online. 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
RenderSettings is not online. RenderSettings
Joined: 16 Aug 2010
Total Posts: 2560
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 is not online. 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 is not online. 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 is not online. 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
mysticalchickenwing2 is not online. mysticalchickenwing2
Joined: 28 May 2012
Total Posts: 3283
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
SadisticMurderer is not online. SadisticMurderer
Joined: 30 Apr 2013
Total Posts: 316
16 May 2013 11:14 PM
You don't always have to have a wait function within a loop...
Report Abuse
Quenty is not online. 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
VirtualUser is not online. VirtualUser
Joined: 16 Aug 2010
Total Posts: 533
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
VirtualUser is not online. VirtualUser
Joined: 16 Aug 2010
Total Posts: 533
16 May 2013 11:19 PM
Quenty, you messed me up....
Report Abuse
mysticalchickenwing2 is not online. mysticalchickenwing2
Joined: 28 May 2012
Total Posts: 3283
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 is not online. 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
SadisticMurderer is not online. SadisticMurderer
Joined: 30 Apr 2013
Total Posts: 316
17 May 2013 12:34 AM
What was wrong with my post?
Report Abuse
VirtualUser is not online. VirtualUser
Joined: 16 Aug 2010
Total Posts: 533
17 May 2013 07:24 AM
@SadisticMurderer

SN0X was giving an example of said stupidity.
Report Abuse
Aerideyn is not online. Aerideyn
Joined: 16 Jan 2010
Total Posts: 1882
17 May 2013 08:48 AM
wait(0.29)

(you meant 0.03? )
Report Abuse
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
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
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
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
RyanDolan123 is not online. RyanDolan123
Joined: 05 Mar 2009
Total Posts: 17919
17 May 2013 10:04 AM
Or ya know

wait(0.3)
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
17 May 2013 10:17 AM
@Ryan
?
Report Abuse
SN0X is not online. 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
RyanDolan123 is not online. RyanDolan123
Joined: 05 Mar 2009
Total Posts: 17919
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
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
17 May 2013 11:02 AM
He meant 0.03.
Report Abuse
itunes89 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image