Forum

> > CS2D > Scripts > update lua script without restarting
Forums overviewCS2D overview Scripts overviewLog in to reply

English update lua script without restarting

6 replies
To the start Previous 1 Next To the start

old Re: update lua script without restarting

GeoB99
Moderator Off Offline

Quote
It's impossible to have desired effects when a Lua script is edited without restarting your server because the way CS2D it's designed. Lua is implemented only in the server side.

old Re: update lua script without restarting

DC
Admin Off Offline

Quote
You can use dofile as user Gaios suggested. It is even possible to run that with the console if you use cs2d lua cmd parse - you could even bind reloading of a specific script to a key.

The problem with this is that it won't clean up the Lua VM and old declared variables will stay there. So this might lead to confusing results but it really depends on how you work and what you do.

Therefore map change or server restart (both is technically the same) is recommended.

There's also cs2d cmd luareset to reset the Lua VM. Afterwards you could load your scripts again manually. I think cs2d cmd luareset leads to crashes/problems in some cases though.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview