Grimwold's Grimrock Puzzle Frameworks

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Eightball
Posts: 48
Joined: Thu Jan 09, 2014 8:21 am

Re: Grimwold's Grimrock Puzzle Frameworks

Post by Eightball » Thu Feb 06, 2014 3:09 am

Wow, Komag! Thanks so much. Your script is much more compact and easy to reuse and customize than mine was going to be.
If you don't mind, I'll post it here as another standard framework.

THE STARING CONTEST FRAMEWORK
SpoilerShow

Code: Select all

-- Staring at the south wall opens the secret doors there.
-- Changing direction or moving from the plate will deactivate the event.
-- by Komag in "Legend of Grimrock: Remake"
stareCounter = 0

function stareCheck()
  if party.facing ~= 2 then
    stareCounter = 0
    return
  end
  if party.facing == 2 then
    stareCounter = stareCounter + 1
  end
  if stareCounter == 120 then
    stareDoor_1:open()
    stareDoor_2:open()
    stareDoor_3:open()
  end
end

function stareReset()  
-- set the starePlate to call this function and
-- to deactivate the timer when the party moves off of it 
-- (i.e. when the plate deactivates).
  if starePlate:isUp() then
    stareCounter = 0
  end
end
The timer is set to do the stareCheck every 0.1 second (counter is now part of the script, so no need to create one via the editor).
Then the door opens when the in-script counter reaches a certain number of unbroken and successful stareChecks. It should be noted that as it stands, this counter total is not in seconds, but in number of times the timer hits 0.1 seconds. So setting the counter total to 10 would be just one second of staring.

Komag uses two pressure plates, one hidden (the real one) and one normal (just for show), though I didn't need to. One reason to do this is if a monster activates the plate and sits on it long enough while the party faces the right direction (anywhere in the level), the stareDoor(s) will open. Also, for the same reason, it is important to make the real plate (or your only one) to be unresponsive to items placed on it. Unless of course, you want to have a mobile staring contest?

hyteria
Posts: 263
Joined: Sat Dec 29, 2012 8:22 pm

Re: Grimwold's Grimrock Puzzle Frameworks

Post by hyteria » Sun Nov 01, 2020 12:25 am

hey , great thread

by the way this is working with grimrock 2?

thx

Post Reply