Author Topic: LUA questions  (Read 3130 times)

0 Members and 1 Guest are viewing this topic.

Dr. Goulu

  • Soldier
  • **
  • Posts: 51
    • Dr. Goulu
LUA questions
« on: December 07, 2007, 11:13:38 AM »
You were right, JeGX, the book "Programming in LUA" is very useful. I thought browsing the lua.org site was enough to know the language, but many very interstring tricks are in the book. The more I read it, the more I LOVE LUA !

Now I still have two questions about how LUA is intergrated in Hyperion :
  • When you have a script executed with run_mode="EXECUTE_EACH_FRAME", how do you run it from within Hyperion ? as a coroutine ? what is the best way for starting a long operation (such as reading a file, accessing a database or a socket for example) from the (fast) code executed in each frame ?
  • I still have much problems using LUA libraries written in C because they keep on requiring "lua50.dll" or whatever. Which version of these libs should I use (static link, dynamic link ...) and where should I put them so that all my hyperion apps can use them ?

Thanks !   :copain:
3Dmon

JeGX

  • Global Moderator
  • Capo Crimine
  • *****
  • Posts: 2343
    • oZone3D.Net
Re: LUA questions
« Reply #1 on: December 12, 2007, 10:52:28 AM »
For your time consuming scripts, coroutines are a good choice. But as I explained it in this tutorial ( http://www.ozone3d.net/tutorials/lua_socket_lib_p4.php ) coroutines may be tricky to code. Another solution is to start a script in y new OS thread (run_in_new_thread="TRUE")...

For your C libs I didn't look at this problem yet, so I can't help you for the moment.