Page 1 of 1

I'm having trouble requiring a module on Android

Posted: Wed Jun 07, 2017 1:11 am
by 128Gigabytes
So I am using StartGamedev to create an apk file from a love file I just found out zipping a module into the love file does not make it usable, I'm trying to do require(".\\instance")

It works on my computer as long as the .love file is in the same folder as the module, but I thought if I zipped them together it could work, so how am I supposed to use modules if they can't be zipped in?

Re: I'm having trouble requiring a module on Android

Posted: Wed Jun 07, 2017 4:51 am
by TheHistoricApple
By module do you mean a library?

If so you can zip it into the .love file.
Do you mind posting the .love file? It would make it much easier for us to help you.

Re: I'm having trouble requiring a module on Android

Posted: Wed Jun 07, 2017 5:43 am
by 128Gigabytes
I'm zipping it in but it doesn't work, here is the file it is basically just a test so I'm not worried about giving it out or anything haha.

It runs fine as long as you have instance.lua NOT zipped with the love file, and in the same folder.
instance.love
(1.54 KiB) Downloaded 103 times

Re: I'm having trouble requiring a module on Android

Posted: Wed Jun 07, 2017 6:04 am
by TheHistoricApple
128Gigabytes wrote: Wed Jun 07, 2017 1:11 am So I am using StartGamedev to create an apk file from a love file I just found out zipping a module into the love file does not make it usable, I'm trying to do require(".\\instance")

It works on my computer as long as the .love file is in the same folder as the module, but I thought if I zipped them together it could work, so how am I supposed to use modules if they can't be zipped in?
Instead of requiring it as

Code: Select all

require (".\\instance") 
Require it as so

Code: Select all

require 'instance'
if you have it in a subfolder do the same thing

Code: Select all

require 'subfolder/instance'
Heres the .love
instance.love
(1.64 KiB) Downloaded 62 times

Re: I'm having trouble requiring a module on Android

Posted: Wed Jun 07, 2017 6:08 am
by 128Gigabytes
Thanks a ton, I'm an idiot lol

Re: I'm having trouble requiring a module on Android

Posted: Wed Jun 07, 2017 6:08 am
by TheHistoricApple
I uploaded the wrong .love updated it