[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: efficient calling of lua code
- From: lukey@... (Jens Hassler)
- Date: 29 Sep 2002 12:42:00 +0200
Hi there,
I just read the last posts and found one mentioning lua_dostring() is
not efficient for calling lua code in each game cycle.
My game currently does the following:
1. load the clear text script into an array (script_buffer)
2. execute the script in each game cycle by calling:
lua_dobuffer(L, script_buffer, sizeof(script_buffer), "levelscript");
This works very good, but rather slow. What would be a better way to do
this? Can I load the script into memory (as I did) and compile it there
(how?)?
Thanks!
Jens