Worst. Error message. Ever.

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
Code:
 Runtime Error: attempt to call a number value
I've been searching an hour trying to track this down. :(

Does anyone know under what circumstances a bug would cause the error reporter to give no file, line, or variable information? Knowing the general situation that might cause this would help narrow down the issue. It's a needle in a haystack to try and search every single function call in all recently-changed code.
 
Its not nice calling number values at this hour of the night. Shame on you.
 
Though, it probably means you grabbed a string and then tried to do math to it.
 
I think that would be "attempt to perform arithmetic" error.

"Attempt to call a number value" I believe indicates I have parenthesis somewhere after a number, or what I think is a function name is somehow a number. The difficulty is finding where! :crazyeye:
 
"Attempt to call a number value" I believe indicates I have parenthesis somewhere after a number, or what I think is a function name is somehow a number.

The latter seems more likely. I tried both types of things in the lua 5.1.4 command line interpreter and the second produced an error fairly close to yours:

2hz0hw5.jpg
 
My turn!

Runtime error: Failed to iterate table due to query error. Check Database.log for more details.

And, Database.log reveals....
Code:
[46748.133] Validating Foreign Key Constraints...
[46748.991] Failure to check references for foreign key Units(CivilianAttackPriority).
[46748.991] no such table: CivilianAttackPriority
[46748.991] Failed Validation.
[46749.506] 
-- SQLite Memory Statistics --
Memory Usage:
		[Cur]		[Max]
Malloc:		405880		2777296
PageCache:	4502		4982
LookAside:	31		1812
Scratch:	0		1

Static Buffer Overflows:
		[TooLarge]	[NoSpace]
PageCache:	125280		423264
Scratch:	0		0

Largest Allocations:
Malloc:		65280
PageCache:	1160
Scratch:	6640

Prepared Statements:
Current:		3
------------------------------

Which means nothing to me. I was editing the Advanced Options menu, so the attack priority is utterly unrelated.
 
DOes the table it claims doesn't exist actually exist? Nevermind that it couldn't be caused by what you're working on, it could be a coincidence... worth checking that, as it's a fairly simple check.
 
It exists. The table is lierally part of the units.XML file
What I mean is, have you verified that the table is actually there in the DB? If something wacky has happened to corrupt or otherwise scrag it, coincidentally when you did something else, then the error might be correct. I doubt it, tbh, but it's better to check that the error is wrong rather than assume it be just because the XML that the table should be built from is in the files.
 
What I mean is, have you verified that the table is actually there in the DB? If something wacky has happened to corrupt or otherwise scrag it, coincidentally when you did something else, then the error might be correct. I doubt it, tbh, but it's better to check that the error is wrong rather than assume it be just because the XML that the table should be built from is in the files.

Checking my SQL database, there is a CivilianAttackPriorities table, but not a CivilianAttackPriority table (and I have the same error message in my log files). Methinks there is a bad reference somewhere causing that one. Makes me wonder if that table even gets used by the game currently.
 
On release, there were a load of errors like this appeared in the logs (the foreign key ones). Errors for player mods didn't seem to appear. I remember being told there was a setting change to make it actually give your errors, but I don't remember what or where.
 
The CivilianAttackPriority thing is a vanilla bug and can safely be ignored as far as modding is concerned. What kind of query did you try to call?
 
I created a new table to store custom mod options, which would be addressable in a Mod Options menu off of the Game Setup menu. Each option also had the possibility of suboptions, so things were a bit messy. I am trying a more streamlined system now.
 
Back
Top Bottom