Hello all,
I am making a game in LÖVE, and I have some questions about using LuaSocket and MD5 (as in, this library.
How do I assemble LuaSocket and MD5, and where do I put it in the game's .love file? As in, should I put certain files in the root of the .love, and some in folders? How do I require() the module into my game?
Will using either module affect how I can distribute the game? I want to have a Windows .exe, an OS X .app, and a standard .love that can run on Linux. I'm wondering if using these will affect the cross-platform compatibility.
Questions about using LuaSocket and MD5
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Questions about using LuaSocket and MD5
Luasocket is integrated with LOVE already, there's no need to include it. To require MD5, if it's a C lib you'll need to put it in the save directory before you can require it.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Questions about using LuaSocket and MD5
OK, so how do I access LuaSocket? Can I just call it's functions without doing anything, as in, running require("socket.http") and then using it's functions?
And also, how should I assemble MD5 to be able to pop it into the save directory and require it into my game?
And also, how should I assemble MD5 to be able to pop it into the save directory and require it into my game?
Re: Questions about using LuaSocket and MD5
About Luasocket yeah, you just requre 'socket' or 'socket.http' and you're good to go. For MD5, if it's a C lib, put the .dll, .so and .dylib (was that for OSX) in the .love file, then do this:
Just once, to get them in the save directory, then just require 'md5'
Code: Select all
love.filesystem.write('md5.dll', love.filesystem.read('md5.dll'))
love.filesystem.write('md5.so', love.filesystem.read('md5.so'))
love.filesystem.write('md5.dylib', love.filesystem.read('md5.dylib'))
--path inside the .love file ↑↑ | path in the save directory ↑↑
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Questions about using LuaSocket and MD5
I'm probably being a real idiöt here, but is there a page where I can get those files, or do I have to manually compile the project from source? And also, can I put those files in a folder, as in like this:
Thanks for all the help,
Code: Select all
love.filesystem.write('libraries/md5/md5.dll', love.filesystem.read('libraries/md5/md5.dll'))
love.filesystem.write('libraries/md5/md5.so', love.filesystem.read('libraries/md5/md5.so'))
love.filesystem.write('libraries/md5/md5.dylib', love.filesystem.read('libraries/md5/md5.dylib'))
require("libraries/md5/md5")
Re: Questions about using LuaSocket and MD5
Sure you can change the folder, that was just an example. About getting those files, check on the library website
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Questions about using LuaSocket and MD5
Well if you're using MD5 to do encryption I recommend you to use the ENet Library (http://leafo.net/lua-enet/).
Re: Questions about using LuaSocket and MD5
Nice fact: LuaEnet is included in LÖVE too
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Who is online
Users browsing this forum: Google [Bot] and 10 guests