disabling movement

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
maneus
Posts: 246
Joined: Mon Jun 17, 2013 10:42 pm
Location: Switzerland

Re: disabling movement

Post by maneus »

That is another solution, Chimera005ao. But the problem here is that every time the player wants to move he run into the blockage and make the sound "party_move_blocked".
So in my eyes the cMove counter solution is more professional than yours.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: disabling movement

Post by Komag »

Best to use Notepad++ for lua text editing, you can even set the programming language to LUA for a little extra syntax help, and it looks nice and neat, and no chance of line break errors that Notepad or Wordpad can sometimes cause.
Finished Dungeons - complete mods to play
User avatar
Chimera005ao
Posts: 187
Joined: Sun Jun 29, 2014 8:34 am

Re: disabling movement

Post by Chimera005ao »

But the problem here is that every time the player wants to move he run into the blockage and make the sound "party_move_blocked".
So in my eyes the cMove counter solution is more professional than yours.
True... and I suppose you could still use an onMove hook to block player movement in a specific direction.
I'm thinking about how you could do that dynamically. Perhaps onMove return false if a certain object is on that tile?

Generally what I wanted was to prevent player and monster movement and attacks toward one another, while enemies line a hall, until after a certain event.
And generating an invisible maze might also be on the list.
User avatar
aaneton
Posts: 189
Joined: Fri Sep 21, 2012 1:53 pm

Re: disabling movement

Post by aaneton »

This thread describes how to create a party_blocker, which is easy to spawn or/and place with level editor (I used this in ORRR2).

viewtopic.php?f=14&t=4886&start=20

Add to objects.lua

Code: Select all

    -- this defines party_blocker -- don't forget to always set it to "deactivated", so that monsters can get through.
    cloneObject{
      name = "party_blocker",
      baseObject = "blocker",
      editorIcon = 96,
    }

    -- this defines a party which cannot pass party_blockers:
    cloneObject{
      name = "party",
      baseObject = "party",
      onMove = function(self, dir)
        local dx,dy = getForward(dir)
        local destX = self.x + dx
        local destY = self.y + dy
        for i in entitiesAt(party.level,destX,destY) do
          if i ~= nil and i.name == "party_blocker" then
            return false
          end
        end
      end,
    }
My Grimrock mod (LoG1): The Onkalo Project
My Android (and windows desktop) game: Balloon Gentleman
Post Reply