Wizard door peek

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Wizard door peek

Post by msyblade »

This is the wizard checking the door slot event from log 2, minus the checks for items so you can just hook it to a floor trigger, or a doorbell. Make sure to place a scriptable wizard behind a castle entrance door, and which direction the party should be facing the door.

Code: Select all

    lastKnockTime = nil

    function wizardPeep()
       
          -- fail

          -- cooldown for door check animation
          local playTime = GameMode.getStatistic("play_time")
          if lastKnockTime and playTime - lastKnockTime < 100 then return end
          lastKnockTime = playTime

          if party.facing == 3 then
             if wizard_door.brain:performAction("checkDoor") then
                castle_entrance_door_1.animation:play("hatch")
                hudPrint ("Go away!")
             end
          end
       end

Enjoy!
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
Post Reply