Page 1 of 1

Using modules in dzVents

Posted: Thursday 03 August 2017 10:54
by BakSeeDaa
If I would like to use a module in my dzVents script using "require" I can not just create a file mymodule.lua and place it in the dzVents script folder because dzVents will try to load all lua files assuming they are ordinary dzVents scripts.

I can solve that by choosing to place my module in a different folder and change the package.path etc etc but it can be quite difficult if I want my script to run on all platforms.

Would it be possible to reserve a name space (E.g. my_*) for lua scripts in the dzVents script folder that will be excluded from being loaded by dzVents?

Cheers!

Re: Using modules in dzVents

Posted: Thursday 03 August 2017 11:16
by dannybloe
Better have another designated folder as a sibling to dzvents/scripts maybe.

Re: Using modules in dzVents

Posted: Thursday 03 August 2017 11:16
by dannybloe
Better have another designated folder as a sibling to dzvents/scripts maybe.

Re: Using modules in dzVents

Posted: Thursday 03 August 2017 13:43
by Doler
I just use ...dzVents/scripts/modules for this.

Re: Using modules in dzVents

Posted: Friday 04 August 2017 13:38
by dannybloe
I'll add the modules subfolder then to the package paths.

Re: Using modules in dzVents

Posted: Friday 04 August 2017 15:47
by Doler
Great!

Re: Using modules in dzVents

Posted: Friday 25 August 2017 23:36
by roblom
Maybe a stupid question, but what is a module?

Re: Using modules in dzVents

Posted: Saturday 26 August 2017 9:03
by BakSeeDaa
roblom wrote: Friday 25 August 2017 23:36 Maybe a stupid question, but what is a module?
It's explained here.