Damage Counter script errors

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: Damage Counter script errors

Post 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.

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Damage Counter script errors

Post 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.

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: Damage Counter script errors

Post 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

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Damage Counter script errors

Post 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]

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: Damage Counter script errors

Post 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.

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Damage Counter script errors

Post 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

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: Damage Counter script errors

Post by Jor'Mox »

Well, you can always just restart Mudlet, which will clear any old data for you.

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Damage Counter script errors

Post 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)

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: Damage Counter script errors

Post 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.

noblestone
Posts: 154
Joined: Sun Jul 29, 2012 6:50 am

Re: Damage Counter script errors

Post by noblestone »

local l_SettingsFile = getMudletHomeDir() .. _sep .. "CritCounter.lua

can u explain to me what is this for?

Post Reply