I'm a little baffled with the wiki here, but it says somewhere or other, that the server is a standalone lua program, and the client is love. What if i wanted to have a love program where you choose to host a game for others to join, or join a hosted game?
How would i go about doing this? Also, When i attempted to make a .love server, it opened the main.lua file within in notepad, and maintained a white unresponsive screen.
Server-Client Networking thing.
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Server-Client Networking thing.
My guess is that you read that the server doesn't necessarily need to be made with löve, since servers usually can work without a GUI.
If you want your game to have hosting capabilities, then you need to write both client and server code into it.
How to write that code depends what you chose to use; ENet, Luasocket (both included in löve), or Lube (a library)
As for your attempt, without a .love, i can not guess what the error might be... other than you actually renaming your main.lua to server.love or something, and it being opened with notepad, a blank file, waiting to be edited.
If you want your game to have hosting capabilities, then you need to write both client and server code into it.
How to write that code depends what you chose to use; ENet, Luasocket (both included in löve), or Lube (a library)
As for your attempt, without a .love, i can not guess what the error might be... other than you actually renaming your main.lua to server.love or something, and it being opened with notepad, a blank file, waiting to be edited.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Server-Client Networking thing.
What is Enet? The only one there i haven't heard of.
EDIT: And the notepad file that opened, was the one inside the .love file, main.lua, all the code intact..
EDIT: And the notepad file that opened, was the one inside the .love file, main.lua, all the code intact..
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Server-Client Networking thing.
http://leafo.net/lua-enet/
you can in your code, and use that instead of luasocket, if you choose to.
I still don't see how running your .love opened up notepad, unless i misunderstood something.
you can
Code: Select all
require 'enet'
I still don't see how running your .love opened up notepad, unless i misunderstood something.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: No registered users and 5 guests