PDA

View Full Version : Coroutine Standard Lua Library



dulux-oz
November 4th, 2014, 10:23
Hi Guys,

Does anyone know if the Coroutine Standard Lua Library is included in FG (the (somewhat old) Wiki Documentation notwithstanding)?

If no, what would it take to put it in, Moon? Or allow us Devs' to add it ourselves?

If yes, then why can't I get a function call (coroutine.create("my_couroutine") to work?

Cheers

Ikael
November 4th, 2014, 11:17
Hi Guys,

Does anyone know if the Coroutine Standard Lua Library is included in FG (the (somewhat old) Wiki Documentation notwithstanding)?

If no, what would it take to put it in, Moon? Or allow us Devs' to add it ourselves?

If yes, then why can't I get a function call (coroutine.create("my_couroutine") to work?

Cheers

Fantasy Grounds supports only very few Lua libraries (string, math, table) ref: https://www.fantasygrounds.com/modguide/scripting.xcp

dulux-oz
November 4th, 2014, 11:42
Fantasy Grounds supports only very few Lua libraries (string, math, table) ref: https://www.fantasygrounds.com/modguide/scripting.xcp

The (somewhat old) Wiki Documentation notwithstanding!

Thankyou for the response and for the help (not just now but in the past as well) but that was exactly the response I was attempting to avoid! :p

To put it another way: I do actually RTFM, but as that particular page is at least 4 years old, I was wondering if things had been updated - also the reason for my subsequent questions.

So, referring back to my original post...

Moon Wizard
November 4th, 2014, 18:31
Given that FG is a single threaded app with an API which is not designed to be thread safe, I have concerns that enabling coroutine would cause some re-entrancy problems when making API calls back to FG from different threads.

Regards,
JPG

dulux-oz
November 5th, 2014, 04:13
Given that FG is a single threaded app with an API which is not designed to be thread safe, I have concerns that enabling coroutine would cause some re-entrancy problems when making API calls back to FG from different threads.

Regards,
JPG

OK, that makes perfect sense - I'll just have to come up with a different solution. ;)

Incidentally, will the Unity version be multi-threaded?

Cheers

Moon Wizard
November 5th, 2014, 06:54
Possibly. However the main interface and API will continue to run in a single thread. We are looking at multi-threading the network code and possibly a couple other bits as well. We're still investigating what makes sense to change with the port, given we want to maintain maximum compatibility.

Cheers,
JPG

dulux-oz
November 5th, 2014, 10:06
Possibly. However the main interface and API will continue to run in a single thread. We are looking at multi-threading the network code and possibly a couple other bits as well. We're still investigating what makes sense to change with the port, given we want to maintain maximum compatibility.

Cheers,
JPG

Cool

Well, I solved by initial problem anyway, so no sweat on my part (not now, anyway) :p

Cheers