Page 2 of 5

Re: Damage Counter script errors

Posted: Thu Feb 13, 2014 7:55 pm
by Jor'Mox
Right now, there are a few if statements in the changes I made to the one function, here is a representative one that we would want to change:
Code: [show] | [select all] lua
if not self._critTable[crit] then print("NIL VARIABLE: self._critTable[crit]") end
If you change it like this:
Code: [show] | [select all] lua
if not self._critTable[crit] then
   print("NIL VARIABLE: self._critTable[crit]")
   print("Crit: " .. crit)
end
Then it should display the value of the crit variable that has no corresponding value in the _critTable.

Re: Damage Counter script errors

Posted: Thu Feb 13, 2014 9:19 pm
by noblestone
it shows this:

NIL VARIABLE: self._critTable[crit]
Crit: pathetic
NIL VARIABLE: self._critLast[crit]

Thats the first damage list on the script. I dont know what went wrong.

Re: Damage Counter script errors

Posted: Thu Feb 13, 2014 9:35 pm
by Jor'Mox
Okay, try this. It should show the full table, so perhaps we will be able to see what went wrong.
Code: [show] | [select all] lua
if not self._critTable[crit] then
   print("NIL VARIABLE: self._critTable[crit]")
   display(crit)
   display(self._critTable)
end

Re: Damage Counter script errors

Posted: Thu Feb 13, 2014 9:41 pm
by noblestone
Statistics:
NIL VARIABLE: self._critTable[crit]
"pathetic"

{
critical = 0,
crushing = 0,
obliterating = 0,
["world-shattering"] = 0,
annihilating = 0
}
NIL VARIABLE: self._critLast[crit]

Re: Damage Counter script errors

Posted: Thu Feb 13, 2014 9:49 pm
by Jor'Mox
So, take your _critTable declaration (along with the other relevant declarations outside of the if statment. Your table obviously got messed up somehow, and never was rewritten.

Re: Damage Counter script errors

Posted: Thu Feb 13, 2014 9:55 pm
by noblestone
So it must be old scripts? i installed and uninstalled 2x before finally wrote this one to my specs.

Is it the old info stuck on? How can i wipe it clean as of deleting those stuffs and add new triggers/scripts?

Thanks

Re: Damage Counter script errors

Posted: Thu Feb 13, 2014 10:04 pm
by Jor'Mox
Well, you can always just restart Mudlet, which will clear any old data for you.

Re: Damage Counter script errors

Posted: Fri Feb 14, 2014 2:55 am
by noblestone
I shut down and restarted, problem still persist. Argh...

LUA: ERROR running script Damage Counter (Alias58) ERROR:[string "if not CritCounter then..."]:185:
bad argument #3 to 'format' (string expected, got nil)

Re: Damage Counter script errors

Posted: Fri Feb 14, 2014 3:14 am
by Jor'Mox
Yeah. Same problem. You apparently have something messing up your table declarations. You need to make sure it is firing, and make sure there is nothing else jacking it up.

Re: Damage Counter script errors

Posted: Fri Feb 14, 2014 3:51 am
by noblestone
local l_SettingsFile = getMudletHomeDir() .. _sep .. "CritCounter.lua

can u explain to me what is this for?