Page 6 of 8

Re: 4X Space Game (Tech Demo Released)

Posted: Thu Apr 28, 2011 7:07 am
by bartbes
Looks awesome.

Re: 4X Space Game (Tech Demo Released)

Posted: Thu Apr 28, 2011 10:00 am
by Robin
I keep getting errors:

Code: Select all

Error: [string "client.lua"]:43: bad argument #1 to 'len' (string expected, got nil)
stack traceback:
	[C]: in function 'len'
	[string "client.lua"]:43: in function 'CheckPreformed'
	[string "client.lua"]:60: in function 'callback'
	[string "LUBE.lua"]:318: in function 'update'
	[string "main.lua"]:155: in function 'update'
	[string "boot.lua"]:1: in function <[string "boot.lua"]:1>
	[C]: in function 'xpcall'
You should probably use # instead of string.len, by the way.

Re: 4X Space Game (Tech Demo Released)

Posted: Thu Apr 28, 2011 8:36 pm
by Lap
Robin wrote:I keep getting errors:

Code: Select all

Error: [string "client.lua"]:43: bad argument #1 to 'len' (string expected, got nil)
stack traceback:
	[C]: in function 'len'
	[string "client.lua"]:43: in function 'CheckPreformed'
	[string "client.lua"]:60: in function 'callback'
	[string "LUBE.lua"]:318: in function 'update'
	[string "main.lua"]:155: in function 'update'
	[string "boot.lua"]:1: in function <[string "boot.lua"]:1>
	[C]: in function 'xpcall'
You should probably use # instead of string.len, by the way.
Any reason that string.len even exists then? Also, what code are you using anyways? The only one I've updated in months is the code off the SVN.

Re: 4X Space Game (Tech Demo Released)

Posted: Thu Apr 28, 2011 8:43 pm
by slime
The # operator was added in Lua 5.1, and replaces string.len and table.getn. If you've been reading the online version of Programming in Lua, it is written for Lua 5.0 (Lua 5.1 came out in 2006 IIRC), so many parts of it are out of date/no longer valid.

Re: 4X Space Game (Tech Demo Released)

Posted: Thu Apr 28, 2011 8:45 pm
by Lap
I guess I've just been adverse to using it because I have so many dictionary tables and numbered tables with gaps that I have to use a custom table.Count() instead of # to get an accurate number. Never even knew I could use it for strings. Find and Replace in files FTW.

Re: 4X Space Game (Tech Demo Released)

Posted: Thu Apr 28, 2011 8:50 pm
by Robin
Lap wrote:Also, what code are you using anyways? The only one I've updated in months is the code off the SVN.
I got the code straight from SVN trunk.

Re: 4X Space Game (Tech Demo Released)

Posted: Thu Apr 28, 2011 8:57 pm
by Lap
Apparently I didn't commit that last fix. It's on the SVN. However, that just brings up another problem...

If you are seeing that error at all it means that some how you are dropping packets from yourself. That shouldn't happen on a localhost and isn't something I've been able replicate without artificially modding my rate through the roof.

Re: 4X Space Game (Tech Demo Released)

Posted: Thu Apr 28, 2011 8:59 pm
by Robin
Huh. To be honest, I have no idea what I had been doing. I just clicked some buttons and then it crashed. :P

Re: 4X Space Game (Tech Demo Released)

Posted: Thu Apr 28, 2011 9:14 pm
by Lap
Just try singleplayer->quickstart. I'm always screwing around with the other options experimenting with stuff. I break a lot of the other options fairly frequently. I don't have enough foolproof safeguards in place for people just randomly trying to throw up a server or map yet without knowing what they are doing.

Re: 4X Space Game (Tech Demo Released)

Posted: Thu Apr 28, 2011 9:21 pm
by Robin
I actually tried that first. It crashed. :(