Page 2 of 2

Re: Sticky floor

Posted: Tue Mar 19, 2013 12:05 am
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

Re: Sticky floor

Posted: Tue Mar 19, 2013 12:14 am
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. :)

Re: Sticky floor

Posted: Tue Mar 19, 2013 11:17 am
by Xanathar
Cool it worked :) Can't wait to see it in action eheh :D

Re: Sticky floor

Posted: Tue Mar 19, 2013 12:02 pm
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).