Lua script reload

Started by
2 comments, last by Metzler 20 years, 8 months ago
Hey, I have a problem with reloading a script. Mine is running in a thread. When i now reload the file, he simply continues at its old position. So : How i can i solve this problem ? Is there any kind of pointer, that i can set to the beginning of the file ? Or how do i successfully kill the thread ? THX in advance
Advertisement
Ok, i experimented a bit around.
As it seems, the file is now successfully being reloaded.
But there is one other problem :
I have my script and anywhere in it comes a loadmap("xyz"); call.
This is a c function, that now loads another map with its own script.
The problem is that the calling script executes some more function.
I tried, to stop the script in the loadmap-c-function via lua_yield as soon as possible, but it doesnt work successfully, it still executes code.
Any ideas ?
THX
lua_yield only works on coroutines; functions that a started via lua_createcoroutine (not the exact name, but that''s it).

Other, UGLY possibility:

Create a script error (call a nil variable entry)
<- NOT RECOMMMENDED

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Hm... After "extensive research" i think there is just one solution that fits my needs and that is placing a coroutine.yield() just after my loadmap command...

This topic is closed to new replies.

Advertisement