PtokaX forum

Development Section => Your Developing Problems => Topic started by: Pedja on 04 March, 2011, 08:42:20

Title: How to use one lua script in another
Post by: Pedja on 04 March, 2011, 08:42:20
I guess this is a newbee question, but I am newbie.

I want to make s cript that will contain library of functions. Then I want to load that library in other scripts to use them. I searched through lua documentation, but got no clue how to achive this.

Any help?
Title: Re: How to use one lua script in another
Post by: bastya_elvtars on 04 March, 2011, 09:04:09
This can be achieved via the modules system.
Title: Re: How to use one lua script in another
Post by: Dessamator on 07 March, 2011, 11:41:28
Im a bit rusty on this so im not too sure but, something like dofile("script.lua") used to work.
Title: Re: How to use one lua script in another
Post by: Pedja on 16 March, 2011, 13:18:42
I found out this topic http://forum.ptokax.org/index.php?topic=6173.0 that seems to be explaining it, although not up to the point.

LUA is not as fine script language as I expected it to be.
Title: Re: How to use one lua script in another
Post by: bastya_elvtars on 17 March, 2011, 06:15:50
That thread is very old. I gave you a hint, if you want me (or anyone else) to be more specific, please ask more specific questions.