What am I doing wrong?

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Micbran
Sher'Tul
Posts: 1154
Joined: Sun Jun 15, 2014 12:19 am
Location: Yeehaw, pardner

What am I doing wrong?

#1 Post by Micbran »

Whenever I mouse over my talent I made, it errors out, closes the level up screen and adds a level to it.

Lua Error: /engine/interface/ActorTalents.lua:80: bad argument #2 to 'info' (no value)
At [C]:-1
At [C]:-1 info
At /engine/interface/ActorTalents.lua:80 info
At /mod/class/Actor.lua:5468 getTalentFullDescription
At /mod/dialogs/LevelupDialog.lua:907 getTalentDesc
At /mod/dialogs/LevelupDialog.lua:682 tooltip
At /mod/dialogs/elements/TalentTrees.lua:184 updateTooltip
At /mod/dialogs/elements/TalentTrees.lua:110 fct
At /engine/Mouse.lua:76 receiveMouseMotion
At /engine/Mouse.lua:96 delegate
At /engine/ui/Dialog.lua:602 mouseEvent
At /engine/ui/Dialog.lua:343 fct
At /engine/Mouse.lua:76

And the talent...

Code: Select all

newTalent {
    name = "Overpower", short_name = "MIC_OVERPOWER",
    type = {"spells/arcane-remnants", 3},
    require = spells_req3,
    points = 5,
    mana = 30,
    cooldown = 20,
    range = 5,
    radius = 0,
    getRadius = function(self, t)
        local talLevel = self:getTalentLevel(t)
        if talLevel >= 4 then return 1 else return 0 end
    end,
    tactical = { DISABLE = 2 },
    direct_hit = true,
    requires_target = true,
    getDuration = function(self, t) self:combatTalentLimit(t, 6, 2, 4) end,
    target = function(self, t)
        return {type="ball", range = self:getTalentRange(t), radius = getRadius(self, t), talent = t}
    end,
    action = function(self, t)
        local tg = self:getTalentTarget(self, t)
        local x, y = self:getTarget(tg)
        if not x or not y then return nil end
        self:project(tg, x, y, function(tx, ty)
            local target = game.level.map(tx, ty, Map.ACTOR)
            if not target or target == self then return end
            if target:canBe("pin") then
                    target:setEffect(target.EFF_PINNED, t.getDuration(self, t), {apply_power=self:combatSpellpower()})
                else
                    game.logSeen(target, "%s resists the pin!", target.name:capitalize())
            end
            if target:canBe("silence") then
                    target:setEffect(target.EFF_SILENCED, t.getDuration(self, t), {apply_power=self:combatSpellpower()})
                else
                    game.logSeen(target, "%s resists the silence!", target.name:capitalize())
            end
        end)
        local _
        game:playSoundNear(self, "talents/arcane")

        return true
    end,
    info = function (self, t)
        return ([[Silences and pins everything within a radius %d ball for %d turns.
        The radius of the ball will increase to one at talent levels 4 and greater.
        Apply chance will increase with your spellpower and effect length will increase with talent level.]]):
        format(self:getTalentRadius(self, t), t.getDuration(self, t))
    end,
}
EDIT: Er... fixed. Forgot to add a return statement to all of my functions. :shock:
A little bit of a starters guide written by yours truly here.

Post Reply