I'm having trouble requiring a module on Android

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
128Gigabytes
Prole
Posts: 14
Joined: Wed Jan 04, 2017 5:53 pm

I'm having trouble requiring a module on Android

Post 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?
TheHistoricApple
Prole
Posts: 26
Joined: Sun Jan 15, 2017 6:46 am

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

Post 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.
128Gigabytes
Prole
Posts: 14
Joined: Wed Jan 04, 2017 5:53 pm

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

Post 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 258 times
TheHistoricApple
Prole
Posts: 26
Joined: Sun Jan 15, 2017 6:46 am

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

Post 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 142 times
Last edited by TheHistoricApple on Wed Jun 07, 2017 6:08 am, edited 1 time in total.
128Gigabytes
Prole
Posts: 14
Joined: Wed Jan 04, 2017 5:53 pm

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

Post by 128Gigabytes »

Thanks a ton, I'm an idiot lol
TheHistoricApple
Prole
Posts: 26
Joined: Sun Jan 15, 2017 6:46 am

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

Post by TheHistoricApple »

I uploaded the wrong .love updated it
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests