Sticky floor

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: Sticky floor

Post by Xanathar »

Put this into a script, connect hidden pressure plates to it:

Code: Select all

TIME_BETWEEN_STEPS = 3

g_Time = nil
function checkStep()
	local now = getStatistic("play_time")

	if (g_Time == nil) then
		g_Time = now
		return
	end
	
	local diff = now - g_Time
	
	if (diff < TIME_BETWEEN_STEPS) then 
		_openTheBlockers()
	end
	
	g_Time = now
end

function _openTheBlockers()
	print("THIS MUST BE DONE BY SPIDERFIGHTER :)")
end
The time is in seconds. No timers needed :)

How it works: it uses getStatistic("play_time") to track how many seconds pass between pressure plates, and if it is below 3 it calls _openTheBlockers
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: Sticky floor

Post by SpiderFighter »

Wow, you guys are fast!! Thanks, Xanathar. It's going to be a fun moment in the game, I hope. [EDIT to add: It works like a charm, and it made me giggle like a little schoolgirl with sheer glee, too!]

@msyblade: I think you're right...if I have time tomorrow, I'll try to see if I can get it working that way, at least for the experience of having done it. :)
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: Sticky floor

Post by Xanathar »

Cool it worked :) Can't wait to see it in action eheh :D
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
SpiderFighter
Posts: 789
Joined: Thu Apr 12, 2012 4:15 pm

Re: Sticky floor

Post by SpiderFighter »

Xanathar wrote:Cool it worked :) Can't wait to see it in action eheh :D
I was inspired by this great "tippy toe" music I grabbed online...the whole sequence leaves you feeling like "what the heck just happened?" ROFL!
Thanks again (to both of you).
Post Reply