"Summoned" creature not appearing until a turn later
Posted: Sun Aug 01, 2010 7:19 pm
I believe this to be a nuanced when-things-are-displayed-to-screen bug, and rather than poke around in the Map internals until I will my hair out I figured I would ask around first.
I am implementing the conversion from human to zombie in my module, and decided to put the code in mod.class.NPC.act function. The code looks like this:
The net effect is that the NPC explodes in a pretty green splash, the original character disappears and... nothing else. The area where the zombie "z" should have been added is just showing the terrain. If I then move the player character and cause the game to tick the zombie character appears after it moves towards the player. I tried looking at the ToME summoning talents since they have the behavior that I want but I do not see the difference. Any ideas?

I am implementing the conversion from human to zombie in my module, and decided to put the code in mod.class.NPC.act function. The code looks like this:
Code: Select all
-- Check if we should turn into a ZOMBIE?!
if self.type == "humanoid" and self.subtype ~= "zombie" and self.vload >= self.max_vload then
-- Create the replacement zombie
local z = game.zone:makeEntityByName(game.level, "actor", "ZOMBIE")
game.zone:addEntity(game.level, z, "actor", self.x, self.y)
game.level.map:particleEmitter(self.x, self.y, 1, "acid")
game.logPlayer(game.player, "%s just turned into a zombie!", self.name)
self:die()
end