Forum

> > CS2D > Scripts > combining scripts
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch combining scripts

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt combining scripts

Fossil
User Off Offline

Zitieren
Hey all. Now before you go on saying " dude really?" Or something like that, I just want to let you know that I know nothing about lua scripts. So don't go bashing on me. So is it possible to combine 2 or more lua scripts together?
1× editiert, zuletzt 31.08.11 16:00:13

alt Re: combining scripts

EngiN33R
Moderator Off Offline

Zitieren
Just add two or more dofile lines in your server.lua file. You can execute up to lots of Lua scripts at the same time.

alt Re: combining scripts

Bowlinghead
User Off Offline

Zitieren
Did you ever heard "server.lua". There are more then 1 Script! (Example the samples!)
EDIT: lol. few seconds too late

alt Re: combining scripts

Fossil
User Off Offline

Zitieren
user EngiN33R hat geschrieben
Just add two or more dofile lines in your server.lua file. You can execute up to lots of Lua scripts at the same time.
thank you for the quick reply. Thanks it works. Will using 2 or more lua scripts cause any certain lag issues?

alt Re: combining scripts

DC
Admin Off Offline

Zitieren
yeah depends on the scripts.
plus there is another important point: combining scripts does not always work without problems! be careful! scripts might use the same variables or the same hooks. in some cases you have to rewrite parts of the scripts or you have to use priorities for the cs2d lua cmd addhook command (if hooked functions use the return value).

alt Re: combining scripts

Bowlinghead
User Off Offline

Zitieren
Yeah or they both use serveraction hook. (If both scripts use F2).
EDIT: You can have unlimit addhooks (Of the same) if they all have a different variable.
1× editiert, zuletzt 31.08.11 16:10:29

alt Re: combining scripts

EngiN33R
Moderator Off Offline

Zitieren
Yes indeed - conflicting scripts are a pain in the arse. Though it doesn't happen so often it's still a possibility.

alt Re: combining scripts

Fossil
User Off Offline

Zitieren
user DC hat geschrieben
yeah depends on the scripts.
plus there is another important point: combining scripts does not always work without problems! be careful! scripts might use the same variables or the same hooks. in some cases you have to rewrite parts of the scripts or you have to use priorities for the cs2d lua cmd addhook command (if hooked functions use the return value).
thank you for that. On my spare time I might read on the lua tutorials here so I can understand them better.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht