Author Topic: How to use one lua script in another  (Read 2590 times)

0 Members and 1 Guest are viewing this topic.

Offline Pedja

  • Junior Member
  • **
  • Posts: 14
  • Karma: +0/-0
How to use one lua script in another
« 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?

PtokaX forum

How to use one lua script in another
« on: 04 March, 2011, 08:42:20 »

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: How to use one lua script in another
« Reply #1 on: 04 March, 2011, 09:04:09 »
This can be achieved via the modules system.
Everything could have been anything else and it would have just as much meaning.

Offline Dessamator

  • Scripter
  • Emperor
  • ******
  • Posts: 1 262
  • Karma: +13/-9
Re: How to use one lua script in another
« Reply #2 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.
Ignorance is Bliss.

Offline Pedja

  • Junior Member
  • **
  • Posts: 14
  • Karma: +0/-0
Re: How to use one lua script in another
« Reply #3 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.

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: How to use one lua script in another
« Reply #4 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.
Everything could have been anything else and it would have just as much meaning.

PtokaX forum

Re: How to use one lua script in another
« Reply #4 on: 17 March, 2011, 06:15:50 »