Use
Code: Select all
villageMummy1Lantern:destroy()
Code: Select all
villageMummy1Lantern:destroy()
Because it doesn't. All of the gameobject methods are accessible as object:method()brzrkr wrote:2. Why does it say that "gameobject" or "go" doesn't exist?
Code: Select all
Try this in the hook:
function smotherLantern(monsta)
print(monsta.go.id, unpack{monsta.go:getPosition()})
for monster in monsta.go.map:entitiesAt(monsta.go.x, monsta.go.y) do
if monster.monster and not monster.go then -- notice that the condition FAILS if there is a value for monster.go
print(monster.id, unpack{monster:getPosition()}) -- notice that this is not monster.go.id
end
end
end
No two objects [existing concurrently] on the map should have the exact same id. That will crash it.And the wall lantern has that same exact ID.
If its id is 'Lantern' then the way is: Lantern:destroy()How am I supposed to destroy the lantern or disable one of its components when the monster dies, if this is not the correct way?
You could set it up this way by manually naming the objects. When you have a concatenated string and need to use it as an ID, use the function findEntity() in place of the id, and pass to it the string.3. About the commented part, since the dying monster's ID is villageMummy, I was wondering if I could take his id, append "Lantern" to it in a string (thus creating the lantern's ID), and then use the string variable as if it were the lantern ID itself, to destroy the lantern directly. If not, how can I turn that string into the actual lantern entity?
.
Code: Select all
onComputeCooldown = function(champion, weapon, attack, attackType, level)
if level > 0 then return 90 end
end,
The builtin conditions don't really work like custom conditions. Anyway, there's no onComputeCooldown hook for conditions, only skills and traits. You'll need to add a trait to all champions that checks for the presence of your custom condition.zimberzimber wrote:How can a condition manipulate a champions cool down?
It's definitely possible because there's a condition that does that already. (Haste)
I've added this to the conditions definition but it did nothing:Code: Select all
onComputeCooldown = function(champion, weapon, attack, attackType, level) if level > 0 then return 90 end end,
Into the hidden mother-of-all-not-simply-added-stats trait it goesminmay wrote:The builtin conditions don't really work like custom conditions. Anyway, there's no onComputeCooldown hook for conditions, only skills and traits. You'll need to add a trait to all champions that checks for the presence of your custom condition.
The elevation? [-7 to 6?]AndakRainor wrote:How do I get the height of a monster ?