confusion_immune does nil

Have a really dumb question? Ask it here to get help from the experts (or those with too much time on their hands)

Moderator: Moderator

Post Reply
Message
Author
xnd
Archmage
Posts: 307
Joined: Sat Mar 21, 2015 7:33 pm

confusion_immune does nil

#1 Post 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?

Forger101
Halfling
Posts: 91
Joined: Sun Oct 20, 2013 3:40 pm
Location: Dreamscape

Re: confusion_immune does nil

#2 Post 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.
<[Relic]> Az lonk as yu hav a hiskool dipooma you be ok wit dat gr8 speakin

stinkstink
Spiderkin
Posts: 543
Joined: Sat Feb 11, 2012 1:12 am

Re: confusion_immune does nil

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

xnd
Archmage
Posts: 307
Joined: Sat Mar 21, 2015 7:33 pm

Re: confusion_immune does nil

#4 Post by xnd »

ah thanks, i should've realized that stun line needed a confusion version too. :oops:

Post Reply