Ok, has anyone played the legend of zelda? I want to make an enemy immune to hits from the front, like a darknut, if that helps anyone. I haven't really found any helpfull functions in the scripting reference. Guessing the best way is a function activating if the enemy is hit, kind of like onDie if there is a corresponding one, then somehow get the hit in question, check the direction and ignore if it was from the front. I feel like these functions should exist, but I have no idea what they are called
Edit: found this code, but it just prevents the monster from hitting you:
Code: Select all
cloneObject{
name = "npcGoromorg",
baseObject = "goromorg",
evasion = 100000,
onAttack = function(self, dir)
return false
end,
onMove = function(self, dir)
return false
end,
}
and a comment:
by Akatana » Sun Sep 16, 2012 9:34 am
Nope you dont damage them because return false cancels the damage event so they dont get any damage