Page 1 of 1

confusion_immune does nil

Posted: Mon May 11, 2015 2:35 pm
by xnd
http://pastebin.com/XuLeFaEL


es = function(self, t, p)
self:talentTemporaryValue(p, "confusion_immune", t.confusionImmune(self, t))
self:talentTemporaryValue(p, "stun_immune", t.stunImmune(self, t))
end,
info = function(self, t)
return ([[Dual-self mental sturdiness improves Mental Saves by %d, and confusion and stun immunity by %d%%.]]):
format(self:getTalentLevelRaw(t)*6, t.confusionImmune(self, t)*100, t.stunImmune(self, t)*100)
end,


Result = nil value error:

Lua Error: /data-Chrono_Xorn/talents/Chrono_Xorn.lua:533: attempt to call field 'confusionImmune' (a nil value)

what is confusing it?

Re: confusion_immune does nil

Posted: Mon May 11, 2015 3:02 pm
by Forger101
t.confusionImmune needs to exist in your code, you are trying to call a non existent function. You could just copy the stunImmune function and change the name.

Re: confusion_immune does nil

Posted: Mon May 11, 2015 3:03 pm
by stinkstink
Notice how when setting the stun_immune attribute, it calls the stunImmune function higher in the talent? You need to define a similar one called confusionImmune to tell it how much confusion resistance to provide. Alternatively, you can just use stunImmune for both if you want it to provide the same amount of resistance to both effects.

Re: confusion_immune does nil

Posted: Tue May 12, 2015 12:32 am
by xnd
ah thanks, i should've realized that stun line needed a confusion version too. :oops: