little help please
Posted: Wed Nov 27, 2013 12:44 pm
Hi, I have no knowledge of coding, but trying to stumble through making an add-on.
when I activate this sustain (cobbled together from other sustains)
newTalent{
name = "Tiger Form",
type = {"wild-gift/tiger", 1},
require = gifts_req1,
points = 5,
cooldown = 10,
mode = "sustained",
sustain_equilibrium = 15,
getDam = function(self, t) return self:combatScale(self:getWil(7, true) * self:getTalentLevel(t), 5, 0, 40, 35)end,
getSpeed = function(self, t) return self:combatTalentScale(t, 0.15, 0.5, 0.75) end,
getPower = function(self, t) return math.ceil(self:combatTalentScale(t, 1.5, 7.5, 0.75) + self:combatTalentStatDamage(t, "wil", 5, 20)) end,
activate = function(self, t)
return {
stats = self:addTemporaryValue("inc_stats", {[self.STAT_STR] = t.getPower(self, t),
[self.STAT_DEX] = t.getPower(self, t),
}),
ps = self:talentTemporaryValue("combat_physspeed", t.getSpeed(self, t)),
dam = self:addTemporaryValue("combat_dam", t.getDam(self, t)),
mentalresist = self:addTemporaryValue("combat_mentalresist", -10),
-- self.replace_display = mod.class.Actor.new{image = "npc/tiger-form.png"},
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("inc_stats", p.stats)
self:removeTemporaryValue("combat_physspeed", p.ps)
self:removeTemporaryValue("combat_dam", p.dam)
self:removeTemporaryValue("combat_mentalresist", p.mentalresist)
-- self:replace_display = nil
return true
end,
info = function(self, t)
return([[Assume the aspect of a monstrous tiger]])
end
}
i keep getting this error
Lua Error: /engine/interface/ActorTalents.lua:232: /engine/interface/ActorTalents.lua:796: attempt to index local 'p' (a string value)
and i cannot see why, i mean i don't really understand the code very well, so , give us a hint.
when I activate this sustain (cobbled together from other sustains)
newTalent{
name = "Tiger Form",
type = {"wild-gift/tiger", 1},
require = gifts_req1,
points = 5,
cooldown = 10,
mode = "sustained",
sustain_equilibrium = 15,
getDam = function(self, t) return self:combatScale(self:getWil(7, true) * self:getTalentLevel(t), 5, 0, 40, 35)end,
getSpeed = function(self, t) return self:combatTalentScale(t, 0.15, 0.5, 0.75) end,
getPower = function(self, t) return math.ceil(self:combatTalentScale(t, 1.5, 7.5, 0.75) + self:combatTalentStatDamage(t, "wil", 5, 20)) end,
activate = function(self, t)
return {
stats = self:addTemporaryValue("inc_stats", {[self.STAT_STR] = t.getPower(self, t),
[self.STAT_DEX] = t.getPower(self, t),
}),
ps = self:talentTemporaryValue("combat_physspeed", t.getSpeed(self, t)),
dam = self:addTemporaryValue("combat_dam", t.getDam(self, t)),
mentalresist = self:addTemporaryValue("combat_mentalresist", -10),
-- self.replace_display = mod.class.Actor.new{image = "npc/tiger-form.png"},
}
end,
deactivate = function(self, t, p)
self:removeTemporaryValue("inc_stats", p.stats)
self:removeTemporaryValue("combat_physspeed", p.ps)
self:removeTemporaryValue("combat_dam", p.dam)
self:removeTemporaryValue("combat_mentalresist", p.mentalresist)
-- self:replace_display = nil
return true
end,
info = function(self, t)
return([[Assume the aspect of a monstrous tiger]])
end
}
i keep getting this error
Lua Error: /engine/interface/ActorTalents.lua:232: /engine/interface/ActorTalents.lua:796: attempt to index local 'p' (a string value)
and i cannot see why, i mean i don't really understand the code very well, so , give us a hint.