|
| 10 Jan 2012 05:27 PM |
Title.
http://www.roblox.com/Script-maker-Plugin-item?id=69451350 |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 05:28 PM |
| local mycoroutine = coroutine.create(function() blah blah blah end) |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 10 Jan 2012 05:28 PM |
| http://wiki.roblox.com/index.php/Beginners_Guide_to_Coroutines |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 05:32 PM |
Ty.
http://www.roblox.com/Script-maker-Plugin-item?id=69451350 |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:15 PM |
I suggest using anonymous coroutines, unless completely necessary. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:16 PM |
Wait, don't use coroutines; use Spawn() instead.
It's more easy to work with, especially debugging. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:22 PM |
@SDuke Lol, they have an error on that page.
function core(a,b,c) print(a*b+c end new_thread=coroutine.wrap(core) new_thread(8,2,1)
@YourNeverSafe Can it get any errors that happen within a connect line? The Spawn() function.
×TNS× |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:24 PM |
| @TNS No, but it doesn't require as many characters as writing either coroutine.resume(coroutine.create(function() end)) or coroutine.wrap(function() end) |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:24 PM |
@YourNeverSafe Btw, Wiki doesn't say it is an error handler, leading me to believe that it isn't...
×TNS× |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:27 PM |
AH EM GEE!!! Render!!! I thought you quit a while ago! So glad you are back, I have seen too many people using your scripts at my Script Builder :/
×TNS× |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:27 PM |
Coroutines, get buggy more often.
Using spawn is much more easy; though it lacks many capabilities. |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 10 Jan 2012 06:29 PM |
"Wait, don't use coroutines; use Spawn() instead. "
I'm sure coroutines have much more uses than the Spawn function even with the little documentation Roblox provides for it(Spawn). They both have there benifits though.
"It's more easy to work with, especially debugging."
print( coroutine.resume(corutine.create(function() ??? end)) ) |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
| |
|
|
| 10 Jan 2012 06:32 PM |
"I'm sure coroutines have much more uses than the Spawn function even with the little documentation Roblox provides for it(Spawn). They both have there benifits though."
I'm guessing that was a late post. :3
The only reason I "switched", was because I couldn't use a simple wait().
I could use coroutine.yield(), but some were working.
I've been told there are other problems, but haven't done the research.
I'm guessing all my statements are false :D (besides the wait()). |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:35 PM |
"The only reason I "switched" was because I couldn't use a simple wait()."
You can use wait() in a coroutine...
"I WILL GIVE YOU BACON." - Deadmau5 ~Scarfacial |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 10 Jan 2012 06:36 PM |
"I'm guessing all my statements are false :D (besides the wait())."
Yup. As far as I've heard you only get problems with wait() when using coroutines but thats just about it.
"I could use coroutine.yield(), but some were working."
Probably an error in your script. Again 'print()'
My last post was late btw |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 10 Jan 2012 06:37 PM |
| @Scar i havent been getting the problem but i heard about some peoples coroutines not working right when they used wait? |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:38 PM |
I've used wait() just fine in coroutines. The only time I've had issues with wait() is within a pcall.
"I WILL GIVE YOU BACON." - Deadmau5 ~Scarfacial |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 10 Jan 2012 06:41 PM |
| http://www.roblox.com/Forum/ShowPost.aspx?PostID=60902660 |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 10 Jan 2012 06:46 PM |
@thenew
I checked every script before putting it in that article. It must have been one of those idiot writers that would break everything trying to make changes that shouldn't be made. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:49 PM |
@TNS I did quit. Just dropping in. As for my scripts, I released my Archive under my alt TheKingOfIce if you want to take it. Pertaining to the error handling:It does. bool,er = coroutine.resume(coroutine.resume(function() error("Hi!") end)) print(bool and er or "Nope") should work. I think it will only throw compile-time errors though. |
|
|
| Report Abuse |
|
|
Jaccob
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 986 |
|
|
| 10 Jan 2012 06:52 PM |
Reason why wait doesn't work with coroutines is because they pass on any arguments given to them such as coroutine.yield which if a wait was there, would pass it on and resume it's duty. I believe delay() should work, not sure you can try that if you want.
|
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 10 Jan 2012 06:54 PM |
@thenew I fixed the change you asked for and also added code lua tags, just waiting for them to be aproved. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:56 PM |
@Jaccob Wait DOES work with coroutines. That is how nearly all errorchecking SBs work without breaking with wait on a pcall. |
|
|
| Report Abuse |
|
|
|
| 10 Jan 2012 06:56 PM |
@ Jaccob
Not a bad idea, but I never knew of Spawn() before I had trouble; and as of now Spawn() is the best of use in my code. |
|
|
| Report Abuse |
|
|