Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: krevett62 on March 09, 2017, 08:29:25 am

Title: FSO and lua socket
Post by: krevett62 on March 09, 2017, 08:29:25 am
Hello, is FSO compatible with the lua socket library currently?

If I try to use a function in the lib with it installed in my FS folder, I get the error that socket\core.dll is not a valid win32 app. I've tried with several version of the dll and always get the same error. Has anyone already tried working with this?
Title: Re: FSO and lua socket
Post by: z64555 on March 09, 2017, 02:49:34 pm
I don't believe the lua interpreter in FSO was designed to work with 3rd party libraries, much less one that works with internet connectivity.

If you want to take a look, the C source files are within ./code/scripting (https://github.com/scp-fs2open/fs2open.github.com/tree/master/code/scripting)
Title: Re: FSO and lua socket
Post by: krevett62 on March 09, 2017, 02:53:45 pm
Well that's what I was thinking too after reading a bit more on the net, as it's an integrated interpreter if I want the functions I need to create my own exe with integrated library... Probably to much hassle for what I want to do ^^
Title: Re: FSO and lua socket
Post by: krevett62 on March 10, 2017, 01:58:15 am
In fact I don't need all the functions I would just need to be able to send and receive strings and float variables from the client to the host but for now it's not doable I think... Btw there's not much MP going so that's not very relevant, but that would be nice.
Title: Re: FSO and lua socket
Post by: m!m on March 10, 2017, 02:54:33 am
LuaSocket wouldn't really help you with that since it can't access the socket that FSO is using form communicating with the clients. You would need a specialized FSO Lua API system which would allow to send and receive arbitrary Lua data over the same channel FSO is already using. It's not impossible to do that but it would require a coder who has experience with Lua and with the Network code. You could open a GitHub issue requesting this feature so that we can track its progress there.
Title: Re: FSO and lua socket
Post by: krevett62 on March 10, 2017, 03:00:04 am
Well why not, thanks for the suggestion m!m. I'm not myself experimented with that so well I'll post that on github and see if someone is able to do that for a future release of FSO (3.8.2 or 3.8.4 who knows ^^)!
Title: Re: FSO and lua socket
Post by: OldRookie on May 24, 2017, 12:43:50 pm
Hi,
Maybe this is not the right answer for your question, but ...
I still use luasocket and some LUA-scripts to send extracted informations about the game to another pc in the same network. At this PC the information is displayed. If this is what you looking for, search in the forum for "auxil... instruments" from PoDo.
My fs2_open version is .3.7.4. ...
If you need more information PM or repley.