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: while loops

Previous Thread :: Next Thread 
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Dec 2012 12:41 PM
we all hate it when a while loop without a delay crashes our games (... possibly discarding all your work...)

why. can't. there. be. a. solution? whether it be force stopping the code or w/e.

that's all I have to say.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Dec 2012 12:47 PM
I WANT REASONS.
Report Abuse
xSIXx is not online. xSIXx
Joined: 06 Aug 2010
Total Posts: 9202
22 Dec 2012 12:48 PM
get used to the habit of

while wait(1) do

to start while loops and you will never make that mistake again.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Dec 2012 12:52 PM
for raisins I don't
Report Abuse
AbsoluteLOL is not online. AbsoluteLOL
Joined: 01 Dec 2012
Total Posts: 3939
22 Dec 2012 12:53 PM
*reasons

I just use while wait() do...
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Dec 2012 12:55 PM
no, it's raisins.
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
22 Dec 2012 01:11 PM
Well saving your place all the time helps allot.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Dec 2012 01:14 PM
that's the largest pain in the badass (because we're allowed to say that) ever.
Report Abuse
129K is not online. 129K
Joined: 23 Aug 2011
Total Posts: 19010
22 Dec 2012 01:15 PM
^
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
22 Dec 2012 01:16 PM
Ctrl + S done :D
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
22 Dec 2012 01:16 PM
Mmm dunno, I don't remember any incidents for meh with it... I'm not even doing anything like while wait() do, just regular while bool do
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
22 Dec 2012 01:20 PM
I used to do it all the time and it really angered me, but then I learnt after getting a really unstable computer that saving the place to the HDD after every change was a really good idea.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Dec 2012 01:21 PM
"Ctrl + S done :D"

there's more than that. then there's the fact that you're creating a new file that you're probably never going to open again.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Dec 2012 01:21 PM
and I don't think I can keep up with constantly saving. I'd forget in the middle of troubleshooting or something.
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
22 Dec 2012 01:22 PM
Ehh.... I do open files, but back when I was building on roblox, I could never finish anything til end.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
22 Dec 2012 01:25 PM
I have a storing system for Roblox on my computer. I have a folder full of models, places, SB scripts, studio scripts and some other stuff. Then I have a folder inside my places folder for obsolete projects.

It works quite nicely.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Dec 2012 01:26 PM
Is that really the job of the user? to constantly save in case of an unexpected crash?
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
22 Dec 2012 01:27 PM
Yes, if you don't like random loops crashing your place.
Report Abuse
Prehistoricman is not online. Prehistoricman
Joined: 20 Sep 2008
Total Posts: 12490
22 Dec 2012 01:29 PM
It's a good habit to get used to.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Dec 2012 01:30 PM
but the thing is: random loops SHOULD NOT crash my place.
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
22 Dec 2012 01:35 PM
But then why do you make them random? TAKE CONTROL OVER EET!
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
22 Dec 2012 01:41 PM
but they're not always random :(.

For instance, I'll tell you why this occurs 90% of the time.

So, i'm starting my loop:

while true do
wait()
end

then, I make an edit:

while true do
if blah then
wait()
end
end

little do I know, the wait is within the if scope, so I test.

CRASH.
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
22 Dec 2012 01:43 PM
I dunnoo... Always when I press X key for script editor, I automatically click on save button thingy(not even using Ctrl+S).
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
22 Dec 2012 01:52 PM
lrn2game:SaveToRoblox()w/plugins
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
22 Dec 2012 03:28 PM
I think that it's a sign that you should be more careful thinking about the conditions on your loops. I haven't had a loop hang in more than a year now, I think you're just being careless.

As for why it's not possible to "stop when it's stuck in a hang":
You effectively need to solve the halting problem in order to fix it.
That is, you need to be able to determine whether a piece of code will stop ("halt") or not without actually running it.
And that's provably impossible.
Without being able to determine that it's impossible for Roblox to know whether your code is actually hanging or whether you're just running a long process which takes a long time to finish computing something.

What can be done to fix it:
Run an extra thread to handle the UI processing in addition to the actual game engine thread. That way you'd still be able to tell the game to "stop" when you know that it's hung. This is probably still hard given the architecture of the Roblox application, or they would have done it already.
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