The Most Annoying Windower LUA Error Ever!

言語: JP EN DE FR
2010-06-21
New Items
users online
フォーラム » Windower » Support » The most annoying Windower LUA error ever!
The most annoying Windower LUA error ever!
 Shiva.Malthar
Offline
サーバ: Shiva
Game: FFXI
user: Malthar
Posts: 516
By Shiva.Malthar 2015-12-03 14:29:13  
Lua runtime error: attempt to call a strong value

And it doesn't tell you where it is, after you've finished coding 300 lines of lua script.

What I have to do to track down this error is comment out huge swaths of code till the addon loads correctly. Then I half the code I comment out, try to load again, etc, until I find the offending line. And it's usually something really stupid that you didn't notice.

Arcon! Can we get a handle on these kinds of errors? They're driving me batty!

By the way, if this was a post on the official forums I would be banned for including Arcon's name and the word batty in the same paragraph, citing some esoteric TOS rule, and not for mentioning the obvious use of Windower. lol
Offline
Posts: 101
By Dunigs 2015-12-03 14:36:45  
Are you sure your line number just isn't being cut off because of the size of your game windower? I've never had a compiler not spit out the offending line number (or its best guess), lua included.
 Shiva.Malthar
Offline
サーバ: Shiva
Game: FFXI
user: Malthar
Posts: 516
By Shiva.Malthar 2015-12-03 14:39:10  
Yes, I'm sure. This is a known problem with LUA.

The offending line in this case was:
Code
function get_cure_spell(hp,curedhp)
	-- hp is current hp
	-- Cured hp is what you're tryng to reach
	local cure_spell = "Cure"
	
	for _, spell_info in ipairs(cure_matrix) do
		if (hp+spell_info.cured_amount) >= curedhp then
			cure_spell = cs
	end
	
	return cure_spell
end


Note the if statement in line 7 is never closed with an end.
 Bahamut.Milamber
Offline
サーバ: Bahamut
Game: FFXI
user: milamber
Posts: 3691
By Bahamut.Milamber 2015-12-03 14:43:33  
Ah, syntax errors.
Glorious memories of missing semicolons.
 Shiva.Malthar
Offline
サーバ: Shiva
Game: FFXI
user: Malthar
Posts: 516
By Shiva.Malthar 2015-12-03 14:46:47  
Oh, missing semicolons were easy for me. Now, logic errors... That's what can really drive you up the wall.
 Leviathan.Arcon
VIP
Offline
サーバ: Leviathan
Game: FFXI
user: Zaphor
Posts: 660
By Leviathan.Arcon 2015-12-10 17:16:05  
Yes, this used to bother me a lot. Then I stopped making errors, so I forgot about it. I'll try fixing those error messages.
Log in to post.