skeleton warrior á la darknut (immune to hits from front)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
myNameIsOver20Charac
Posts: 3
Joined: Thu Jan 04, 2018 12:23 am

skeleton warrior á la darknut (immune to hits from front)

Post by myNameIsOver20Charac »

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 :D

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
myNameIsOver20Charac
Posts: 3
Joined: Thu Jan 04, 2018 12:23 am

Re: skeleton warrior á la darknut (immune to hits from front

Post by myNameIsOver20Charac »

I found the onDamage function! however I still don't know how to check the direction the attack came from, so right now it's kind of useless :( I know that the damageTile() function has a direction so it should be possible, right? I mean, I'm guessing the onDamage hook is triggered by the damageTile function, so if there i a way to get the event that triggered a hook, then that should be what I'm looking for.

Edit: If nothing else works I do have an emergency backup solution, and that is to base it on the players position. I'd rather not do that however, since it's far from foolproof regarding projectiles.
Post Reply