Whatever object is being called from line 13542, is missing its tiledamager component, or the component has a custom name.
Post the section of log2_monsters.lua surrounding line 13542.
Code: Select all
self.go.tiledamager:disable()
Code: Select all
defineObject{
name = "shock_wave",
baseObject = "base_spell",
components = {
{
class = "Blast",
delay = 0.2,
effect = "shockburst",
},
-- hack to prevent BlastComponent error
{
class = "Null",
name = "tiledamager",
enabled = false,
},
}
}
Code: Select all
defineObject{
name = "catacomb_alcove_empty_low",
baseObject = "base_wall",
components = {
{
class = "Model",
model = "mod_assets/models/catacomb_alcove_empty_low.fbx",
staticShadow = true,
},
{
class = "Occluder",
model = "assets/models/env/catacomb_alcove_01_occluder.fbx",
},
{
class = "Surface",
name = "surface_1",
offset = vec(0, 1.37, 0.2),
size = vec(2.2, 0.65),
},
{
class = "Clickable",
name = "clickable1",
offset = vec(0, 1.32+0.1, 0),
size = vec(1.1, 0.2, 0.9),
pedestal = true,
},
{
class = "Surface",
name = "surface_2",
offset = vec(0, 0.35, 0),
size = vec(2, 0.35),
},
{
class = "Clickable",
name = "clickable2",
offset = vec(0, 0.5+0.1, 0),
size = vec(1.1, 0.2, 0.9),
pedestal = true,
},
},
editorIcon = 92,
minimalSaveState = false,
}
Code: Select all
{
class = "Surface",
name = "surface_1",
offset = vec(0, 1.37, 0.2),
size = vec(2.2, 0.65),
onAcceptItem = function(self,item)
local surf = GameMode.tempSurface
GameMode.tempSurface = nil
if surf ~= 1 then return false end
end,
},
{
class = "Clickable",
name = "clickable1",
offset = vec(0, 1.32+0.1, 0),
size = vec(1.1, 0.2, 0.9),
pedestal = true,
onClick = function(self)
if getMouseItem() then GameMode.tempSurface = 1 end
end,
},
{
class = "Surface",
name = "surface_2",
offset = vec(0, 0.35, 0),
size = vec(2, 0.35),
onAcceptItem = function(self,item)
local surf = GameMode.tempSurface
GameMode.tempSurface = nil
if surf ~= 2 then return false end
end,
},
{
class = "Clickable",
name = "clickable2",
offset = vec(0, 0.5+0.1, 0),
size = vec(1.1, 0.2, 0.9),
pedestal = true,
onClick = function(self)
if getMouseItem() then GameMode.tempSurface = 2 end
end,
},
Unfortunately, I could not get it to work as intended, but thank you for your effort anyway.minmay wrote: ↑Wed Jun 23, 2021 7:54 pm The game picks the first accepting SurfaceComponent on the object when you click a ClickableComponent; it has no way of knowing that you want clickable2 to correspond to surface_2. To work around this, you can use the onAcceptItem hook to reject the item from all SurfaceComponents except the one you want the item to go to. So you'd want something like this:
Code: Select all
defineSpell{
[...]
-- spellIcon = 1,
spellIcon = 0,
spellIconAtlas = "mod_assets/textures/spell_icon",
icon = 3,
-- iconAtlas = "mod_assets/textures/spell_icons",
}
Code: Select all
spellIconAtlas = "mod_assets/textures/spell_icon.tga",
Code: Select all
defineObject{
name = "teleport_spin",
components = {
{
class = "Teleporter",
triggeredByParty = true,
triggeredByMonster = true,
triggeredByItem = true,
spin = "north",
--spin = "turn_around",
--onInit = function(self)
-- self.go.teleporter:setTeleportTarget(1,0,1,0)
--end,
},
{
class = "Controller",
initialState = "activate",
onInitialActivate = function(self)
self.go.teleporter:enable()
self.go.timer:start()
end,
onInitialDeactivate = function(self)
self.go.teleporter:disable()
end,
onActivate = function(self)
self.go.teleporter:enable()
self.go.light:fadeIn(0.5)
end,
onDeactivate = function(self)
self.go.teleporter:disable()
end,
onToggle = function(self)
if self.go.teleporter:isEnabled() then
self:deactivate()
else
self:activate()
end
end,
},
{
class = "Timer",
currentLevelOnly = false,
triggerOnStart = false,
disableSelf = true,
timerInterval = 1,
onActivate = function(self)
self.go:destroyDelayed()
end,
},
},
}
Code: Select all
defineTrait{
name = "rogue_accuracy",
uiName = "Rogue Accuracy",
icon = 34,
hidden = true,
description = ".",
onComputeAccuracy = function(champion, weapon, attack, attackType, level)
if level > 0 then
local item1 = champion:getItem(ItemSlot.Weapon)
local item2 = champion:getItem(ItemSlot.OffHand)
local item3 = champion:getItem(ItemSlot.Cloak)
if (item2 and item2:hasTrait("dagger")) and (item1 and item1:hasTrait("dagger")) then return math.floor(champion:getLevel()/2)
end
if (item3 and item3:hasTrait("cloak")) and (item1 and item1:hasTrait("dagger")) then return math.floor(champion:getLevel()*3/4)
end
if (item3 and item3:hasTrait("cloak")) and (item2 and item2:hasTrait("dagger")) then return math.floor(champion:getLevel()*3/4)
end
if (item1 and item1:hasTrait("dagger")) and (item2 and item2:hasTrait("dagger")) and (item3 and item3:hasTrait("cloak")) then return math.floor(champion:getLevel()*3/4)
end
end
end,
}
Code: Select all
defineTrait{
name = "cooldown_caster",
uiName = "Caster cooldown",
icon = 34,
description = "Reduces Cooldown when casting spells.",
onComputeCooldown = function(champion, weapon, attack, attackType, level)
if level > 0 then
local item1 = champion:getItem(ItemSlot.Weapon)
local item2 = champion:getItem(ItemSlot.OffHand)
if (item2 and item2.go.runepanel) and (item1 and item1:hasTrait("staff")) then return 0.7
end
if (item1 and item1.go.runepanel) and (item2 and item2:hasTrait("staff")) then return 0.7
end
end
end,
}
Code: Select all
onCast = function(champion, x, y, direction, elevation, skillLevel)
playSound("generic_spell")
for i = 1, 4, 1 do
if party.party:getChampion(i):isAlive() then
party.party:getChampion(i):setCondition("feather", skillLevel*2)
end
end
end,