Forum

> > CS2D > Scripts > update lua script without restarting
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch update lua script without restarting

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: update lua script without restarting

GeoB99
Moderator Off Offline

Zitieren
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.

alt Re: update lua script without restarting

DC
Admin Off Offline

Zitieren
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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht