Visual trick -- Button on the secret wall (that opens)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Alcator
Posts: 37
Joined: Fri Apr 13, 2012 9:59 am

Visual trick -- Button on the secret wall (that opens)

Post by Alcator »

Normally, you cannot place an opening mechanism on a secret wall. But there are quite a few occasions where that's exactly the spot where you'd like to place it.

You could of course place a button on a wall, then select that prop in the editor and move it (ASWD, for those who don't know) to an empty space, and it would look like a wall with a button, but it could be walked through, which is not what we want.

I've found a way how to simulate a button ON a secret door with a minimal graphical glitching.

Place a lua script object into your map and copy the following function(s) as needed into it. Explanation below the script:

Code: Select all

function buttonIntoDoorDungeon(self)
  local levl,x,y,f
  x = self.x
  y = self.y
  levl = self.level
  f = self.facing
  -- we use dragon statue(s) to block passage through the otherwise passable "button wall"
  for iterX = x-1,x+1 do
    for iterY = y-1,y+1 do 
      for ent in entitiesAt(levl,iterX,iterY) do
        if ent.name == "dragon_statue" then
          ent:destroy()
        end
      end
    end
  end
  self:destroy()
  local new_id = spawn("dungeon_secret_door",levl,x,y,f)
  new_id:open()
end

function buttonIntoDoorTemple(self)
  local levl,x,y,f
  x = self.x
  y = self.y
  levl = self.level
  f = self.facing
  -- we use dragon statue(s) to block passage through the otherwise passable "button wall"
  for iterX = x-1,x+1 do
    for iterY = y-1,y+1 do 
      for ent in entitiesAt(levl,iterX,iterY) do
        if ent.name == "dragon_statue" then
          ent:destroy()
        end
      end
    end
  end
  self:destroy()
  local new_id = spawn("temple_secret_door",levl,x,y,f)
  new_id:open()
end
They are just two versions of the same function, one for Dungeon tileset, one for Temple tileset. Modify the "spawn" call if you are using a different tileset.

How to use this?
1. Place a secret button (any type) on any wall (otherwise the editor won't let you place it). Or, spawn the button via script wherever you want.
2. Select it in the editor and move it [WASD keys, plus E/Q for rotation] into a "corridor" so that it blocks it like a secret door would. If you test your map now, you will see the button, but can walk through it.
3. Place a dragon_statue just behind the wall -- this will prevent walking through the button.
4. Add connector to the button that leads to the "buttonIntoDoorXXXXXX(self)" function -- select the one function that corresponds to the level's tileset (Dungeon or Temple).
That's it! As soon as the button is clicked, it disappears and is immediately replaced with a secret door that starts opening. The dragon_statue also disappears (before the opening), so you can suddenly move through.

Of course, the button can have multiple connectors, so you can also connect it to a secondary secret_door from the other side, which will make sure no-one sees ugly glitches or the statue.

Picture of a typical map layout (from my Rite of Passage dungeon)
Image
Alcator
Posts: 37
Joined: Fri Apr 13, 2012 9:59 am

Re: Visual trick -- Button on the secret wall (that opens)

Post by Alcator »

in case you wonder: the iterX and iterY section looks for a dragon statue in the 9 squares around the button (therefore, if you need to have decorative statues there, change the code a bit and use eg Goromorg as blockers). This ensures that the code is highly universal and can be used without changes in any "orientation".
User avatar
Damonya
Posts: 134
Joined: Thu Feb 28, 2013 1:16 pm
Location: France
Contact:

Re: Visual trick -- Button on the secret wall (that opens)

Post by Damonya »

A another simple solution and with no script, is to build an invisible wall secret door with GMT. This is how I do personal, but your script is interesting.
Orwak - MOD - Beta version 1.0
Alcator
Posts: 37
Joined: Fri Apr 13, 2012 9:59 am

Re: Visual trick -- Button on the secret wall (that opens)

Post by Alcator »

Damonya wrote:A another simple solution and with no script, is to build an invisible wall secret door with GMT. This is how I do personal, but your script is interesting.
"simple" - "build" - "with GMT"

Good one :-)

(nothing personal, that just cracked me up)
User avatar
Damonya
Posts: 134
Joined: Thu Feb 28, 2013 1:16 pm
Location: France
Contact:

Re: Visual trick -- Button on the secret wall (that opens)

Post by Damonya »

simple in the sense that you do it once, after it is certain that you are more comfortable with scripting than me.

1. First install Grimrock Model Toolkit and download the Asset Pack.
2. Open GMT and the dungeon_secret_door.model
3. Go to Model Nodes: Node 2 :Gates
4. Changes the 0,01 in Matrix to 0
5. Save your file as : invisible_wall.model in your mod_assets/models folder
6. In objects.lua:
SpoilerShow

Code: Select all

cloneObject{
   name = "invisible_wall",
   baseObject = "dungeon_secret_door",
   model = "mod_assets/models/invisible_wall.fbx",
}
and I use it for other things too.
Orwak - MOD - Beta version 1.0
Post Reply