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 »

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: 266
Joined: Sat Dec 29, 2012 8:22 pm

Re: Grimwold's Grimrock Puzzle Frameworks

Post by hyteria »

hey , great thread

by the way this is working with grimrock 2?

thx
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Grimwold's Grimrock Puzzle Frameworks

Post by Grimwold »

hyteria wrote: Sun Nov 01, 2020 12:25 am hey , great thread

by the way this is working with grimrock 2?

thx
I recently spent a few hours trying to get some of these working in Grimrock 2 and unfortunately had no luck.. The problems stemmed from how I spawned in the timers etc. needed by these scripts.. this appears to have changed in LOG2 and I could not work out how to fix it.
Post Reply