Craftero
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 1451 |
|
|
| 12 Feb 2016 12:01 PM |
I pressed Play before realising I had created an infinite loop in my code. Now Studio is trying to Play, and failing by the looks of it (who would have guessed!).
Is there any way to escape this procedure and return to standard Studio mode? |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 12 Feb 2016 12:01 PM |
| Restart studio and add a wait into your loop. |
|
|
| Report Abuse |
|
|
Craftero
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 1451 |
|
|
| 12 Feb 2016 12:03 PM |
If I simply restart, I could lose all my progress up until now.
Perhaps there isn't a shortcut for this at all? |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2016 12:41 PM |
| by not putting in infinite loops |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 12 Feb 2016 12:42 PM |
| Usually during a crash studio will auto save. Just make sure the place is saved then end studio |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2016 12:45 PM |
| Use while wait() do instead of while true do, also if you open up the Studio engine, they have a autosave function and it will detect your lost progress |
|
|
| Report Abuse |
|
|
Craftero
|
  |
| Joined: 24 Jun 2011 |
| Total Posts: 1451 |
|
|
| 12 Feb 2016 12:52 PM |
Thanks everyone.
I was really just looking for a way to escape the Play Test procedure itself, but it seems there is no such method of doing so.
Of course, I didn't include the infinite loop on purpose - I just forgot to add a wait() - but most of you probably knew that.
Thanks for the advise anyway.
|
|
|
| Report Abuse |
|
|
|
| 12 Feb 2016 12:57 PM |
Why does the window stop responding? Why doesn't it reserve some resources to keep the window running?
|
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 12 Feb 2016 01:13 PM |
To my knowledge the client (and by extension studio) is single threaded. So once the low level language that runs the client goes into the infinite loop, it cannot do anything else (No physics updates, no rendering, etc).
This allows you do do fun things like control the client frame rate (i.e. lag scripts).
local desiredFPS = 8
local waitTime = 1/desiredFPS local tock = tick() game:GetService("RunService").RenderStepped:connect(function() repeat until tick() >= tock+waitTime tock = tick() end) |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2016 01:23 PM |
Interesting. Good to know. Thanks.
|
|
|
| Report Abuse |
|
|