Invisible pits

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
SharinaDarkstar
Posts: 29
Joined: Fri Jun 29, 2012 1:47 pm

Invisible pits

Post by SharinaDarkstar »

Not that I want to overuse this feature, as it could easily drive people crazy, but can anyone suggest the best way to make an invisible pit. IE: A normal bit of floor that you suddenly fall through unexpectedly. At the moment, I place a pit on the same square as a drain - works fine, except for slight graphics weirdness when you fall through and see the drain pipe whiz by - but not perfect. At least with a drain, you can imagine that it opened under you.
User avatar
pferguso
Posts: 40
Joined: Tue Nov 06, 2012 6:09 pm

Re: Invisible pits

Post by pferguso »

I dynamically spawned the pit in the place where a hidden pressure switch was. It was kind of tricky because I had to have a means of removing it when the player fell through. So create a hidden pressure switch, and connect it to a script entity that checks to see if the pressure plate is down or up, like this:
SpoilerShow
function checkPressureSwitch()
local trapPlate = findEntity("theTrapPlate");
if trapPlate:isDown() == false then
createPit()
else
removePit()
end
end

function createPit()
local isPit = "false"
for d in allEntities(party.level) do
if d.id == "pit1" then
isPit = "true"
end
end
if isPit == "false" then
local pit1 = spawn("temple_pit", self.level, 8, 23, 2, "pit1")
end
end

function removePit()
local pit1 = findEntity("pit1");
if pit1 ~= null then
--print("found pit");
pit1:destroy()
end
end
Also, make sure your floor underneath has a ceiling shaft, or you'll get weird geometry during the fall.
SharinaDarkstar
Posts: 29
Joined: Fri Jun 29, 2012 1:47 pm

Re: Invisible pits

Post by SharinaDarkstar »

Excellent, just what I needed. Thanks.

The hidden pits in DM and CSB are pretty much just virtually invisible outlines, rather than the obvious closed trapdoor used in Grimrock.
Post Reply