TorchItem Component issues?
Posted: Fri Nov 21, 2014 7:14 pm
I've been trying to create a lantern item (definition below), but when I pick up the item it results in this error:
What am I doing wrong? I have tried defining fuel amounts as well but to no avail. Is it an issue with my syntax?
Previously I used baseObject = "torch_everburning" but that resulted in item atlas glitches when it automatially increments the index on equip.
Item Definition:
Thanks to anyone who can help.
What am I doing wrong? I have tried defining fuel amounts as well but to no avail. Is it an issue with my syntax?
Previously I used baseObject = "torch_everburning" but that resulted in item atlas glitches when it automatially increments the index on equip.
Item Definition:
SpoilerShow
Code: Select all
defineObject{
name = "hand_lantern",
baseObject = "base_item",
components = {
{
class = "Model",
model = "mod_assets/models/sx_lantern.fbx",
},
{
class ="Item",
uiName = "Lantern",
gfxAtlas = "mod_assets/textures/items_atlas.dds",
gfxIndex = 0,
GfxIndexPowerAttack = 1,
secondaryAction = "Fire_Blast",
impactSound = "impact_blade",
weight = 3,
traits = { "item" },
description = "An old oil lantern.",
},
{
class ="TorchItem",
onEquipItem =
function()
self.go.torch:setType("spot")
self.go.torch:enable()
end,
},
{
class = "MeleeAttack",
attackPower = 5,
attackSound = "impact_blade",
cooldown = 3.0,
baseDamageStat = "strength",
damageType = "physical",
},
{
class = "CastSpell",
name = "Fire_Blast",
uiName = "Fire Blast",
spell = "fireburst",
repeatCount = 0,
cooldown = 6,
energyCost = 30,
},
},
editorIcon = 24,
}