Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function animateMonster()
- print "******* ZAAAAAAPPP!!!!!!!!!!!!! *******"
- local function finishedAttackAnimation(self, event)
- if event.phase == "end" then
- group.gfx.elements.Npc8:removeEventListener('sprite', group.gfx.elements.Npc8) -- This line causes error below.
- group.gfx.elements.Npc8:play ((currentMap.monsterList[M].npcName .. " Stance 2") )
- currentMap.monsterList[M].npcTurnState = "moved"
- -- print (M, currentMap.monsterList[M].npcTurnState)
- npcActionTakingPlace = false
- print("DMHM-dispatch from 'attack-animate'");Runtime:dispatchEvent{name='dungeonMasterHasMoved'}
- end
- end
- group.gfx.elements.Npc8.sprite = finishedAttackAnimation
- group.gfx.elements.Npc8:addEventListener('sprite', group.gfx.elements.Npc8)
- group.gfx.elements.Npc8:play ((currentMap.monsterList[M].npcName .. " Attack 2") )
- end
- --[[
- ** This error only occurs when the animation has been triggered at least once, the game is reset, and the player encounters it again. If the level is completely reloaded from IN-Game or if I attack and force him to do a hit animation, it goes away.
- Runtime error
- ?:0: attempt to index a nil value
- stack traceback:
- [C]: ?
- ?: in function '?'
- ?: in function <?:215>
- ]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement