So here's what I'm trying to do.
I want to create some Notetags in the Armor Database that say
<applesGained: x>
<applesLost: x>
Then, I want to add them all up based on which ones the specific Actor is wearing, so I created this function:
But I keep getting an error that states:
TypeError
Cannot read property 'meta' of null
Then only thing I can think of is that I'm not properly accessing the Armors...
Can someone explain what I'm doing wrong?
I want to create some Notetags in the Armor Database that say
<applesGained: x>
<applesLost: x>
Then, I want to add them all up based on which ones the specific Actor is wearing, so I created this function:
Code:
var processDemArmors = function(actor){ var total = 0; for(i = 0; i < actor.equips().length; i += 1) { if(actor.equips()[i].meta.applesGained) { total += Math.floor(actor.equips()[i].meta.applesGained); } if(actor.equips()[i].meta.applesLost) { total -= Math.floor(actor.equips()[i].meta.applesLost); } } return total;}
But I keep getting an error that states:
TypeError
Cannot read property 'meta' of null
Then only thing I can think of is that I'm not properly accessing the Armors...
Can someone explain what I'm doing wrong?