UDP and Modules
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- GhostAction
- Prole
- Posts: 34
- Joined: Wed Apr 22, 2015 11:10 pm
- Contact:
UDP and Modules
So I'm making a multiplayer games and I just started switching everything to modules, but I ran into one problem: How do I get UDP to work within modules? I tried looping it through all the functions, but it barely worked. Any ideas?
- Attachments
-
- void² server.lua
- (2.59 KiB) Downloaded 91 times
-
- void² v0.2.1.love
- (7.01 KiB) Downloaded 95 times
Last edited by GhostAction on Mon May 16, 2016 10:22 pm, edited 1 time in total.
Owner of Isocubic. (Developer of void²)
Re: UDP and Modules
What? modules don't really change anything. You have some logical error somewhere in your architecture and we can't tell you what it is without you showing us your code.
- GhostAction
- Prole
- Posts: 34
- Joined: Wed Apr 22, 2015 11:10 pm
- Contact:
- GhostAction
- Prole
- Posts: 34
- Joined: Wed Apr 22, 2015 11:10 pm
- Contact:
Re: UDP and Modules
Alright uploaded them. The code is a tad bit different from a couple days ago, but the multiplayer part should be the same.
Owner of Isocubic. (Developer of void²)
Re: UDP and Modules
Not related to your problem, but...
I don't think this does what you think it does. It is equivalent to this:
i.e. 'blue' gets the number 91, 'yellow' the number 253, 'green' the number 155, 'red' the number 195, and the elements with numeric indices 1, 2, 3, 4, 5, 6, 7 and 8 get the values 192, 235, 231, 76, 197, 61, 66, and 63 respectively.
You probably meant something like this:
because then you can do this:
Code: Select all
local playerColors = {blue = 91, 192, 235; yellow = 253, 231, 76; green = 155, 197, 61; red = 195, 66, 63}
Code: Select all
local playerColors = {blue=91, [1]=192, [2]=235, yellow=253, [3]=231, [4]=76, green=155, [5]=197, [6]=61; red=195, [7]=66, [8]=63}
You probably meant something like this:
Code: Select all
local playerColors = {blue = {91, 192, 235}; yellow = {253, 231, 76}; green = {155, 197, 61}; red = {195, 66, 63}}
Code: Select all
love.graphics.setColor(playerColors.blue)
- GhostAction
- Prole
- Posts: 34
- Joined: Wed Apr 22, 2015 11:10 pm
- Contact:
Re: UDP and Modules
Yeah I know, I probably copied from some code that was from a month ago.
Owner of Isocubic. (Developer of void²)
Who is online
Users browsing this forum: No registered users and 5 guests